2013-03-07 21 views
0

如何使用Spring TaskExecutor來執行工作流,我有一組需要執行的模塊,並遵循每個模塊的具體條件。這些模塊必須以jar文件的形式由系統外部生成。模塊的執行由特定的執行時間和次數來設定。如何使用Spring TaskExecutor執行工作流程?

任何人都有任何使用Spring TaskExecutor的命題或例子。

由於

+1

http://static.springsource.org/spring/docs/3.0.x/reference/scheduling.html我想你應該谷歌第一! – 2013-03-07 15:48:04

回答

0

這裏是一個工作示例

class Quartz1 { 
    @Scheduled(cron="* * * * * ?") 
    public void doSomething() { 
     System.out.println("!!!!"); 
    } 
} 

@Configuration 
@EnableScheduling 
public class Quartz { 

    @Bean 
    public Quartz1 quartz1() { 
     return new Quartz1(); 
    } 

    public static void main(String[] args) throws Exception { 
     new AnnotationConfigApplicationContext(Quartz.class); 
    } 
} 

調度imlementation是在彈簧上下文xxx.jar。更多的信息在這裏http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/scheduling.html

相關問題