org.alfresco.util
Class AbstractTriggerBean

java.lang.Object
  extended by org.alfresco.util.AbstractTriggerBean
All Implemented Interfaces:
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

public abstract class AbstractTriggerBean
extends java.lang.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.


Field Summary
protected static org.apache.commons.logging.Log logger
           
 
Constructor Summary
AbstractTriggerBean()
           
 
Method Summary
 void afterPropertiesSet()
          Set the scheduler
 void destroy()
          Ensures that the job is unscheduled with the context is shut down.
 java.lang.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(java.lang.String name)
          Get the bean name as this trigger is created
 void setEnabled(boolean enabled)
           
 void setJobDetail(org.quartz.JobDetail jobDetail)
          Set the definition of the job to run.
 void setScheduler(org.quartz.Scheduler scheduler)
          Set the scheduler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 java.lang.Exception
Set the scheduler

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

destroy

public void destroy()
             throws java.lang.Exception
Ensures that the job is unscheduled with the context is shut down.

Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
java.lang.Exception

getTrigger

public abstract org.quartz.Trigger getTrigger()
                                       throws java.lang.Exception
Abstract method for implementations to build their trigger.

Returns:
The trigger
Throws:
java.lang.Exception

setBeanName

public void setBeanName(java.lang.String name)
Get the bean name as this trigger is created

Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware

getBeanName

public java.lang.String getBeanName()
Get the bean/trigger name.

Returns:
The name of the bean

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean enabled)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.