spring框架使用任務調度quartz的例子-Job and Trigger 篇
MainJob.java 1
package jobs;
2
3
import org.apache.log4j.Logger;
4
import org.quartz.JobExecutionContext;
5
import org.quartz.JobExecutionException;
6
import org.springframework.scheduling.quartz.QuartzJobBean;
7
8
public class MainJob extends QuartzJobBean {
9
private Logger logger = Logger.getLogger(getClass());
10
@Override
11
protected void executeInternal(JobExecutionContext context)
12
throws JobExecutionException {
13
// TODO Auto-generated method stub
14
logger.debug("Just say hi.");
15
}
16
17
}
18
application.xml
2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18














































































Let life be beautiful like summer flowers and death like autumn leaves.
posted on 2008-06-11 23:21 Alexwan 閱讀(2429) 評論(0) 編輯 收藏 所屬分類: J2EE