org.jboss.varia.scheduler
Class XMLScheduleProvider

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.ha.jmx.HAServiceMBeanSupport (src) 
              extended byorg.jboss.ha.singleton.HASingletonSupport (src) 
                  extended byorg.jboss.varia.scheduler.AbstractScheduleProvider (src) 
                      extended byorg.jboss.varia.scheduler.XMLScheduleProvider
All Implemented Interfaces:
HAServiceMBean (src) , HASingleton (src) , HASingletonMBean (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)

public class XMLScheduleProvider
extends AbstractScheduleProvider (src)

This Provider get its Scheduler from a XML configuration string allowing the administrator to add several Schedules with one provider. The "Schedules" properties has to look like:


Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
XMLScheduleProvider()
          Default (no-args) Constructor
 
Method Summary
protected  org.w3c.dom.Text getNode(org.w3c.dom.NodeList pList, java.lang.String pName)
          Loops of the given Node List and looks for the Element with the given Node Name
 ObjectName (src) getObjectName(MBeanServer (src)  pServer, ObjectName (src)  pName)
          Sub-classes should override this method if they only need to set their object name during MBean pre-registration.
 org.w3c.dom.Element getSchedules()
           
protected  java.lang.String[] getSignature(java.lang.String pMethodSignature)
          Converts a string of method arguments (separated by colons) into an array of string
protected  java.util.Date getStartDate(java.lang.String pStartDate, java.lang.String dateFormat)
          Converts the given Data string to a date where not value means 1/1/1970, "NOW" means now (plus a second), an long value means time in milliseconds since 1/1/1970 and a String is a Date string which is intepreted by a Simple Data Formatter.
 void setSchedules(org.w3c.dom.Element pSchedules)
          Sets the XML configuration attribute
 void startProviding()
          Add the Schedule to the Schedule Manager
 void stopProviding()
          Stops the Provider from providing causing the provider to remove the Schedule
 
Methods inherited from class org.jboss.varia.scheduler.AbstractScheduleProvider (src)
addSchedule, getScheduleManagerName, isHASingleton, removeSchedule, setHASingleton, setScheduleManagerName, startScheduleProviderService, startService, startSingleton, stopScheduleProviderService, stopService, stopSingleton
 
Methods inherited from class org.jboss.ha.singleton.HASingletonSupport (src)
_stopOldMaster, isMasterNode, makeThisNodeMaster, partitionTopologyChanged
 
Methods inherited from class org.jboss.ha.jmx.HAServiceMBeanSupport (src)
_receiveRemoteNotification, callAsyncMethodOnPartition, callMethodOnPartition, callMethodOnPartition, findHAPartitionWithName, getDistributedState, getPartition, getPartitionName, getServiceHAName, isDRMMasterReplica, registerDRMListener, registerRPCHandler, sendNotification, sendNotificationRemote, sendNotificationToLocalListeners, setDistributedState, setPartitionName, setupPartition, unregisterDRMListener, unregisterRPCHandler
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.ha.jmx.HAServiceMBean (src)
callMethodOnPartition, getDistributedState, getPartitionName, sendNotification, setDistributedState, setPartitionName
 
Methods inherited from interface org.jboss.system.ServiceMBean (src)
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service (src)
create, destroy, start, stop
 
Methods inherited from interface javax.management.NotificationBroadcaster (src)
addNotificationListener, getNotificationInfo, removeNotificationListener
 

Constructor Detail

XMLScheduleProvider

public XMLScheduleProvider()
Default (no-args) Constructor

Method Detail

getSchedules

public org.w3c.dom.Element getSchedules()
Returns:
XML configuration attribute

setSchedules

public void setSchedules(org.w3c.dom.Element pSchedules)
Sets the XML configuration attribute


startProviding

public void startProviding()
                    throws java.lang.Exception
Add the Schedule to the Schedule Manager

Specified by:
startProviding in class AbstractScheduleProvider (src)
Throws:
java.lang.Exception

getNode

protected org.w3c.dom.Text getNode(org.w3c.dom.NodeList pList,
                                   java.lang.String pName)
Loops of the given Node List and looks for the Element with the given Node Name

Parameters:
pName - The name of the node to look for
Returns:
Element if found otherwise null

stopProviding

public void stopProviding()
Stops the Provider from providing causing the provider to remove the Schedule

Specified by:
stopProviding in class AbstractScheduleProvider (src)

getSignature

protected java.lang.String[] getSignature(java.lang.String pMethodSignature)
Converts a string of method arguments (separated by colons) into an array of string


getStartDate

protected java.util.Date getStartDate(java.lang.String pStartDate,
                                      java.lang.String dateFormat)
Converts the given Data string to a date where not value means 1/1/1970, "NOW" means now (plus a second), an long value means time in milliseconds since 1/1/1970 and a String is a Date string which is intepreted by a Simple Data Formatter.

Parameters:
pStartDate - the date
dateFormat - the dateFormat, the locale is is used when null or blank

getObjectName

public ObjectName (src)  getObjectName(MBeanServer (src)  pServer,
                                ObjectName (src)  pName)
                         throws MalformedObjectNameException (src) 
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method if they only need to set their object name during MBean pre-registration.

Overrides:
getObjectName in class ServiceMBeanSupport (src)
Throws:
MalformedObjectNameException (src)