public class QuartzSchedulerService extends TurbineBaseService implements ScheduleService
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
enabled
Current status of the scheduler
|
protected static org.apache.commons.logging.Log |
log
Logging
|
configuration, name, serviceBrokerinitableBroker, isInitializedINTIALLY_ACTIVE, LOGGER_NAME, SERVICE_NAME| Constructor and Description |
|---|
QuartzSchedulerService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addJob(JobEntry je)
Add a new job to the queue.
|
JobEntryQuartz |
buildJobEntry(org.quartz.Trigger trigger,
org.quartz.JobDetail jd)
Builds a
JobEntryQuartz from Quartz trigger/job. |
JobEntry |
getJob(int oid)
Get a specific Job from Storage.
|
org.quartz.Scheduler |
getScheduler()
Exposing the Quartz scheduler to handle jobs/triggers in more detail.
|
void |
init()
Initializes the SchedulerService.
|
boolean |
isEnabled()
Determines if the scheduler service is currently enabled.
|
List<? extends JobEntry> |
listJobs()
List jobs in the queue.
|
JobEntry |
newJob(int sec,
int min,
int hour,
int wd,
int day_mo,
String task)
Factory method for a new Job
Schedule a job to run on a certain point of time.
|
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.
|
init, initgetConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBrokergetInit, getInitableBroker, setInit, setInitableBrokerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConfiguration, getName, getProperties, setName, setServiceBrokergetInit, init, setInitableBrokerprotected static org.apache.commons.logging.Log log
protected boolean enabled
public QuartzSchedulerService()
public void init() throws InitializationException
scheduler from the Fulcrum QuartzScheduler service.init in interface Initableinit in class TurbineBaseServiceInitializationException - Something went wrong in the init
stagepublic void shutdown()
shutdown in interface Initableshutdown in class TurbineBaseServicepublic JobEntry newJob(int sec, int min, int hour, int wd, int day_mo, String task) throws TurbineException
ScheduleServicenewJob in interface ScheduleServicesec - Value for entry "seconds".min - Value for entry "minutes".hour - Value for entry "hours".wd - Value for entry "week days".day_mo - Value for entry "month days".task - Task to execute.TurbineException - could not create jobScheduleService.newJob(int, int, int, int, int, java.lang.String)public JobEntry getJob(int oid) throws TurbineException
getJob in interface ScheduleServiceoid - The int id for the job.TurbineException - job could not be retrieved.public void addJob(JobEntry je) throws TurbineException
addJob in interface ScheduleServiceje - A JobEntry with the job to add.TurbineException - job could not be addedpublic void removeJob(JobEntry je) throws TurbineException
removeJob in interface ScheduleServiceje - A JobEntry with the job to remove.TurbineException - job could not be removedpublic void updateJob(JobEntry je) throws TurbineException
updateJob in interface ScheduleServiceje - A JobEntry with the job to modifyTurbineException - job could not be updatedpublic List<? extends JobEntry> listJobs()
listJobs in interface ScheduleServiceprotected void setEnabled(boolean enabled)
enabled - public boolean isEnabled()
isEnabled in interface ScheduleServicepublic void startScheduler()
startScheduler in interface ScheduleServicepublic void stopScheduler()
stopScheduler in interface ScheduleServicepublic void restart()
public org.quartz.Scheduler getScheduler()
Scheduler of this service.public JobEntryQuartz buildJobEntry(org.quartz.Trigger trigger, org.quartz.JobDetail jd)
JobEntryQuartz from Quartz trigger/job.
The developer should be aware to set identity/context properly, i.e. to
, if adding triggers/jobs.trigger - a Quartz Trigger.jd - a Quartz JobDetail (built from a Job with JobBuilder).Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.