|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.turbine.services.BaseInitable
org.apache.turbine.services.BaseService
org.apache.turbine.services.TurbineBaseService
org.apache.turbine.services.schedule.TurbineSchedulerService
Service for a cron like scheduler.
Nested Class Summary | |
protected class |
TurbineSchedulerService.MainLoop
Inner class. |
Field Summary | |
protected TurbineSchedulerService.MainLoop |
mainLoop
The main loop for starting jobs. |
protected JobQueue |
scheduleQueue
The queue |
protected java.lang.Thread |
thread
The thread used to process commands. |
Fields inherited from class org.apache.turbine.services.BaseService |
configuration, name, serviceBroker |
Fields inherited from class org.apache.turbine.services.BaseInitable |
initableBroker, isInitialized |
Fields inherited from interface org.apache.turbine.services.schedule.ScheduleService |
INTIALLY_ACTIVE, LOGGER_NAME, SERVICE_NAME |
Constructor Summary | |
TurbineSchedulerService()
Creates a new instance. |
Method Summary | |
void |
addJob(JobEntry je)
Add a new job to the queue. |
JobEntry |
getJob(int oid)
Get a specific Job from Storage. |
java.lang.Thread |
getThread()
Return the thread being used to process commands, or null if there is no such thread. |
void |
init()
Initializes the SchedulerService. |
void |
init(javax.servlet.ServletConfig config)
Deprecated. use init() instead. |
boolean |
isEnabled()
Determines if the scheduler service is currently enabled. |
java.util.List |
listJobs()
List jobs in the queue. |
void |
removeJob(JobEntry je)
Remove a job from the queue. |
void |
restart()
Start (or restart) a thread to process commands, or wake up an existing thread if one is already running. |
protected void |
setEnabled(boolean enabled)
Sets the enabled status of the scheduler |
void |
shutdown()
Shutdowns the service. |
void |
startScheduler()
Starts or restarts the scheduler if not already running. |
void |
stopScheduler()
Stops the scheduler if it is currently running. |
void |
updateJob(JobEntry je)
Add or update a job. |
Methods inherited from class org.apache.turbine.services.TurbineBaseService |
init, init |
Methods inherited from class org.apache.turbine.services.BaseService |
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker |
Methods inherited from class org.apache.turbine.services.BaseInitable |
getInit, getInitableBroker, setInit, setInitableBroker |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.turbine.services.Service |
getConfiguration, getName, getProperties, setName, setServiceBroker |
Methods inherited from interface org.apache.turbine.services.Initable |
getInit, init, setInitableBroker |
Field Detail |
protected JobQueue scheduleQueue
protected TurbineSchedulerService.MainLoop mainLoop
protected java.lang.Thread thread
Constructor Detail |
public TurbineSchedulerService()
Method Detail |
public void init() throws InitializationException
init
in interface Initable
init
in class TurbineBaseService
InitializationException
- Something went wrong in the init
stagepublic void init(javax.servlet.ServletConfig config) throws InitializationException
init
in class TurbineBaseService
config
- A ServletConfig.
InitializationException
- if initialization of this
class was not successful.public void shutdown()
shutdown
in interface Initable
shutdown
in class TurbineBaseService
public JobEntry getJob(int oid) throws TurbineException
getJob
in interface ScheduleService
oid
- The int id for the job.
TurbineException
- job could not be retreived.public void addJob(JobEntry je) throws TurbineException
addJob
in interface ScheduleService
je
- A JobEntry with the job to add.
TurbineException
- job could not be addedpublic void removeJob(JobEntry je) throws TurbineException
removeJob
in interface ScheduleService
je
- A JobEntry with the job to remove.
TurbineException
- job could not be removedpublic void updateJob(JobEntry je) throws TurbineException
updateJob
in interface ScheduleService
je
- A JobEntry with the job to modify
TurbineException
- job could not be updatedpublic java.util.List listJobs()
listJobs
in interface ScheduleService
protected void setEnabled(boolean enabled)
enabled
- public boolean isEnabled()
isEnabled
in interface ScheduleService
public void startScheduler()
startScheduler
in interface ScheduleService
public void stopScheduler()
stopScheduler
in interface ScheduleService
public java.lang.Thread getThread()
public void restart()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |