Package org.alfresco.util
Class AbstractTriggerBean
- java.lang.Object
-
- org.alfresco.util.AbstractTriggerBean
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.scheduling.quartz.JobDetailAwareTrigger
- Direct Known Subclasses:
CronTriggerBean
,TriggerBean
@AlfrescoPublicApi public abstract class AbstractTriggerBean extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.scheduling.quartz.JobDetailAwareTrigger, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean
A utility bean to wrap sceduling a job with a scheduler.- Author:
- Andy Hind
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Log
logger
-
Constructor Summary
Constructors Constructor Description AbstractTriggerBean()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
Set the schedulervoid
destroy()
Ensures that the job is unscheduled with the context is shut down.String
getBeanName()
Get the bean/trigger name.org.quartz.JobDetail
getJobDetail()
Get the definition of the job to run.org.quartz.Scheduler
getScheduler()
Get the scheduler with which the job and trigger are scheduled.abstract org.quartz.Trigger
getTrigger()
Abstract method for implementations to build their trigger.boolean
isEnabled()
void
setBeanName(String name)
Get the bean name as this trigger is createdvoid
setEnabled(boolean enabled)
void
setEnabledFromBean(BooleanBean enabled)
void
setJobDetail(org.quartz.JobDetail jobDetail)
Set the definition of the job to run.void
setScheduler(org.quartz.Scheduler scheduler)
Set the scheduler.
-
-
-
Method Detail
-
getJobDetail
public org.quartz.JobDetail getJobDetail()
Get the definition of the job to run.- Specified by:
getJobDetail
in interfaceorg.springframework.scheduling.quartz.JobDetailAwareTrigger
-
setJobDetail
public void setJobDetail(org.quartz.JobDetail jobDetail)
Set the definition of the job to run.- Parameters:
jobDetail
-
-
getScheduler
public org.quartz.Scheduler getScheduler()
Get the scheduler with which the job and trigger are scheduled.- Returns:
- The scheduler
-
setScheduler
public void setScheduler(org.quartz.Scheduler scheduler)
Set the scheduler.- Parameters:
scheduler
-
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
Set the scheduler- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
destroy
public void destroy() throws Exception
Ensures that the job is unscheduled with the context is shut down.- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
Exception
-
getTrigger
public abstract org.quartz.Trigger getTrigger() throws Exception
Abstract method for implementations to build their trigger.- Returns:
- The trigger
- Throws:
Exception
-
setBeanName
public void setBeanName(String name)
Get the bean name as this trigger is created- Specified by:
setBeanName
in interfaceorg.springframework.beans.factory.BeanNameAware
-
getBeanName
public String getBeanName()
Get the bean/trigger name.- Returns:
- The name of the bean
-
isEnabled
public boolean isEnabled()
-
setEnabled
public void setEnabled(boolean enabled)
-
setEnabledFromBean
public void setEnabledFromBean(BooleanBean enabled)
-
-