|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ciagent.CIAgent
The CIAgent
class defines the common programming interface
and behavior for intelligent agents.
The lifecycle of a CIAgent is as follows:
Call process() to perform synchronous agent processing of data. Use processTimerPop() to perform asynchronous agent processing. Call processCIAgentEvent() to perform synchronous event processing Call postCIAgentEvent() to perform asynchronous event processing
Field Summary | |
protected AgentPlatform |
agentPlatform
|
protected java.util.Vector |
children
|
static int |
DEFAULT_ASYNCTIME
|
static int |
DEFAULT_SLEEPTIME
|
protected java.lang.String |
name
|
protected CIAgent |
parent
|
protected int |
traceLevel
|
Constructor Summary | |
CIAgent()
Creates a CIAgent instance. |
|
CIAgent(java.lang.String name)
Creates a CIAgent with specified name. |
Method Summary | |
void |
addAgent(CIAgent child)
Adds a CIAgent to this agent and sets its parent member to point to this agent. |
void |
addCIAgentEventListener(CIAgentEventListener listener)
Adds a listener for CIAgent events. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener for PropertyChange events. |
CIAgent |
getAgent(java.lang.String name)
Retrieves an agent running on the same agent platform |
AgentPlatform |
getAgentPlatform()
Retrieves the agent platform. |
java.util.Vector |
getAgents()
Retrieves the other agents running on the same agent platform |
int |
getAsyncTime()
Retrieves the time (in milliseconds) for asynchronous event processing. |
java.util.Vector |
getChildren()
Retrieves a list of CIAgent objects contained by this agent. |
java.lang.Class |
getCustomizerClass()
Uses introspection on this bean to get the customizer class (if any). |
java.lang.String |
getDisplayName()
Uses introspection on this bean to get the display name (defaults to the class name). |
java.lang.String |
getName()
Retrieves the name of this agent. |
CIAgent |
getParent()
Retrieves the parent CIAgent object. |
int |
getSleepTime()
Retrieves the agent sleep time (in milliseconds). |
CIAgentState |
getState()
Retrieves the current state of this agent (UNINITIATED, INITIATED, ACTIVE, SUSPENDED, UNKNOWN). |
abstract java.lang.String |
getTaskDescription()
Retrieves a formatted string for display of this agent's current task. |
int |
getTraceLevel()
Retrieves the trace level. |
abstract void |
initialize()
Initializes this agent for processing. |
protected void |
notifyCIAgentEventListeners(CIAgentEvent e)
Delivers the CIAgent event to all registered listeners. |
void |
postCIAgentEvent(CIAgentEvent event)
Posts an event to this agent's event queue. |
abstract void |
process()
Provides the synchronous processing done by this agent. |
void |
processAsynchronousEvents()
Processes all events on the asynchronous event queue periodically, depending on the asynchronous event time for this agent. |
void |
processCIAgentEvent(CIAgentEvent event)
Performs synchronous event processing for this agent. |
abstract void |
processTimerPop()
Provides the asynchronous, autonomous behavior of this agent that occurs periodically, depending on the sleep time for this agent. |
void |
removeAgent(CIAgent child)
Removes a CIAgent from this agent. |
void |
removeCIAgentEventListener(CIAgentEventListener listener)
Removes a listener for CIAgent events. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a listener for PropeortyChange events. |
void |
reset()
Resets this agent so that it is in a known state. |
void |
resumeAgentProcessing()
Resumes agent processing of the timer and asynchronous events and sets the agent state to ACTIVE. |
void |
setAgentPlatform(AgentPlatform agentPlatform)
Sets the agent platform for this agent. |
void |
setAsyncTime(int asyncTime)
Sets the time (in milliseconds) for asynchronous event processing. |
void |
setName(java.lang.String newName)
Sets the name of this agent. |
void |
setParent(CIAgent parent)
Sets the parent CIAgent for this agent. |
void |
setSleepTime(int sleepTime)
Sets the agent sleep time (in milliseconds) for autonomous processing. |
protected void |
setState(int newState)
Sets the current state of this agent (UNINITIATED, INITIATED, ACTIVE, SUSPENDED, UNKNOWN). |
void |
setTraceLevel(int traceLevel)
Sets the trace level. |
void |
startAgentProcessing()
Starts the agent timer and asynchronous event processing and sets the agent state to ACTIVE. |
void |
stopAgentProcessing()
Stops the agent timer and asynchronous event processing and sets the agent state to UNKNOWN. |
void |
suspendAgentProcessing()
Temporarily stops the agent timer so that the autonomous behavior is suspended and sets the agent state to SUSPENDED. |
void |
trace(java.lang.String msg)
Sends a trace event to all registered listeners. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int DEFAULT_SLEEPTIME
public static final int DEFAULT_ASYNCTIME
protected java.lang.String name
protected int traceLevel
protected AgentPlatform agentPlatform
protected java.util.Vector children
protected CIAgent parent
Constructor Detail |
public CIAgent()
CIAgent
instance.public CIAgent(java.lang.String name)
name
- the String name given to this agentMethod Detail |
public void setName(java.lang.String newName)
newName
- the String that contains the new name of this agentpublic java.lang.String getName()
protected void setState(int newState)
state
- the new state of this agentnewState
- the int objectpublic CIAgentState getState()
public void setSleepTime(int sleepTime)
sleepTime
- the sleep time (in milliseconds) for this agentpublic int getSleepTime()
public void setAsyncTime(int asyncTime)
asyncTime
- the time (in milliseconds) for asynchronous event processingpublic int getAsyncTime()
public void setTraceLevel(int traceLevel)
traceLevel
- the integer that represents the trace levelpublic int getTraceLevel()
public void setAgentPlatform(AgentPlatform agentPlatform)
agentPlatform
- the AgentPlatform object for this agentpublic AgentPlatform getAgentPlatform()
public java.util.Vector getAgents()
public CIAgent getAgent(java.lang.String name)
public abstract java.lang.String getTaskDescription()
public java.util.Vector getChildren()
public void setParent(CIAgent parent)
parent
- the CIAgent object that is the parent of this agentpublic CIAgent getParent()
public java.lang.Class getCustomizerClass()
public java.lang.String getDisplayName()
public void reset()
public abstract void initialize()
public void startAgentProcessing()
public void stopAgentProcessing()
public void suspendAgentProcessing()
public void resumeAgentProcessing()
public abstract void process()
public abstract void processTimerPop()
public void processAsynchronousEvents()
public void processCIAgentEvent(CIAgentEvent event)
event
- the CIAgentEvent objectpublic void postCIAgentEvent(CIAgentEvent event)
event
- the CIAgentEvent to be postedpublic void addCIAgentEventListener(CIAgentEventListener listener)
listener
- the CIAgentEventListener to be addedpublic void removeCIAgentEventListener(CIAgentEventListener listener)
listener
- the CIAgentEventListener to be removedprotected void notifyCIAgentEventListeners(CIAgentEvent e)
e
- the CIAgentEvent to be sent to all listenerspublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the PropertyChangeListener to be addedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the PropertyChangeListener to be removedpublic void trace(java.lang.String msg)
msg
- the String that is the message portion of the trace eventpublic void addAgent(CIAgent child)
child
- the CIAgent object to be added to this object as a childpublic void removeAgent(CIAgent child)
child
- the CIAgent object to be removed from this agent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |