MIFOSX-158: squash arjunk/kaizer commits into one on scheduling spike.
This commit is contained in:
@@ -160,7 +160,8 @@ dependencies {
|
||||
[group: 'com.lowagie', name: 'itext', version: '2.1.7'],
|
||||
[group: 'com.lowagie', name: 'itext-rtf', version: '2.1.7'],
|
||||
[group: 'org.mnode.ical4j', name: 'ical4j', version: '1.0.4'],
|
||||
[group: 'com.googlecode.flyway', name: 'flyway-maven-plugin', version: '2.1.1']
|
||||
[group: 'com.googlecode.flyway', name: 'flyway-maven-plugin', version: '2.1.1'],
|
||||
[group: 'org.quartz-scheduler', name: 'quartz', version: '2.1.7']
|
||||
)
|
||||
|
||||
testCompile 'junit:junit:4.11',
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.mifosplatform.scheduledjobs;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class JobA {
|
||||
|
||||
public void execute(){
|
||||
System.out.println("Running Job A "+new Date());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.mifosplatform.scheduledjobs;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class JobB {
|
||||
|
||||
public void execute(){
|
||||
System.out.println("Running Job B "+new Date());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -49,4 +49,6 @@
|
||||
<import resource="infrastructure.xml" />
|
||||
|
||||
<import resource="securityContext.xml" />
|
||||
|
||||
<import resource="scheduler.xml"/>
|
||||
</beans>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<bean id="cronQuartzJobA" class="org.mifosplatform.scheduledjobs.JobA"/>
|
||||
|
||||
<bean id="cronQuartzJobB" class="org.mifosplatform.scheduledjobs.JobB"/>
|
||||
|
||||
<bean id="jobADetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
|
||||
<property name="group" value="mifosJobs" />
|
||||
<property name="targetObject" ref="cronQuartzJobA" />
|
||||
<property name="targetMethod" value="execute" />
|
||||
<property name="concurrent" value="false" />
|
||||
</bean>
|
||||
<bean id="jobBDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
|
||||
<property name="group" value="mifosJobs" />
|
||||
<property name="targetObject" ref="cronQuartzJobB" />
|
||||
<property name="targetMethod" value="execute" />
|
||||
<property name="concurrent" value="false" />
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="cronTriggerA" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
|
||||
|
||||
<property name="jobDetail" ref="jobADetail" />
|
||||
<property name="cronExpression" value="59 59 23 * * ?" />
|
||||
</bean>
|
||||
<bean id="cronTriggerB" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
|
||||
|
||||
<property name="jobDetail" ref="jobBDetail" />
|
||||
<property name="cronExpression" value="59 59 23 * * ?" />
|
||||
</bean>
|
||||
|
||||
<bean name="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
|
||||
|
||||
<property name="triggers">
|
||||
<list>
|
||||
<ref bean="cronTriggerA" />
|
||||
<ref bean="cronTriggerB" />
|
||||
</list>
|
||||
</property>
|
||||
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user