Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jboss.varia.scheduler
Class DBScheduleProvider  view DBScheduleProvider download DBScheduleProvider.java

java.lang.Object
  extended byjavax.management.NotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.ha.jmx.HAServiceMBeanSupport
              extended byorg.jboss.ha.singleton.HASingletonSupport
                  extended byorg.jboss.varia.scheduler.AbstractScheduleProvider
                      extended byorg.jboss.varia.scheduler.DBScheduleProvider
All Implemented Interfaces:
org.jboss.ha.jmx.HAServiceMBean, org.jboss.ha.singleton.HASingleton, org.jboss.ha.singleton.HASingletonMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class DBScheduleProvider
extends AbstractScheduleProvider

This Provider get its Scheduler from a Database and then adds all the Schedules to the Schedule Manager. The "SQL Statement" must deliver the following attributes: Index Content Data Type ---------------------------------- 1., Target, String 2., Method_Name, String 3., Method_Signature, String 4., Start_Date, String 5., Period, long 6., Repetitions, int 7., Date_Format, String ATTENTION: The "Target" is Object Name of the target MBean as String, the "Method_Signature" is a list of attributes separated by colons which can contain:

The "Period" is an long value greater than 0. The "Repetitions" can be set to "-1" which means unlimited repetitions. The "Date_Format" can be null or blank to signify locale usage

Version:
$Revision: 1.3.2.1 $

Field Summary
private  java.lang.String mDataSourceName
           
private  java.util.ArrayList mIDList
          The ID of the Schedule used later to remove it later
private  java.lang.String mSQLStatement
           
 
Fields inherited from class org.jboss.varia.scheduler.AbstractScheduleProvider
 
Fields inherited from class org.jboss.ha.singleton.HASingletonSupport
 
Fields inherited from class org.jboss.ha.jmx.HAServiceMBeanSupport
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, serviceName
 
Fields inherited from class javax.management.NotificationBroadcasterSupport
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, STARTED, STARTING, states, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
DBScheduleProvider()
          Default (no-args) Constructor
 
Method Summary
 java.lang.String getDataSourceName()
           
 javax.management.ObjectName getObjectName(javax.management.MBeanServer pServer, javax.management.ObjectName pName)
          Sub-classes should override this method if they only need to set their object name during MBean pre-registration.
protected  java.lang.String[] getSignature(java.lang.String pMethodSignature)
          Converts a string of method arguments (separated by colons) into an array of string
 java.lang.String getSQLStatement()
           
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 setDataSourceName(java.lang.String pDataSourceName)
          Sets the JNDI name of the Data Source.
 void setSQLStatement(java.lang.String pSQLStatement)
          Sets the SQL Statement used to retrieve the data from the Database
 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
addSchedule, getScheduleManagerName, isHASingleton, removeSchedule, setHASingleton, setScheduleManagerName, startScheduleProviderService, startService, startSingleton, stopScheduleProviderService, stopService, stopSingleton
 
Methods inherited from class org.jboss.ha.singleton.HASingletonSupport
_stopOldMaster, isMasterNode, makeThisNodeMaster, partitionTopologyChanged
 
Methods inherited from class org.jboss.ha.jmx.HAServiceMBeanSupport
_receiveRemoteNotification, callAsyncMethodOnPartition, 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
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, getListenerMap, getNotificationInfo, 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
callMethodOnPartition, getDistributedState, getPartitionName, sendNotification, setDistributedState, setPartitionName
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListener
 

Field Detail

mDataSourceName

private java.lang.String mDataSourceName

mSQLStatement

private java.lang.String mSQLStatement

mIDList

private java.util.ArrayList mIDList
The ID of the Schedule used later to remove it later

Constructor Detail

DBScheduleProvider

public DBScheduleProvider()
Default (no-args) Constructor

Method Detail

getDataSourceName

public java.lang.String getDataSourceName()

setDataSourceName

public void setDataSourceName(java.lang.String pDataSourceName)
Sets the JNDI name of the Data Source. You have to ensure that the DataSource is available when this service is started.


getSQLStatement

public java.lang.String getSQLStatement()

setSQLStatement

public void setSQLStatement(java.lang.String pSQLStatement)
Sets the SQL Statement used to retrieve the data from the Database


startProviding

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

Specified by:
startProviding in class AbstractScheduleProvider

stopProviding

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

Specified by:
stopProviding in class AbstractScheduleProvider

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.


getObjectName

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