Dashboard > Quartz 1 > ... > Documentation > DefineJobWithData
  Quartz 1 Log In View a printable version of the current page.  
  DefineJobWithData
Added by James House, last edited by Nicolas Raoul on Apr 25, 2008  (view change) show comment
Labels: 
(None)

Defining a Job


A Job Class
public class PrintPropsJob implements Job {

	public PrintPropsJob() {
		// Instances of Job must have a public no-argument constructor.
	}

	public void execute(JobExecutionContext context)
			throws JobExecutionException {

		JobDataMap data = context.getJobDetail().getJobDataMap();
		System.out.println("someProp = " + data.getString("someProp"));
	}

}
Defining a Job Instance
// Define job instance
JobDetail job = new JobDetail("job1", "group1", MyJobClass.class);
job.getDataMap().put("someProp", "someValue");

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators