|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.components.cron.QuartzJobScheduler
public class QuartzJobScheduler
This component can either schedule jobs or directly execute one.
Field Summary |
---|
Fields inherited from interface org.apache.cocoon.components.cron.JobScheduler |
---|
ROLE |
Constructor Summary | |
---|---|
QuartzJobScheduler()
|
Method Summary | |
---|---|
void |
addJob(String name,
Object job,
String cronSpec,
boolean canRunConcurrently)
Schedule a time based job. |
void |
addJob(String name,
Object job,
String cronSpec,
boolean canRunConcurrently,
Parameters params,
Map objects)
Schedule a job. |
void |
addJob(String name,
String jobrole,
String cronSpec,
boolean canRunConcurrently)
Schedule a time based job. |
void |
addJob(String name,
String jobrole,
String cronSpec,
boolean canRunConcurrently,
Parameters params,
Map objects)
Schedule a time based job. |
void |
addPeriodicJob(String name,
Object job,
long period,
boolean canRunConcurrently,
Parameters params,
Map objects)
Schedule a periodic job. |
void |
addPeriodicJob(String name,
String jobrole,
long period,
boolean canRunConcurrently,
Parameters params,
Map objects)
Schedule a period job. |
void |
configure(Configuration config)
|
void |
contextualize(Context context)
|
protected org.quartz.JobDetail |
createJobDetail(String name,
org.quartz.JobDataMap jobDataMap)
|
protected org.quartz.Job |
createJobExecutor()
|
void |
dispose()
|
boolean |
fireJob(Object job)
Fire a CronJob once immediately |
boolean |
fireJob(Object job,
Parameters params,
Map objects)
Fire a job once immediately |
boolean |
fireJob(String jobrole)
Fire a job once immediately |
boolean |
fireJob(String jobrole,
Parameters params,
Map objects)
Fire a job once immediately |
void |
fireJobAt(Date date,
String name,
Object job)
Fire a job once at a specific date Note that if a job with the same name has already beed added it is overwritten. |
void |
fireJobAt(Date date,
String name,
Object job,
Parameters params,
Map objects)
Fire a job once at a specific date Note that if a job with the same name has already beed added it is overwritten. |
void |
fireJobAt(Date date,
String name,
String jobrole)
Fire a job once at a specific date Note that if a job with the same name has already beed added it is overwritten. |
void |
fireJobAt(Date date,
String name,
String jobrole,
Parameters params,
Map objects)
Fire a job once at a specific date Note that if a job with the same name has already beed added it is overwritten. |
String[] |
getJobNames()
Get the names of all scheduled jobs. |
JobSchedulerEntry |
getJobSchedulerEntry(String jobname)
Get the JobSchedulerEntry for a scheduled job |
protected org.quartz.JobDataMap |
initDataMap(org.quartz.JobDataMap jobDataMap,
String jobName,
boolean concurent,
Parameters params,
Map objects)
|
void |
initialize()
|
void |
removeJob(String name)
Remove a scheduled job by name. |
void |
service(ServiceManager manager)
|
void |
start()
|
void |
stop()
|
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QuartzJobScheduler()
Method Detail |
---|
public String[] getJobNames()
JobScheduler
getJobNames
in interface JobScheduler
public JobSchedulerEntry getJobSchedulerEntry(String jobname)
JobScheduler
getJobSchedulerEntry
in interface JobScheduler
public void addJob(String name, Object job, String cronSpec, boolean canRunConcurrently, Parameters params, Map objects) throws CascadingException
JobScheduler
addJob
in interface JobScheduler
name
- the name of the jobjob
- The job object itself. It must implement either CronJob, Runnable or might also be an implementation
specific class (i.e. org.quartz.Job)cronSpec
- the time specification using a scheduling expressioncanRunConcurrently
- whether this job can run even previous scheduled runs are still runningparams
- Additional Parameters to setup CronJobobjects
- A Map with additional object to setup CronJob
CascadingException
public void addJob(String name, String jobrole, String cronSpec, boolean canRunConcurrently, Parameters params, Map objects) throws CascadingException
JobScheduler
addJob
in interface JobScheduler
name
- the name of the jobjobrole
- The Avalon components role name of the job itselfcronSpec
- the time specification using a scheduling expressioncanRunConcurrently
- whether this job can run even previous scheduled runs are still runningparams
- Additional Parameters to setup CronJobobjects
- A Map with additional object to setup CronJob
CascadingException
public void addJob(String name, Object job, String cronSpec, boolean canRunConcurrently) throws CascadingException
JobScheduler
addJob
in interface JobScheduler
name
- the name of the jobjob
- The job object itself. It must implement either CronJob, Runnable or might also be an implementation
specific class (i.e. org.quartz.Job)cronSpec
- the time specification using a scheduling expressioncanRunConcurrently
- whether this job can run even previous scheduled runs are still running
CascadingException
public void addJob(String name, String jobrole, String cronSpec, boolean canRunConcurrently) throws CascadingException
JobScheduler
addJob
in interface JobScheduler
name
- the name of the jobjobrole
- The Avalon components role name of the job itselfcronSpec
- the time specification using a scheduling expressioncanRunConcurrently
- whether this job can run even previous scheduled runs are still running
CascadingException
public void addPeriodicJob(String name, String jobrole, long period, boolean canRunConcurrently, Parameters params, Map objects) throws CascadingException
addPeriodicJob
in interface JobScheduler
name
- the name of the jobjobrole
- The Avalon components role name of the job itselfperiod
- Every period seconds this job is startedcanRunConcurrently
- whether this job can run even previous scheduled runs are still runningparams
- additional Parameters to be passed to the jobobjects
- additional objects to be passed to the job
CascadingException
- in case of failurespublic void addPeriodicJob(String name, Object job, long period, boolean canRunConcurrently, Parameters params, Map objects) throws CascadingException
addPeriodicJob
in interface JobScheduler
name
- the name of the jobjob
- The job object itself. It must implement either CronJob, Runnable or might also be an implementation
specific class (i.e. org.quartz.Job)period
- Every period seconds this job is startedcanRunConcurrently
- whether this job can run even previous scheduled runs are still runningparams
- Additional Parameters to setup CronJobobjects
- A Map with additional object to setup CronJob
CascadingException
public void configure(Configuration config) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public void dispose()
dispose
in interface Disposable
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void initialize() throws Exception
initialize
in interface Initializable
Exception
public boolean fireJob(Object job)
JobScheduler
fireJob
in interface JobScheduler
job
- The job object itself. It must implement either CronJob, Runnable or might also be an implementation
specific class (i.e. org.quartz.Job)
public boolean fireJob(String jobrole)
JobScheduler
fireJob
in interface JobScheduler
jobrole
- The Avalon components role name of the job itself
public boolean fireJob(Object job, Parameters params, Map objects) throws CascadingException
JobScheduler
fireJob
in interface JobScheduler
job
- The job object itself. It must implement either CronJob, Runnable or might also be an implementation
specific class (i.e. org.quartz.Job)params
- Additional Parameters to setup CronJobobjects
- A Map with additional object to setup CronJob
CascadingException
public boolean fireJob(String jobrole, Parameters params, Map objects) throws CascadingException
JobScheduler
fireJob
in interface JobScheduler
jobrole
- The Avalon components role name of the job itselfparams
- Additional Parameters to setup CronJobobjects
- A Map with additional object to setup CronJob
CascadingException
public void fireJobAt(Date date, String name, Object job) throws CascadingException
JobScheduler
fireJobAt
in interface JobScheduler
date
- The date this job should be scheduledname
- the name of the jobjob
- The job object itself. It must implement either CronJob, Runnable or might also be an implementation
specific class (i.e. org.quartz.Job)
CascadingException
public void fireJobAt(Date date, String name, String jobrole) throws CascadingException
JobScheduler
fireJobAt
in interface JobScheduler
date
- The date this job should be scheduledname
- the name of the jobjobrole
- The Avalon components role name of the job itself
CascadingException
public void fireJobAt(Date date, String name, Object job, Parameters params, Map objects) throws CascadingException
JobScheduler
fireJobAt
in interface JobScheduler
date
- The date this job should be scheduledname
- the name of the jobjob
- The job object itself. It must implement either CronJob, Runnable or might also be an implementation
specific class (i.e. org.quartz.Job)params
- Additional Parameters to setup CronJobobjects
- A Map with additional object to setup CronJob
CascadingException
public void fireJobAt(Date date, String name, String jobrole, Parameters params, Map objects) throws CascadingException
JobScheduler
fireJobAt
in interface JobScheduler
date
- The date this job should be scheduledname
- the name of the jobjobrole
- The Avalon components role name of the job itselfparams
- Additional Parameters to setup CronJobobjects
- A Map with additional object to setup CronJob
CascadingException
public void removeJob(String name) throws NoSuchElementException
JobScheduler
removeJob
in interface JobScheduler
name
- the name of the job
NoSuchElementException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void start() throws Exception
start
in interface Startable
Exception
public void stop() throws Exception
stop
in interface Startable
Exception
protected org.quartz.JobDataMap initDataMap(org.quartz.JobDataMap jobDataMap, String jobName, boolean concurent, Parameters params, Map objects)
protected org.quartz.JobDetail createJobDetail(String name, org.quartz.JobDataMap jobDataMap)
protected org.quartz.Job createJobExecutor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |