xmlBlaster 2.1.0 API

org.xmlBlaster.contrib.scheduler
Class SchedulerPlugin

java.lang.Object
  extended by org.xmlBlaster.contrib.GlobalInfo
      extended by org.xmlBlaster.contrib.scheduler.SchedulerPlugin
All Implemented Interfaces:
org.quartz.Job, I_Info, SchedulerPluginMBean, I_Plugin

public class SchedulerPlugin
extends GlobalInfo
implements SchedulerPluginMBean, org.quartz.Job


Nested Class Summary
 class SchedulerPlugin.CronData
          The syntax for the configuration is as for crontab: http://www.adminschoice.com/docs/crontab.htm#Crontab%20file .
 
Field Summary
private  java.util.Map cronDataMap
           
private static java.util.logging.Logger log
           
private  java.lang.Object mbeanHandle
           
private static java.lang.String[] MONTH_NAMES
           
private  org.quartz.Scheduler sched
           
private static java.lang.String[] WEEK_NAMES
           
 
Fields inherited from class org.xmlBlaster.contrib.GlobalInfo
global, LOWER_CASE, ORIGINAL_ENGINE_GLOBAL, pluginInfo, UNTOUCHED, UPPER_CASE
 
Fields inherited from interface org.xmlBlaster.contrib.I_Info
ID, JMX_PREFIX
 
Constructor Summary
SchedulerPlugin()
           
 
Method Summary
 java.lang.String addScheduler(java.lang.String name, java.lang.String value)
           
private  SchedulerPlugin.CronData addSchedulerWithEx(java.lang.String name, java.lang.String value)
           
protected  void doInit(Global glob, PluginInfo plugInfo)
           
 void execute(org.quartz.JobExecutionContext context)
           
 java.lang.String getJobNames()
           
 java.lang.String getSchedulerList()
           
 java.lang.String removeScheduler(java.lang.String name)
           
 void shutdown()
          Cleans up the resource.
private  void startSchedule(org.quartz.Scheduler sched, java.lang.String name, SchedulerPlugin.CronData data)
           
 
Methods inherited from class org.xmlBlaster.contrib.GlobalInfo
dump, get, getBoolean, getGlobal, getInt, getKeys, getLong, getObject, getObjectKeys, getOriginalGlobal, getRaw, getStrippedString, getType, getVersion, init, loadPlugin, put, putObject, putRaw, replaceAllEntries, setStrippedHostname
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEEK_NAMES

private static final java.lang.String[] WEEK_NAMES

MONTH_NAMES

private static final java.lang.String[] MONTH_NAMES

log

private static final java.util.logging.Logger log

sched

private org.quartz.Scheduler sched

cronDataMap

private java.util.Map cronDataMap

mbeanHandle

private java.lang.Object mbeanHandle
Constructor Detail

SchedulerPlugin

public SchedulerPlugin()
Method Detail

startSchedule

private void startSchedule(org.quartz.Scheduler sched,
                           java.lang.String name,
                           SchedulerPlugin.CronData data)
                    throws XmlBlasterException
Throws:
XmlBlasterException

addSchedulerWithEx

private SchedulerPlugin.CronData addSchedulerWithEx(java.lang.String name,
                                                    java.lang.String value)
                                             throws org.quartz.SchedulerException,
                                                    XmlBlasterException
Throws:
org.quartz.SchedulerException
XmlBlasterException

removeScheduler

public java.lang.String removeScheduler(java.lang.String name)
Specified by:
removeScheduler in interface SchedulerPluginMBean

doInit

protected void doInit(Global glob,
                      PluginInfo plugInfo)
               throws XmlBlasterException
Specified by:
doInit in class GlobalInfo
Parameters:
glob - The global passed by the RunLevelManager, this is not the object owned by the plugin. It is the original global.
Throws:
XmlBlasterException

execute

public void execute(org.quartz.JobExecutionContext context)
             throws org.quartz.JobExecutionException
Specified by:
execute in interface org.quartz.Job
Throws:
org.quartz.JobExecutionException

shutdown

public void shutdown()
              throws XmlBlasterException
Description copied from interface: I_Plugin
Cleans up the resource.

Specified by:
shutdown in interface SchedulerPluginMBean
Specified by:
shutdown in interface I_Plugin
Overrides:
shutdown in class GlobalInfo
Throws:
XmlBlasterException - if an exception occurs. The exception is handled by the RunLevelManager depending on how the plugin has been configured with the action:

<action do='STOP' onShutdownRunlevel='2' sequence='5' onFail='resource.configuration.pluginFailed'> If onFail is defined to something, the RunLevelManager will stop.

See Also:
I_Plugin.shutdown()

getSchedulerList

public java.lang.String getSchedulerList()
Specified by:
getSchedulerList in interface SchedulerPluginMBean

addScheduler

public java.lang.String addScheduler(java.lang.String name,
                                     java.lang.String value)
Specified by:
addScheduler in interface SchedulerPluginMBean

getJobNames

public java.lang.String getJobNames()
                             throws org.quartz.SchedulerException
Specified by:
getJobNames in interface SchedulerPluginMBean
Throws:
org.quartz.SchedulerException

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.