|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.props.Props
com.cometway.ak.Agent
com.cometway.ak.ServiceAgent
com.cometway.ak.Scheduler
public class Scheduler
The Scheduler is a ServiceAgent which implements the com.cometway.util.IScheduler interface. It maintains a pool of threads that periodically wake up any com.cometway.util.IScheduleable that has been scheduled.
| Field Summary | |
|---|---|
java.util.Hashtable |
threadHash
|
| Fields inherited from class com.cometway.ak.Agent |
|---|
agent_id, agentController, CREATING_STATE, debugReporter, DESTROYED_STATE, DESTROYING_STATE, errorReporter, FAILED_STATE, printlnReporter, props, RUNNING_STATE, STARTING_STATE, STOPPED_STATE, STOPPING_STATE, warningReporter |
| Constructor Summary | |
|---|---|
Scheduler()
|
|
| Method Summary | |
|---|---|
static IScheduler |
getScheduler()
Returns a reference to the Scheduler registered with the Service Manager. |
static IScheduler |
getScheduler(java.lang.String serviceName)
Returns a reference to the Scheduler registered as the passed name with the Service Manager. |
int |
getSize()
Get the size of the Scheduler. |
void |
initProps()
Initializes the Props for this agent: service_name The service name this agent uses to register with the Service Manager. |
boolean |
schedule(ISchedulable schedulable)
Method implements IScheduler.schedule(). |
void |
scheduleChanged(ISchedulable schedulable)
Method implements IScheduleChangeListener.scheduleChanged() |
void |
setDebug(boolean debug)
Set the debug state of Scheduler. |
void |
start()
Starts up the scheduler and registers it with the Service Manager. |
boolean |
unschedule(ISchedulable schedulable)
Method implements IScheduler.unschedule(). |
| Methods inherited from class com.cometway.ak.ServiceAgent |
|---|
stop |
| Methods inherited from class com.cometway.ak.Agent |
|---|
currentStateEquals, debug, destroy, error, error, getAgentController, getDateTimeStr, getProps, getServiceImpl, getStateMachineModel, println, register, registerService, setAgentController, setProps, toString, unregister, unregisterService, warning, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.util.Hashtable threadHash
| Constructor Detail |
|---|
public Scheduler()
| Method Detail |
|---|
public void initProps()
initProps in interface AgentInterfaceinitProps in class Agentpublic void start()
start in interface AgentInterfacestart in class ServiceAgentpublic void setDebug(boolean debug)
public boolean schedule(ISchedulable schedulable)
schedule in interface ISchedulerschedulable - an object which implements the ISchedulable interface.
ISchedulablepublic boolean unschedule(ISchedulable schedulable)
unschedule in interface ISchedulerschedulable - an object which implements the ISchedulable interface.
ISchedulablepublic void scheduleChanged(ISchedulable schedulable)
scheduleChanged in interface IScheduleChangeListenerschedulable - a reference to the IScheduleable object whose schedule has changed.public int getSize()
public static IScheduler getScheduler()
public static IScheduler getScheduler(java.lang.String serviceName)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||