|
|||||||||||
| 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.CronEditor
An editor to handle adding/removal of CronEntrys to CronManager.
The editor has two primary purposes:
The editors normal usage is to use it as a cron spool holder; i.e one sets up a particular CronEditor for a domain and it will manage all CronEntries by giing them to the editor through setCronEntries, wich takes a list of ObjectNames each pointing to a CronEntry. The editor will manage its domain; and ad and remove jobs from quertz depending on the state of the entries list when started. This means that an editor used in this way will remove persisten jobs fron quertz if they are not part a the list any longer; and it will add jobs that has become part of the list but has not yet been added to Quartz.
It is also possible to use the editor to create a single group/job. The name of the group must then be unique.
The editor will allways create a Job/Trigger pair,with the same group/name. The group will be taken from the domain of this MBean if available and the name will be from the rest of the ObjectName. if used programatically the group and name parts must be set manually.
See org.backsource.qcron for an example of how to configure it.
For some more info on the attributes that is used to create an edior with a single entry,see CronEntry
| Field Summary | |
protected java.util.List |
cronEntries
The list of cronEntries this editor manages; is a list of ObjectNames. |
protected java.lang.String |
cronExp
|
protected CronManager |
cronManager
The CronManager to use when adding/removing jobs. |
protected javax.management.ObjectName |
cronManagerName
The CronManager to use when adding/removing jobs. |
protected CronEntry |
entry
|
protected javax.management.ObjectName |
jobObjectName
|
static javax.management.ObjectName |
OBJECT_NAME
|
protected javax.management.ObjectName |
objectName
|
protected boolean |
recover
|
protected javax.management.MBeanServer |
server
|
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 | |
CronEditor()
|
|
| Method Summary | |
void |
edit()
Edit the current list/or single CronEntry(ies), if list is non null any single config is discarded. |
java.util.List |
getCronEntries()
|
CronEntry |
getCronEntry()
Get the single cron entry this editor holds, it will get group and name from this edtitrs ObjectName, will be null if it has cronEntries or if jobObjectName is non null. |
CronEntry |
getCronEntry(javax.management.ObjectName name)
Get cron entry from ObjectName. |
java.lang.String |
getCronExp()
|
javax.management.ObjectName |
getCronManagerName()
|
javax.management.ObjectName |
getJobObjectName()
|
protected javax.management.ObjectName |
getObjectName(javax.management.MBeanServer server,
javax.management.ObjectName name)
|
boolean |
getRequestsRecovery()
|
boolean |
getVolatility()
|
void |
remove(CronEntry entry)
Remove the given CronEntry from manager and quertz, if the manager is configured through a jboss-service.xml file this file has the last say when component is restarted. |
void |
setCronEntries(java.util.List cronEntries)
Set the list of CronEntries this edior handles. |
void |
setCronExp(java.lang.String cronExp)
Set the cron expression to use for the trigger. |
void |
setCronManagerName(javax.management.ObjectName manager)
Set the cron manager to use when editing. |
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 true, i.e no saving to persisten state! |
protected void |
startService()
Start the editor, calls edit. |
protected void |
stopService()
Stop the editor, remove al volatile entries from CronManager |
| 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 |
| Methods inherited from class javax.management.NotificationBroadcasterSupport |
addNotificationListener, getNotificationInfo, removeNotificationListener, sendNotification |
| Methods inherited from class java.lang.Object |
clone, equals, 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 javax.management.ObjectName cronManagerName
protected CronManager cronManager
protected java.util.List cronEntries
protected boolean recover
protected boolean volatility
protected java.lang.String cronExp
protected javax.management.ObjectName jobObjectName
protected CronEntry entry
| Constructor Detail |
public CronEditor()
| Method Detail |
protected javax.management.ObjectName getObjectName(javax.management.MBeanServer server,
javax.management.ObjectName name)
throws javax.management.MalformedObjectNameException
javax.management.MalformedObjectNameExceptionpublic void setCronManagerName(javax.management.ObjectName manager)
setCronManagerName in interface org.backsource.qcron.CronEditorMBeanpublic javax.management.ObjectName getCronManagerName()
getCronManagerName in interface org.backsource.qcron.CronEditorMBeanpublic void setCronEntries(java.util.List cronEntries)
setCronEntries in interface org.backsource.qcron.CronEditorMBeanpublic java.util.List getCronEntries()
getCronEntries in interface org.backsource.qcron.CronEditorMBeanpublic void setCronExp(java.lang.String cronExp)
setCronExp in interface org.backsource.qcron.CronEditorMBeanCronTriggerpublic java.lang.String getCronExp()
getCronExp in interface org.backsource.qcron.CronEditorMBeanpublic void setJobObjectName(javax.management.ObjectName jobName)
setJobObjectName in interface org.backsource.qcron.CronEditorMBeanpublic javax.management.ObjectName getJobObjectName()
getJobObjectName in interface org.backsource.qcron.CronEditorMBeanpublic void setRequestsRecovery(boolean recover)
if set to true: volatile must be false.
setRequestsRecovery in interface org.backsource.qcron.CronEditorMBeanpublic boolean getRequestsRecovery()
getRequestsRecovery in interface org.backsource.qcron.CronEditorMBeanpublic void setVolatility(boolean volatility)
setVolatility in interface org.backsource.qcron.CronEditorMBeanpublic boolean getVolatility()
getVolatility in interface org.backsource.qcron.CronEditorMBean
protected void startService()
throws java.lang.Exception
java.lang.Exception
protected void stopService()
throws java.lang.Exception
java.lang.Exception
public void edit()
throws CronException
This method will go through al CronEntry objects available in List. Jobbs will be handled under a group name wich is constructed from the ObjectName of the editor and a name from the CronEntry ObjectName. The algoritm is this:
edit in interface org.backsource.qcron.CronEditorMBeanCronException
public void remove(CronEntry entry)
throws CronException
remove in interface org.backsource.qcron.CronEditorMBeanCronException
public CronEntry getCronEntry()
throws CronException
getCronEntry in interface org.backsource.qcron.CronEditorMBeanCronException
public CronEntry getCronEntry(javax.management.ObjectName name)
throws CronException
getCronEntry in interface org.backsource.qcron.CronEditorMBeanCronException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||