org.jboss.varia.scheduler
Interface SingleScheduleProviderMBean

All Superinterfaces:
AbstractScheduleProviderMBean, org.jboss.system.Service, org.jboss.system.ServiceMBean
All Known Implementing Classes:
SingleScheduleProvider

public interface SingleScheduleProviderMBean
extends AbstractScheduleProviderMBean

SingleScheduleProvider MBean interface.

Version:
$Revision: 1.1.4.5 $
Author:
Andreas Schaefer, Dimitris Andreadis

Field Summary
static javax.management.ObjectName OBJECT_NAME
          The default ObjectName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Method Summary
 String getDateFormat()
           
 long getPeriod()
           
 long getRepetitions()
           
 String getStartDate()
           
 String getTargetMethod()
           
 javax.management.ObjectName getTargetName()
           
 void setDateFormat(String dateFormat)
          The date format used to parse date/times
 void setPeriod(long period)
          The Schedule Period between two scheduled call.
 void setRepetitions(long numberOfCalls)
          Sets the initial number of scheduled calls.
 void setStartDate(String startDate)
          The date/time of the first scheduled call.
 void setTargetMethod(String method)
          The method name to call on the Schedulable MBean.
 void setTargetName(javax.management.ObjectName objectName)
          The ObjectName of the Schedulable MBean to call
 
Methods inherited from interface org.jboss.varia.scheduler.AbstractScheduleProviderMBean
getScheduleManagerName, setScheduleManagerName, startProviding, stopProviding
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

OBJECT_NAME

static final javax.management.ObjectName OBJECT_NAME
The default ObjectName

Method Detail

setTargetName

void setTargetName(javax.management.ObjectName objectName)
The ObjectName of the Schedulable MBean to call


getTargetName

javax.management.ObjectName getTargetName()

setTargetMethod

void setTargetMethod(String method)
                     throws IllegalArgumentException
The method name to call on the Schedulable MBean. It can optionally be followed by an opening bracket, list of attributes (see below) and a closing bracket. The list of attributes can contain: An example could be: "doSomething( NOTIFICATION, REPETITIONS, java.lang.String )" where the Scheduler will pass the timer's notification instance, the remaining repetitions as int and a null to the MBean's doSomething() method which must have the following signature: doSomething(javax.management.Notification, long, java.lang.String).

Parameters:
method - Name of the method to be called optional followed by method arguments (see above).
Throws:
IllegalArgumentException - If the given value is not of the right format

getTargetMethod

String getTargetMethod()

setPeriod

void setPeriod(long period)
The Schedule Period between two scheduled call.

Parameters:
period - Time between to scheduled calls (after the initial call) in Milliseconds. This value must be bigger than 0.
Throws:
IllegalArgumentException - If the given value is less or equal than 0

getPeriod

long getPeriod()

setDateFormat

void setDateFormat(String dateFormat)
The date format used to parse date/times

Parameters:
dateFormat - The date format when empty or null the locale is used to parse dates

getDateFormat

String getDateFormat()

setStartDate

void setStartDate(String startDate)
The date/time of the first scheduled call. If the date is in the past the scheduler tries to find the next available start date.

Parameters:
startDate - Date when the initial call is scheduled. It can be either:
  • NOW: date will be the current date (new Date()) plus 1 seconds
  • Date as String able to be parsed by SimpleDateFormat with default format
  • Date as String parsed using the date format attribute
  • Milliseconds since 1/1/1970
If the date is in the past the Scheduler will search a start date in the future with respect to the initial repe- titions and the period between calls. This means that when you restart the MBean (restarting JBoss etc.) it will start at the next scheduled time. When no start date is available in the future the Scheduler will not start.
Example: if you start your Schedulable everyday at Noon and you restart your JBoss server then it will start at the next Noon (the same if started before Noon or the next day if start after Noon).

getStartDate

String getStartDate()

setRepetitions

void setRepetitions(long numberOfCalls)
Sets the initial number of scheduled calls.

Parameters:
numberOfCalls - Initial Number of scheduled calls. If -1 then the number is unlimited.
Throws:
IllegalArgumentException - If the given value is less or equal than 0

getRepetitions

long getRepetitions()


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.