public class AnnotationMethodTriggerFactory extends Object implements TriggerFactory, org.springframework.beans.factory.config.BeanPostProcessor
TriggerFactory
that create Trigger
s from annotation QuartzJob
,
QuartzCronTrigger
and QuartzSimpleTrigger
.
This implementation implements BeanPostProcessor
and search methods which have
QuartzJob
annotation on every spring bean.
When method createTriggers(JobExecuteTypeInCluster)
is called, then from every found methods is
create Trigger
s.
TriggerFactory
,
Trigger
,
QuartzJob
,
QuartzSimpleTrigger
,
QuartzCronTrigger
Constructor and Description |
---|
AnnotationMethodTriggerFactory() |
Modifier and Type | Method and Description |
---|---|
List<org.quartz.Trigger> |
createTriggers(JobExecuteTypeInCluster jobExecuteTypeInCluster)
Create new
Trigger s instances for cluster execute type. |
protected List<org.quartz.Trigger> |
createTriggersFromMethod(String beanName,
Method method,
JobExecuteTypeInCluster jobExecuteTypeInCluster)
Create
Trigger s from one Method on bean. |
Object |
postProcessAfterInitialization(Object bean,
String beanName) |
Object |
postProcessBeforeInitialization(Object bean,
String beanName) |
public List<org.quartz.Trigger> createTriggers(JobExecuteTypeInCluster jobExecuteTypeInCluster)
TriggerFactory
Trigger
s instances for cluster execute type.createTriggers
in interface TriggerFactory
jobExecuteTypeInCluster
- execute type for which Trigger
s will be createdTrigger
sprotected List<org.quartz.Trigger> createTriggersFromMethod(String beanName, Method method, JobExecuteTypeInCluster jobExecuteTypeInCluster)
Trigger
s from one Method
on bean.beanName
- bean namemethod
- method which has QuartzJob
annotationjobExecuteTypeInCluster
- execute type in clusterTrigger
spublic Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessBeforeInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
org.springframework.beans.BeansException
public Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessAfterInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
org.springframework.beans.BeansException
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.