List of usage examples for org.springframework.scheduling.quartz DelegatingJob DelegatingJob
public DelegatingJob(Runnable delegate)
From source file:org.openvpms.component.business.service.scheduler.JobRunner.java
/** * Creates the job.//from w w w.ja va 2 s .co m * * @return a new job * @throws ClassNotFoundException if the job class cannot be found */ private Job createJob() throws ClassNotFoundException { Job result; IMObjectBean bean = new IMObjectBean(configuration, service); Class type = Class.forName(bean.getString("class")); DefaultListableBeanFactory factory = new DefaultListableBeanFactory(context); factory.registerSingleton("jobConfiguration", configuration); Object job = factory.createBean(type, AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, true); if (job instanceof Runnable) { result = new DelegatingJob((Runnable) job); } else { result = (Job) job; } return result; }