/
AnotherInjectTask.java
36 lines (30 loc) · 1013 Bytes
/
AnotherInjectTask.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* COPYRIGHT (C) 2015 Andrew Liu. All Rights Reserved.
* <p>
* SpringDemo com.geekspearls.quartz.task.AnotherInjectTask
*
* @author Andrew Liu
* @since 2015 15/08/2015 4:01 PM
*/
package com.geekspearls.quartz.task;
import com.geekspearls.quartz.example3.InjectObject;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;
import java.util.Date;
/**
* @author Andrew
*/
public class AnotherInjectTask extends QuartzJobBean {
@Autowired
private InjectObject injectObject;
@Override
protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
System.out.println("[" + new Date() + "] I am saying another hello from a Quartz job, " +
injectObject);
}
public void setInjectObject(InjectObject injectObject) {
this.injectObject = injectObject;
}
}