Commits

Zemian Deng committed fab518e

Clean up sample config.

  • Participants
  • Parent commits 6651d69

Comments (0)

Files changed (6)

scheduler-spring/config/hello-spring.xml

 <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-     xmlns:p="http://www.springframework.org/schema/p"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
-	
-	<bean id="helloService" class="timemachine.spring.HelloService" init-method="start">
+     	
+	<bean id="helloService" class="timemachine.spring.HelloService" init-method="run">
 		<property name="name" value="World"></property>
 	</bean>
 

scheduler-spring/config/job01-spring.xml

 <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-     xmlns:p="http://www.springframework.org/schema/p"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
 

scheduler-spring/config/timemachine-jmx-spring.xml

 <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-     xmlns:p="http://www.springframework.org/schema/p"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
 

scheduler-spring/config/timemachine-pojo-spring.xml

+<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-3.0.xsd">
+
+	<bean id="schedulerFactory" class="timemachine.scheduler.SchedulerFactory">
+		<constructor-arg value="config/scheduler.properties"></constructor-arg>
+	</bean>
+	<bean id="scheduler" class="timemachine.scheduler.Scheduler" 
+		factory-bean="schedulerFactory" factory-method="createScheduler"
+		init-method="start" destroy-method="destroy">
+	</bean>
+	
+</beans>

scheduler-spring/config/timemachine-spring.xml

 <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-     xmlns:p="http://www.springframework.org/schema/p"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
 

scheduler-spring/src/main/java/timemachine/spring/HelloService.java

 	public void setName(String name) {
 		this.name = name;
 	}
-	public void start() {
+	public void run() {
 		System.out.println("Hello " + name + "!");
 	}
 }