org.jboss.varia.scheduler
Interface ScheduleManagerMBean

All Superinterfaces:
Service, ServiceMBean
All Known Implementing Classes:
ScheduleManager

public interface ScheduleManagerMBean
extends ServiceMBean

ScheduleManagerMBean interface.

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

Field Summary
static 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
 int addSchedule(ObjectName provider, ObjectName target, String methodName, String[] methodSignature, Date startDate, long period, int repetitions)
          Adds a new Schedule to the Scheduler
 boolean getFixedRate()
           
 String getTimerName()
           
 boolean isStartAtStartup()
           
 void registerProvider(String providerObjectName)
          Register a Schedule Provider to make him available.
 void removeSchedule(int identification)
          Removes a Schedule so that no notification is sent anymore
 void restartSchedule()
          Stops and restarts the service
 void setFixedRate(boolean fixedRate)
          The default scheduling to use, fixed-rate or fixed-delay (false, default)
 void setStartAtStartup(boolean startAtStartup)
          Whether the scheduler should be started upon MBean start or not
 void setTimerName(String timerObjectName)
          The JMX timer to use for the actual scheduling
 void startSchedules()
          Starts all the registered Schedules
 void stopSchedules(boolean doItNow)
          Stops all the registered Schedules
 void unregisterProvider(String providerObjectName)
          Unregister a Schedule Provider which in turn calls back stopProviding() to indicate to the Provider that it should remove all the Schedules.
 
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 ObjectName OBJECT_NAME
The default ObjectName

Method Detail

setStartAtStartup

void setStartAtStartup(boolean startAtStartup)
Whether the scheduler should be started upon MBean start or not


isStartAtStartup

boolean isStartAtStartup()

setTimerName

void setTimerName(String timerObjectName)
The JMX timer to use for the actual scheduling


getTimerName

String getTimerName()

setFixedRate

void setFixedRate(boolean fixedRate)
The default scheduling to use, fixed-rate or fixed-delay (false, default)


getFixedRate

boolean getFixedRate()

startSchedules

void startSchedules()
Starts all the registered Schedules


stopSchedules

void stopSchedules(boolean doItNow)
Stops all the registered Schedules

Parameters:
doItNow - currently ignored

restartSchedule

void restartSchedule()
Stops and restarts the service


registerProvider

void registerProvider(String providerObjectName)
Register a Schedule Provider to make him available. This method calls startProviding() on the Provider to indicate that the Provider can start adding Schedules.

Parameters:
providerObjectName - Object Name of the Provider

unregisterProvider

void unregisterProvider(String providerObjectName)
Unregister a Schedule Provider which in turn calls back stopProviding() to indicate to the Provider that it should remove all the Schedules.

Parameters:
providerObjectName - Object Name of the Provider

addSchedule

int addSchedule(ObjectName provider,
                ObjectName target,
                String methodName,
                String[] methodSignature,
                Date startDate,
                long period,
                int repetitions)
Adds a new Schedule to the Scheduler

Parameters:
target - Object Name of the Target MBean
methodName - Name of the method to be called
methodSignature - List of Attributes of the method to be called where ...
startDate - Date when the schedule is started
repetitions - Initial Number of repetitions
Returns:
identification of the Schedule used later to remove it if necessary

removeSchedule

void removeSchedule(int identification)
Removes a Schedule so that no notification is sent anymore

Parameters:
identification - id returned by addSchedule().


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.