mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
125484 slanglois: MNT-16155 Update source headers - remove old Copyrights from Java and JSP dource files git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@125603 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
36 lines
1.1 KiB
Java
36 lines
1.1 KiB
Java
package org.alfresco.repo.scheduler;
|
|
|
|
import org.quartz.spi.TriggerFiredBundle;
|
|
import org.springframework.context.ApplicationContext;
|
|
import org.springframework.context.ApplicationContextAware;
|
|
import org.springframework.scheduling.quartz.SpringBeanJobFactory;
|
|
|
|
/**
|
|
* A special Job Factory that is based on the usual {@link SpringBeanJobFactory},
|
|
* but also handles {@link ApplicationContextAware} job beans.
|
|
*
|
|
* @author Nick Burch
|
|
*/
|
|
public class AlfrescoJobFactory extends SpringBeanJobFactory implements ApplicationContextAware
|
|
{
|
|
private ApplicationContext context;
|
|
|
|
@Override
|
|
public void setApplicationContext(ApplicationContext applicationContext)
|
|
{
|
|
this.context = applicationContext;
|
|
}
|
|
|
|
@Override
|
|
protected Object createJobInstance(TriggerFiredBundle bundle)
|
|
throws Exception {
|
|
Object job = super.createJobInstance(bundle);
|
|
if(job instanceof ApplicationContextAware)
|
|
{
|
|
((ApplicationContextAware)job).setApplicationContext(context);
|
|
}
|
|
return job;
|
|
}
|
|
|
|
}
|