Class 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 Detail

      • logger

        protected static org.apache.commons.logging.Log logger
    • Constructor Detail

      • AbstractTriggerBean

        public AbstractTriggerBean()
    • Method Detail

      • getJobDetail

        public org.quartz.JobDetail getJobDetail()
        Get the definition of the job to run.
        Specified by:
        getJobDetail in interface org.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 interface org.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 interface org.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 interface org.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)