|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavax.management.NotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.backsource.jmx.ServiceMBeanSupport
org.backsource.qcron.CronEntry
A "cron" row consisting of time to run command and command to run.
CronEntry is a wrapper above Quartz JobDetail and Trigger. Its purpose is
twofold: to make it somewhat simpler to set up a cron jobb and to agument
quartz with ways to call live objects to get the work done. If one likes
to use the Quartz way of doing thing one may use the constructor that takes
a JobDetail and a Trigger. See org.backsource.qcron for setup examples.
| Field Summary | |
protected java.lang.String |
cronExp
|
protected java.lang.String |
group
|
protected org.quartz.JobDetail |
jobDetail
|
protected javax.management.ObjectName |
jobObjectName
|
protected java.lang.String |
name
|
static javax.management.ObjectName |
OBJECT_NAME
|
protected javax.management.ObjectName |
objectName
|
protected boolean |
recover
|
protected javax.management.MBeanServer |
server
|
protected org.quartz.CronTrigger |
trigger
|
protected boolean |
volatility
|
| Fields inherited from class org.jboss.system.ServiceMBeanSupport |
log, serviceName |
| Fields inherited from interface org.jboss.system.ServiceMBean |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, STARTED, STARTING, states, STOPPED, STOPPING |
| Constructor Summary | |
CronEntry()
|
|
CronEntry(org.quartz.CronTrigger trigger,
org.quartz.JobDetail detail)
Create a CronEntry by directly using the Quertz way of doing things. |
|
CronEntry(java.lang.String cronExpr,
javax.management.ObjectName delegate)
Creata cron entry wich will be triggered accordning to cron specification in cronExpr and wich will delegate callbacks to the MBean name, which must implement the Job interface (or have an equal method). |
|
| Method Summary | |
boolean |
equals(java.lang.Object otherO)
Compare if all fields except the trigger and job is equal. |
java.lang.String |
getCronExp()
Get the cron expression to use for the trigger. |
java.lang.String |
getEntryGroup()
|
java.lang.String |
getEntryName()
Get the name of the entry (trigger/jobdetail). |
org.quartz.JobDetail |
getJobDetail()
Get the underlying JobDetail. |
javax.management.ObjectName |
getJobObjectName()
Get the object name of an MBean which should be called when trigger triggers. |
protected javax.management.ObjectName |
getObjectName(javax.management.MBeanServer server,
javax.management.ObjectName name)
|
boolean |
getRequestsRecovery()
Should sceduler try to recover; for example if server was down when jib shoudl have triggered. |
org.quartz.CronTrigger |
getTrigger()
Get the underlying CronTrigger. |
boolean |
getVolatility()
Will the entry be saved to persistent store. |
CronEntry |
instance()
Get the instance of this MBean |
void |
setCronExp(java.lang.String cronExp)
Set the cron expression to use for the trigger. |
void |
setEntryGroup(java.lang.String group)
Set the group name of the entry (trigger/jobdetail). |
void |
setEntryName(java.lang.String name)
Set the name of the entry (trigger/jobdetail). |
void |
setJobObjectName(javax.management.ObjectName jobName)
Set the object name of an MBean which should be called when trigger triggers. |
void |
setRequestsRecovery(boolean recover)
Scheduler should try to recover job if it should have triggered while the server was down, default to false. |
void |
setVolatility(boolean volatility)
Save job to persistent state if false, default is false, saving to persisten state! |
protected void |
startService()
|
| Methods inherited from class org.jboss.system.ServiceMBeanSupport |
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getServer, getServiceName, getState, getStateString, postDeregister, postRegister, preDeregister, preRegister, start, stop, stopService |
| Methods inherited from class javax.management.NotificationBroadcasterSupport |
addNotificationListener, getNotificationInfo, removeNotificationListener, sendNotification |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jboss.system.ServiceMBean |
getName, getState, getStateString |
| Methods inherited from interface org.jboss.system.Service |
create, destroy, start, stop |
| Field Detail |
public static final javax.management.ObjectName OBJECT_NAME
protected javax.management.ObjectName objectName
protected javax.management.MBeanServer server
protected org.quartz.JobDetail jobDetail
protected org.quartz.CronTrigger trigger
protected java.lang.String name
protected java.lang.String group
protected boolean recover
protected boolean volatility
protected java.lang.String cronExp
protected javax.management.ObjectName jobObjectName
| Constructor Detail |
public CronEntry()
public CronEntry(org.quartz.CronTrigger trigger,
org.quartz.JobDetail detail)
public CronEntry(java.lang.String cronExpr,
javax.management.ObjectName delegate)
throws CronException
The gruop and name of the Trigger/Job will be taken from the delegate ObjectName. if this delegate will be used by more than one CronEntry the creator must set setEntryGroup and setEntryName manually after creation.
This method will create a cron entry that will be run at times the cronExp specifyes and invokes the job found my invoking object name. It will be persisted, non-durable and non recovarable. The underlying trigger and job will have the same group and name.
| Method Detail |
protected javax.management.ObjectName getObjectName(javax.management.MBeanServer server,
javax.management.ObjectName name)
throws javax.management.MalformedObjectNameException
javax.management.MalformedObjectNameException
public void setCronExp(java.lang.String cronExp)
throws CronException
setCronExp in interface org.backsource.qcron.CronEntryMBeanCronExceptionCronTriggerpublic java.lang.String getCronExp()
getCronExp in interface org.backsource.qcron.CronEntryMBeanpublic void setJobObjectName(javax.management.ObjectName jobName)
setJobObjectName in interface org.backsource.qcron.CronEntryMBeanpublic javax.management.ObjectName getJobObjectName()
getJobObjectName in interface org.backsource.qcron.CronEntryMBeanpublic void setRequestsRecovery(boolean recover)
if set to true: volatile must be false.
setRequestsRecovery in interface org.backsource.qcron.CronEntryMBeanpublic boolean getRequestsRecovery()
getRequestsRecovery in interface org.backsource.qcron.CronEntryMBeanpublic void setVolatility(boolean volatility)
setVolatility in interface org.backsource.qcron.CronEntryMBeanpublic boolean getVolatility()
getVolatility in interface org.backsource.qcron.CronEntryMBeanpublic java.lang.String getEntryGroup()
getEntryGroup in interface org.backsource.qcron.CronEntryMBeanpublic void setEntryGroup(java.lang.String group)
setEntryGroup in interface org.backsource.qcron.CronEntryMBeanpublic java.lang.String getEntryName()
getEntryName in interface org.backsource.qcron.CronEntryMBeanpublic void setEntryName(java.lang.String name)
setEntryName in interface org.backsource.qcron.CronEntryMBeanpublic org.quartz.JobDetail getJobDetail()
getJobDetail in interface org.backsource.qcron.CronEntryMBeanpublic org.quartz.CronTrigger getTrigger()
getTrigger in interface org.backsource.qcron.CronEntryMBeanpublic boolean equals(java.lang.Object otherO)
equals in interface org.backsource.qcron.CronEntryMBeanpublic CronEntry instance()
instance in interface org.backsource.qcron.CronEntryMBean
protected void startService()
throws java.lang.Exception
java.lang.Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||