Home » quartz-1.6.0 » org » quartz » core » [javadoc | source]
org.quartz.core
public class: QuartzScheduler [javadoc | source]
java.lang.Object
   org.quartz.core.QuartzScheduler

All Implemented Interfaces:
    RemotableQuartzScheduler

This is the heart of Quartz, an indirect implementation of the org.quartz.Scheduler interface, containing methods to schedule org.quartz.Job s, register org.quartz.JobListener instances, etc.

// TODO: more docs...
Field Summary
 ExecutingJobsManager jobMgr     
 ErrorLogger errLogger     
Constructor:
 public QuartzScheduler(QuartzSchedulerResources resources,
    SchedulingContext ctxt,
    long idleWaitTime,
    long dbRetryInterval) throws SchedulerException 

    Create a QuartzScheduler with the given configuration properties.

Method from org.quartz.core.QuartzScheduler Summary:
addCalendar,   addGlobalJobListener,   addGlobalTriggerListener,   addJob,   addJobListener,   addNoGCObject,   addSchedulerListener,   addTriggerListener,   deleteCalendar,   deleteJob,   getCalendar,   getCalendarNames,   getCurrentlyExecutingJobs,   getGlobalJobListener,   getGlobalJobListeners,   getGlobalTriggerListener,   getGlobalTriggerListeners,   getJobDetail,   getJobFactory,   getJobGroupNames,   getJobListener,   getJobListenerNames,   getJobNames,   getJobStoreClass,   getLog,   getPausedTriggerGroups,   getSchedulerContext,   getSchedulerInstanceId,   getSchedulerListeners,   getSchedulerName,   getSchedulerSignaler,   getSchedulerThreadGroup,   getThreadPoolClass,   getThreadPoolSize,   getTrigger,   getTriggerGroupNames,   getTriggerListener,   getTriggerListenerNames,   getTriggerNames,   getTriggerState,   getTriggersOfJob,   getVersion,   getVersionIteration,   getVersionMajor,   getVersionMinor,   interrupt,   isInStandbyMode,   isShutdown,   isSignalOnSchedulingChange,   notifyJobListenersToBeExecuted,   notifyJobListenersWasExecuted,   notifyJobListenersWasVetoed,   notifyJobStoreJobComplete,   notifyJobStoreJobVetoed,   notifySchedulerListenersError,   notifySchedulerListenersFinalized,   notifySchedulerListenersPausedJob,   notifySchedulerListenersPausedTrigger,   notifySchedulerListenersResumedJob,   notifySchedulerListenersResumedTrigger,   notifySchedulerListenersSchduled,   notifySchedulerListenersShutdown,   notifySchedulerListenersUnschduled,   notifySchedulerThread,   notifyTriggerListenersComplete,   notifyTriggerListenersFired,   notifyTriggerListenersMisfired,   numJobsExecuted,   pauseAll,   pauseJob,   pauseJobGroup,   pauseTrigger,   pauseTriggerGroup,   removeGlobalJobListener,   removeGlobalJobListener,   removeGlobalTriggerListener,   removeGlobalTriggerListener,   removeJobListener,   removeNoGCObject,   removeSchedulerListener,   removeTriggerListener,   rescheduleJob,   resumeAll,   resumeJob,   resumeJobGroup,   resumeTrigger,   resumeTriggerGroup,   runningSince,   scheduleJob,   scheduleJob,   setJobFactory,   setSignalOnSchedulingChange,   shutdown,   shutdown,   standby,   start,   supportsPersistence,   triggerJob,   triggerJobWithVolatileTrigger,   unscheduleJob,   validateState
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.quartz.core.QuartzScheduler Detail:
 public  void addCalendar(SchedulingContext ctxt,
    String calName,
    Calendar calendar,
    boolean replace,
    boolean updateTriggers) throws SchedulerException 

    Add (register) the given Calendar to the Scheduler.

 public  void addGlobalJobListener(JobListener jobListener) 
 public  void addGlobalTriggerListener(TriggerListener triggerListener) 
 public  void addJob(SchedulingContext ctxt,
    JobDetail jobDetail,
    boolean replace) throws SchedulerException 

    Add the given Job to the Scheduler - with no associated Trigger. The Job will be 'dormant' until it is scheduled with a Trigger, or Scheduler.triggerJob() is called for it.

    The Job must by definition be 'durable', if it is not, SchedulerException will be thrown.

 public  void addJobListener(JobListener jobListener) 
 public  void addNoGCObject(Object obj) 
 public  void addSchedulerListener(SchedulerListener schedulerListener) 
 public  void addTriggerListener(TriggerListener triggerListener) 
 public boolean deleteCalendar(SchedulingContext ctxt,
    String calName) throws SchedulerException 

    Delete the identified Calendar from the Scheduler.

 public boolean deleteJob(SchedulingContext ctxt,
    String jobName,
    String groupName) throws SchedulerException 

    Delete the identified Job from the Scheduler - and any associated Triggers.

 public Calendar getCalendar(SchedulingContext ctxt,
    String calName) throws SchedulerException 

    Get the Calendar instance with the given name.

 public String[] getCalendarNames(SchedulingContext ctxt) throws SchedulerException 

    Get the names of all registered Calendar s.

 public List getCurrentlyExecutingJobs() 

    Return a list of JobExecutionContext objects that represent all currently executing Jobs in this Scheduler instance.

    This method is not cluster aware. That is, it will only return Jobs currently executing in this Scheduler instance, not across the entire cluster.

    Note that the list returned is an 'instantaneous' snap-shot, and that as soon as it's returned, the true list of executing jobs may be different.

 public JobListener getGlobalJobListener(String name) 
 public List getGlobalJobListeners() 
 public TriggerListener getGlobalTriggerListener(String name) 
 public List getGlobalTriggerListeners() 
 public JobDetail getJobDetail(SchedulingContext ctxt,
    String jobName,
    String jobGroup) throws SchedulerException 

    Get the JobDetail for the Job instance with the given name and group.

 public JobFactory getJobFactory() 
 public String[] getJobGroupNames(SchedulingContext ctxt) throws SchedulerException 
 public JobListener getJobListener(String name) 
 public Set getJobListenerNames() 
 public String[] getJobNames(SchedulingContext ctxt,
    String groupName) throws SchedulerException 
 public Class getJobStoreClass() 
 public Log getLog() 
 public Set getPausedTriggerGroups(SchedulingContext ctxt) throws SchedulerException 
 public SchedulerContext getSchedulerContext() throws SchedulerException 

    Returns the SchedulerContext of the Scheduler.

 public String getSchedulerInstanceId() 

    Returns the instance Id of the QuartzScheduler.

 public List getSchedulerListeners() 

    Get a List containing all of the SchedulerListener s registered with the Scheduler.

 public String getSchedulerName() 

    Returns the name of the QuartzScheduler.

 public SchedulerSignaler getSchedulerSignaler() 
 public ThreadGroup getSchedulerThreadGroup() 

    Returns the name of the QuartzScheduler.

 public Class getThreadPoolClass() 
 public int getThreadPoolSize() 
 public Trigger getTrigger(SchedulingContext ctxt,
    String triggerName,
    String triggerGroup) throws SchedulerException 

    Get the Trigger instance with the given name and group.

 public String[] getTriggerGroupNames(SchedulingContext ctxt) throws SchedulerException 
 public TriggerListener getTriggerListener(String name) 
 public Set getTriggerListenerNames() 
 public String[] getTriggerNames(SchedulingContext ctxt,
    String groupName) throws SchedulerException 
 public int getTriggerState(SchedulingContext ctxt,
    String triggerName,
    String triggerGroup) throws SchedulerException 

    Get the current state of the identified Trigger .

 public Trigger[] getTriggersOfJob(SchedulingContext ctxt,
    String jobName,
    String groupName) throws SchedulerException 
 public String getVersion() 
 public static String getVersionIteration() 
 public static String getVersionMajor() 
 public static String getVersionMinor() 
 public boolean interrupt(SchedulingContext ctxt,
    String jobName,
    String groupName) throws UnableToInterruptJobException 
    Interrupt all instances of the identified InterruptableJob executing in this Scheduler instance.

    This method is not cluster aware. That is, it will only interrupt instances of the identified InterruptableJob currently executing in this Scheduler instance, not across the entire cluster.

 public boolean isInStandbyMode() 

    Reports whether the Scheduler is paused.

 public boolean isShutdown() 

    Reports whether the Scheduler has been shutdown.

 public boolean isSignalOnSchedulingChange() 
 public  void notifyJobListenersToBeExecuted(JobExecutionContext jec) throws SchedulerException 
 public  void notifyJobListenersWasExecuted(JobExecutionContext jec,
    JobExecutionException je) throws SchedulerException 
 public  void notifyJobListenersWasVetoed(JobExecutionContext jec) throws SchedulerException 
 protected  void notifyJobStoreJobComplete(SchedulingContext ctxt,
    Trigger trigger,
    JobDetail detail,
    int instCode) throws JobPersistenceException 
 protected  void notifyJobStoreJobVetoed(SchedulingContext ctxt,
    Trigger trigger,
    JobDetail detail,
    int instCode) throws JobPersistenceException 
 public  void notifySchedulerListenersError(String msg,
    SchedulerException se) 
 public  void notifySchedulerListenersFinalized(Trigger trigger) 
 public  void notifySchedulerListenersPausedJob(String name,
    String group) 
 public  void notifySchedulerListenersPausedTrigger(String name,
    String group) 
 public  void notifySchedulerListenersResumedJob(String name,
    String group) 
 public  void notifySchedulerListenersResumedTrigger(String name,
    String group) 
 public  void notifySchedulerListenersSchduled(Trigger trigger) 
 public  void notifySchedulerListenersShutdown() 
 public  void notifySchedulerListenersUnschduled(String triggerName,
    String triggerGroup) 
 protected  void notifySchedulerThread() 
 public  void notifyTriggerListenersComplete(JobExecutionContext jec,
    int instCode) throws SchedulerException 
 public boolean notifyTriggerListenersFired(JobExecutionContext jec) throws SchedulerException 
 public  void notifyTriggerListenersMisfired(Trigger trigger) throws SchedulerException 
 public int numJobsExecuted() 
 public  void pauseAll(SchedulingContext ctxt) throws SchedulerException 

    Pause all triggers - equivalent of calling pauseTriggerGroup(group) on every group.

    When resumeAll() is called (to un-pause), trigger misfire instructions WILL be applied.

 public  void pauseJob(SchedulingContext ctxt,
    String jobName,
    String groupName) throws SchedulerException 
 public  void pauseJobGroup(SchedulingContext ctxt,
    String groupName) throws SchedulerException 
 public  void pauseTrigger(SchedulingContext ctxt,
    String triggerName,
    String groupName) throws SchedulerException 

    Pause the Trigger with the given name.

 public  void pauseTriggerGroup(SchedulingContext ctxt,
    String groupName) throws SchedulerException 

    Pause all of the Trigger s in the given group.

 public boolean removeGlobalJobListener(JobListener jobListener) 
Deprecated! Use - #removeGlobalJobListener(String)

 public boolean removeGlobalJobListener(String name) 

    Remove the identifed JobListener from the Scheduler's list of global listeners.

 public boolean removeGlobalTriggerListener(TriggerListener triggerListener) 
Deprecated! Use - #removeGlobalTriggerListener(String)

 public boolean removeGlobalTriggerListener(String name) 

    Remove the identifed TriggerListener from the Scheduler's list of global listeners.

 public boolean removeJobListener(String name) 
 public boolean removeNoGCObject(Object obj) 
 public boolean removeSchedulerListener(SchedulerListener schedulerListener) 
 public boolean removeTriggerListener(String name) 
 public Date rescheduleJob(SchedulingContext ctxt,
    String triggerName,
    String groupName,
    Trigger newTrigger) throws SchedulerException 

    Remove (delete) the org.quartz.Trigger with the given name, and store the new given one - which must be associated with the same job.

 public  void resumeAll(SchedulingContext ctxt) throws SchedulerException 

    Resume (un-pause) all triggers - equivalent of calling resumeTriggerGroup(group) on every group.

    If any Trigger missed one or more fire-times, then the Trigger's misfire instruction will be applied.

 public  void resumeJob(SchedulingContext ctxt,
    String jobName,
    String groupName) throws SchedulerException 

    Resume (un-pause) the org.quartz.JobDetail with the given name.

    If any of the Job'sTrigger s missed one or more fire-times, then the Trigger's misfire instruction will be applied.

 public  void resumeJobGroup(SchedulingContext ctxt,
    String groupName) throws SchedulerException 

    Resume (un-pause) all of the org.quartz.JobDetail s in the given group.

    If any of the Job s had Trigger s that missed one or more fire-times, then the Trigger's misfire instruction will be applied.

 public  void resumeTrigger(SchedulingContext ctxt,
    String triggerName,
    String groupName) throws SchedulerException 

    Resume (un-pause) the Trigger with the given name.

    If the Trigger missed one or more fire-times, then the Trigger's misfire instruction will be applied.

 public  void resumeTriggerGroup(SchedulingContext ctxt,
    String groupName) throws SchedulerException 

    Resume (un-pause) all of the Trigger s in the given group.

    If any Trigger missed one or more fire-times, then the Trigger's misfire instruction will be applied.

 public Date runningSince() 
 public Date scheduleJob(SchedulingContext ctxt,
    Trigger trigger) throws SchedulerException 

    Schedule the given org.quartz.Trigger with the Job identified by the Trigger's settings.

 public Date scheduleJob(SchedulingContext ctxt,
    JobDetail jobDetail,
    Trigger trigger) throws SchedulerException 

    Add the org.quartz.Job identified by the given org.quartz.JobDetail to the Scheduler, and associate the given org.quartz.Trigger with it.

    If the given Trigger does not reference any Job, then it will be set to reference the Job passed with it into this method.

 public  void setJobFactory(JobFactory factory) throws SchedulerException 
 public  void setSignalOnSchedulingChange(boolean signalOnSchedulingChange) 
 public  void shutdown() 

    Halts the QuartzScheduler's firing of org.quartz.Trigger s, and cleans up all resources associated with the QuartzScheduler. Equivalent to shutdown(false).

    The scheduler cannot be re-started.

 public  void shutdown(boolean waitForJobsToComplete) 

    Halts the QuartzScheduler's firing of org.quartz.Trigger s, and cleans up all resources associated with the QuartzScheduler.

    The scheduler cannot be re-started.

 public  void standby() 

    Temporarily halts the QuartzScheduler's firing of org.quartz.Trigger s.

    The scheduler is not destroyed, and can be re-started at any time.

 public  void start() throws SchedulerException 
 public boolean supportsPersistence() 
 public  void triggerJob(SchedulingContext ctxt,
    String jobName,
    String groupName,
    JobDataMap data) throws SchedulerException 

    Trigger the identified org.quartz.Job (execute it now) - with a non-volatile trigger.

 public  void triggerJobWithVolatileTrigger(SchedulingContext ctxt,
    String jobName,
    String groupName,
    JobDataMap data) throws SchedulerException 

    Trigger the identified org.quartz.Job (execute it now) - with a volatile trigger.

 public boolean unscheduleJob(SchedulingContext ctxt,
    String triggerName,
    String groupName) throws SchedulerException 
 public  void validateState() throws SchedulerException