pamanager
Class SchedulerAgent

java.lang.Object
  |
  +--ciagent.CIAgent
        |
        +--pamanager.SchedulerAgent

public class SchedulerAgent
extends CIAgent
implements java.io.Serializable

The SchedulerAgent class fires events on specified intervals or at a single specified date and time.

See Also:
Serialized Form

Field Summary
protected  java.lang.String actionString
           
protected  int interval
           
protected  boolean oneShot
           
protected  java.util.Date time
           
 
Fields inherited from class ciagent.CIAgent
agentPlatform, children, DEFAULT_ASYNCTIME, DEFAULT_SLEEPTIME, name, parent, traceLevel
 
Constructor Summary
SchedulerAgent()
          Creates a SchedulerAgent object.
SchedulerAgent(java.lang.String name)
          Creates a SchedulerAgent object with the given name.
 
Method Summary
 java.lang.String getActionString()
          Retrieves the actionString this agent sends in events.
 int getInterval()
          Retrieves the interval time, in seconds.
 boolean getOneShot()
          Retrieves the one-shot flag.
 java.lang.String getTaskDescription()
          Retrieves a string for display that contains information about this agent.
 java.util.Date getTime()
          Retrieves the time setting for the one-shot timer.
 void initialize()
          Initializes this agent by setting the timers.
 void process()
          Does nothing because this agent only processes timer pops.
 void processCIAgentEvent(CIAgentEvent e)
          Does nothing because this agent only processes timer pops.
 void processTimerPop()
          Processes the timer pop by sending an event to the event listeners for this agent.
 void setActionString(java.lang.String actionString)
          Sets the action string to be sent by this agent in an EVENT.
 void setInterval(int secs)
          Sets the interval time to the given number of seconds.
 void setOneShot(boolean flag)
          Sets the one-shot flag.
 void setTime(java.util.Date date)
          Sets the time for the one-shot timer.
 
Methods inherited from class ciagent.CIAgent
addAgent, addCIAgentEventListener, addPropertyChangeListener, getAgent, getAgentPlatform, getAgents, getAsyncTime, getChildren, getCustomizerClass, getDisplayName, getName, getParent, getSleepTime, getState, getTraceLevel, notifyCIAgentEventListeners, postCIAgentEvent, processAsynchronousEvents, removeAgent, removeCIAgentEventListener, removePropertyChangeListener, reset, resumeAgentProcessing, setAgentPlatform, setAsyncTime, setName, setParent, setSleepTime, setState, setTraceLevel, startAgentProcessing, stopAgentProcessing, suspendAgentProcessing, trace
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interval

protected int interval

oneShot

protected boolean oneShot

time

protected java.util.Date time

actionString

protected java.lang.String actionString
Constructor Detail

SchedulerAgent

public SchedulerAgent()
Creates a SchedulerAgent object.

SchedulerAgent

public SchedulerAgent(java.lang.String name)
Creates a SchedulerAgent object with the given name.
Parameters:
name - the String object
Method Detail

getTaskDescription

public java.lang.String getTaskDescription()
Retrieves a string for display that contains information about this agent.
Returns:
the String object that contains the display information
Overrides:
getTaskDescription in class CIAgent

setInterval

public void setInterval(int secs)
Sets the interval time to the given number of seconds.
Parameters:
secs - the integer that represents the number of seconds for the interval

getInterval

public int getInterval()
Retrieves the interval time, in seconds.
Returns:
the integer that represents the interval, in seconds

setOneShot

public void setOneShot(boolean flag)
Sets the one-shot flag.
Parameters:
flag - the boolean that indicates whether this is a one-shot scheduler or not

getOneShot

public boolean getOneShot()
Retrieves the one-shot flag.
Returns:
the boolean value that indicates whether this is a one-shot scheduler (true) or not (false)

setTime

public void setTime(java.util.Date date)
Sets the time for the one-shot timer.
Parameters:
date - the Date object that contains the time when the one-shot timer should pop

getTime

public java.util.Date getTime()
Retrieves the time setting for the one-shot timer.
Returns:
the Date object that contains the time when the one-shot timer should pop

setActionString

public void setActionString(java.lang.String actionString)
Sets the action string to be sent by this agent in an EVENT.
Parameters:
actionString - the integer that represents the action

getActionString

public java.lang.String getActionString()
Retrieves the actionString this agent sends in events.
Returns:
the String that is sent in the action field of an event

initialize

public void initialize()
Initializes this agent by setting the timers.
Overrides:
initialize in class CIAgent

process

public void process()
Does nothing because this agent only processes timer pops.
Overrides:
process in class CIAgent

processTimerPop

public void processTimerPop()
Processes the timer pop by sending an event to the event listeners for this agent.
Overrides:
processTimerPop in class CIAgent

processCIAgentEvent

public void processCIAgentEvent(CIAgentEvent e)
Does nothing because this agent only processes timer pops.
Parameters:
e - the CIAgentEvent object to be processed
Overrides:
processCIAgentEvent in class CIAgent