Keel 2.1RC2

org.keel.services.schedule.quartz
Class QuartzScheduler

java.lang.Object
  extended byorg.keel.services.schedule.quartz.QuartzScheduler
All Implemented Interfaces:
Configurable, LogEnabled, Scheduler, Startable

public class QuartzScheduler
extends java.lang.Object
implements Scheduler, LogEnabled, Startable, Configurable

This class is the Quartz-specific implementation of the Scheduler service.

Version:
$Revision: 1.6 $ $Date: 2003/07/19 14:42:33 $
Author:
Michael Nash, Shash Chatterjee, Santanu Dutt Created on Sep 13, 2002

Field Summary
private  java.lang.String group
           
private  java.lang.String jobNamePrefix
           
private  Logger log
           
private  SchedulerFactory myFactory
           
private  org.quartz.Scheduler myScheduler
           
private static int nextJobNumber
           
private  java.lang.String triggerNamePrefix
           
 
Fields inherited from interface org.keel.services.schedule.Scheduler
ROLE
 
Constructor Summary
QuartzScheduler()
          Constructor for QuartzScheduler.
 
Method Summary
 void configure(Configuration configuration)
          Pass the Configuration to the Configurable class.
 void enableLogging(Logger newLogger)
          Avalon life-cycle interface to set a logger for log messages
 ScheduledRequest getRequest(int id)
           
 java.util.Set getRequests()
          Return the set of request ID's currently being handled by this scheduler
 void remove(ScheduledRequest s)
          Removed the specified request from the schedule, if it was scheduled.
 void schedule(ScheduledRequest s)
          Schedule a new request.
 void scheduleCronJob(QuartzScheduledRequest s)
           
 void scheduleSimpleJob(QuartzScheduledRequest s)
           
 void start()
          Start the scheduler.
 void stop()
          Stop the scheduler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private Logger log

nextJobNumber

private static int nextJobNumber

myFactory

private SchedulerFactory myFactory

myScheduler

private org.quartz.Scheduler myScheduler

jobNamePrefix

private java.lang.String jobNamePrefix

triggerNamePrefix

private java.lang.String triggerNamePrefix

group

private java.lang.String group
Constructor Detail

QuartzScheduler

public QuartzScheduler()
Constructor for QuartzScheduler.

Method Detail

enableLogging

public void enableLogging(Logger newLogger)
Avalon life-cycle interface to set a logger for log messages

Specified by:
enableLogging in interface LogEnabled
Parameters:
newLogger - the logger. Must not be null.
See Also:
LogEnabled.enableLogging(Logger)

start

public void start()
           throws NestedException
Description copied from interface: Scheduler
Start the scheduler. Ignored if the scheduler is already running. If there are tasks scheduled for times that have already passed, they are started now.

Specified by:
start in interface Scheduler
Throws:
NestedException
See Also:
Scheduler.start()

stop

public void stop()
          throws NestedException
Description copied from interface: Scheduler
Stop the scheduler. Depending on the implementation of the scheduler, this may or may not result in any currently scheduled tasks being stored for later operation.

Specified by:
stop in interface Scheduler
Throws:
NestedException
See Also:
Scheduler.stop()

schedule

public void schedule(ScheduledRequest s)
              throws NestedException
Description copied from interface: Scheduler
Schedule a new request. If the given request was already scheduled (as determined by it's request id number) then re-schedule it with the new parameters given.

Specified by:
schedule in interface Scheduler
Throws:
NestedException
See Also:
Scheduler.schedule(ScheduledRequest)

scheduleCronJob

public void scheduleCronJob(QuartzScheduledRequest s)
                     throws NestedException
Throws:
NestedException
See Also:
Scheduler.schedule(ScheduledRequest)

scheduleSimpleJob

public void scheduleSimpleJob(QuartzScheduledRequest s)
                       throws NestedException
Throws:
NestedException
See Also:
org.keel.services.schedule.Scheduler#schedule(ScheduledRequest

remove

public void remove(ScheduledRequest s)
            throws NestedException
Description copied from interface: Scheduler
Removed the specified request from the schedule, if it was scheduled.

Specified by:
remove in interface Scheduler
Throws:
NestedException
See Also:
Scheduler.remove(ScheduledRequest)

getRequests

public java.util.Set getRequests()
                          throws NestedException
Description copied from interface: Scheduler
Return the set of request ID's currently being handled by this scheduler

Specified by:
getRequests in interface Scheduler
Returns:
A set of Integer values, each representing a scheduled request being handled by this scheduler.
Throws:
NestedException
See Also:
Scheduler.getRequests()

getRequest

public ScheduledRequest getRequest(int id)
                            throws NestedException
Specified by:
getRequest in interface Scheduler
Throws:
NestedException
See Also:
Scheduler.getRequest(int)

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Description copied from interface: Configurable
Pass the Configuration to the Configurable class.

Specified by:
configure in interface Configurable
Parameters:
configuration - the class configurations. Must not be null.
Throws:
ConfigurationException - if an error occurs
See Also:
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.