|
ABLE, Version 1.1b | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RemoteObject | +--java.rmi.server.RemoteServer | +--java.rmi.server.UnicastRemoteObject | +--com.ibm.able.AbleObject | +--com.ibm.able.agents.AbleDefaultAgent
This class provides an Able container agent which can be composed of other AbleObjects. It serves as the default agent in the Able Editor.
Field Summary | |
protected boolean |
activeDataSource
Indicates if agent contains an active data source This field is initialized to false. |
protected java.lang.String |
agentAddr
The address of this agent. |
protected java.lang.String |
agentHost
The name of the host where this agent is running. |
protected java.lang.String |
agentName
The formal, remotely addressable name of the agent. |
protected java.util.Vector |
beans
The list of AbleBean objects contained by this agent |
protected java.util.Hashtable |
effectors
The list of effectors |
protected java.util.Vector |
eventConnections
A list of AbleEventConnection objects (listeners) on this object |
protected long |
numEpochs
The number of epochs processed in training mode This field is initialized to zero (0). |
protected java.util.Vector |
processList
The list of objects to be processed (in order) |
protected boolean |
processListOK
Indicates whether the processList needs to be computed This field is initialized to false. |
protected java.util.Hashtable |
sensors
The list of sensors |
Fields inherited from class com.ibm.able.AbleObject |
changed,
chgSupport,
comment,
dataFlowEnabled,
destBufferConnections,
eventQueue,
fileName,
inputBuffer,
listeners,
logger,
name,
outputBuffer,
parent,
propertyConnectionMgr,
sourceBufferConnections,
state,
stateChgSupport |
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Constructor Summary | |
AbleDefaultAgent()
Construct an AbleDefaultAgent instance |
|
AbleDefaultAgent(java.lang.String theName)
Construct an object with the specified name. |
|
AbleDefaultAgent(java.lang.String theName,
java.lang.String theComment)
Construct an object with the specified name and comment. |
Method Summary | |
void |
addBean(AbleBean theAbleBean)
Add another bean to this container/agent. |
void |
addEffector(AbleEffector theEffector)
Add an effector to the list of effectors. |
void |
addEventConnection(AbleEventConnection theConnection)
Add an event connection. |
void |
addSensor(AbleSensor theSensor)
Add a sensor to the list of sensors. |
protected void |
buildProcessList()
Examine the connection graph and build a sequential processing list. |
protected java.lang.String |
clsNm()
Get the name of this class for easy inclusion in exceptions. |
boolean |
containsBean(AbleBean theAbleBean)
Determine whether a specific bean/agent is contained in this agent. |
boolean |
containsBean(java.lang.String theName)
Determine whether a bean with a specific name is contained in this agent. |
static java.lang.String |
Copyright()
Determine the copyright of this class. |
protected void |
debugTrace(java.lang.String theMessage)
Log a trace message. |
java.lang.String |
getAgentAddr()
Retrieve the address of this agent. |
java.lang.String |
getAgentHost()
Retrieve the name of the host on which this agent is running. |
java.lang.String |
getAgentName()
Retrieve the current formal agent name of this agent. |
AbleBean |
getBean(java.lang.String theName)
Look for a bean with a specific name in this agent, and, if found, return a reference to that agent. |
java.util.Vector |
getBeans()
Return a list of all beans contained within this agent. |
AbleDataSource |
getDataSource()
Retrieve the current active DataSource (if any). |
java.util.Hashtable |
getEffectors()
Get all effectors registered with this manager. |
long |
getNumEpochs()
Get the number of training epochs. |
java.util.Vector |
getProcessList()
Get the sequential processing list |
java.util.Hashtable |
getSensors()
Get all sensors registered with this manager. |
void |
handleAbleEvent(AbleEvent theAbleEvent)
Handle an Able event. |
void |
init()
Initialize and configure the bean. |
void |
init(java.lang.Object theArg)
Initialize and configure the bean, using the specified Object. |
java.lang.Object |
invokeEffector(java.lang.String theEffectorName,
java.lang.Object[] theArgs)
Call the method that the effector represents, passing in the array of argument objects. |
java.lang.Object |
invokeSensor(java.lang.String theSensorName,
java.lang.Object[] theArgs)
Call the method that the sensor represents, passing in the array of argument objects. |
boolean |
isActiveDataSource()
Tests whether this agent has an active data source. |
static void |
main(java.lang.String[] args)
|
void |
process()
Perform the main, synchronous, standard processing function performed by this bean. |
void |
propertyChange(java.beans.PropertyChangeEvent theEvent)
Handle a propertyChange event. |
void |
quitAll()
Stop the all of the bean's asynchronous threads of control. |
void |
quitEnabledEventProcessing()
Stop the agent's asynchronous thread of control. |
void |
removeAllBeans()
Remove all beans from this container/agent. |
void |
removeBean(AbleBean theAbleBean)
Remove a bean from this container/agent. |
void |
removeEffector(java.lang.String theEffectorName)
Remove an effector from the list of effectors. |
void |
removeEventConnection(AbleEventConnection theConnection)
Remove an event connection. |
void |
removeSensor(java.lang.String theSensorName)
Remove a sensor from the list of sensors. |
void |
reset()
Reset the agent to its "initialized" state. |
void |
resumeAll()
Resume all of the bean's suspended asynchronous threads of control. |
void |
rmiRebind()
Make this agent a distributed agent, accessible through RMI, and able to participate in a distributed FIPA agent platform. |
void |
rmiUnbind()
Unbind this agent from RMI so that it is no longer accessible in a distributed FIPA agent platform. |
void |
setActiveDataSource(boolean theState)
Set the flag indicating if there is an active data source |
void |
setEffectors(java.util.Hashtable theEffectors)
Set all effectors for this manager. |
void |
setProcessList(java.util.Vector theProcessList)
Set the sequential processing list |
void |
setSensors(java.util.Hashtable theSensors)
Set all sensors for this manager. |
void |
suspendAll()
Temporarily suspend all of the bean's asynchronous threads of control. |
java.lang.String |
toString()
Retrieve a string describing (the contents of) the object. |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone,
exportObject,
exportObject,
exportObject,
unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost,
getLog,
setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals,
getRef,
hashCode,
toStub |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected java.lang.String agentName
protected java.lang.String agentHost
protected java.lang.String agentAddr
protected java.util.Vector beans
protected boolean activeDataSource
This field is initialized to false.
protected java.util.Vector eventConnections
protected java.util.Vector processList
protected boolean processListOK
This field is initialized to false.
protected long numEpochs
This field is initialized to zero (0).
protected java.util.Hashtable sensors
protected java.util.Hashtable effectors
Constructor Detail |
public AbleDefaultAgent() throws java.rmi.RemoteException
public AbleDefaultAgent(java.lang.String theName) throws java.rmi.RemoteException
theName
- The name of the object
public AbleDefaultAgent(java.lang.String theName, java.lang.String theComment) throws java.rmi.RemoteException
theName
- The name of the object
theComment
- A comment for the object
Method Detail |
public java.lang.String getAgentName() throws java.rmi.RemoteException
The agent name may be in the form of a simple name (the same as returned by getName() ), an RMI registry name, or an official FIPA name, depending on the environment in which the agent is used.
public java.lang.String getAgentHost() throws java.rmi.RemoteException
public java.lang.String getAgentAddr() throws java.rmi.RemoteException
public void setActiveDataSource(boolean theState) throws java.rmi.RemoteException
theState
- Indicate whether there is an active data source in
this agent
public boolean isActiveDataSource() throws java.rmi.RemoteException
public AbleDataSource getDataSource() throws java.rmi.RemoteException
public void addEventConnection(AbleEventConnection theConnection) throws java.rmi.RemoteException
theConnection
- An AbleEventConnection object
public void removeEventConnection(AbleEventConnection theConnection) throws java.rmi.RemoteException
theConnection
- An AbleEventConnection object
public void setProcessList(java.util.Vector theProcessList) throws java.rmi.RemoteException
theProcessList
- The objects to be processed
public java.util.Vector getProcessList() throws java.rmi.RemoteException
public long getNumEpochs() throws java.rmi.RemoteException
public void init() throws java.rmi.RemoteException
Also, the agent's formal name and address is determined, based upon the agent's simple name and the host on which the agent is running. Therefore, it is important that the agent's simple name not be changed once init() has been called.
AbleObject.startEnabledEventProcessing()
public void init(java.lang.Object theArg) throws java.rmi.RemoteException
Also, the agent's formal name and address is determined, based upon the agent's simple name and the host on which the agent is running. Therefore, it is important that the agent's simple name not be changed once init() has been called.
In this implementation, the argument parameter is ignored!
theArg
- An Object used to initialize the bean.
public void reset() throws java.rmi.RemoteException
In this implementation, nothing special is done, except that the reset() call is propagated to all DataFlowEnabled AbleBeans contained within this agent.
public void process() throws java.rmi.RemoteException
In this implementation, a single processing step is performed by walking through the process list and calling the process() method on each DataFlowEnabled AbleBean contained within this agent.
public void quitEnabledEventProcessing() throws java.rmi.RemoteException
Timer event processing and ABLE event processing cease, but if event Posting is still enabled, events may still be placed on the internal event queue by other processes.
In this implementation, the quit request is propagated to all AbleBean objects contained within this agent, since it doesn't make since to quit this object without quitting all the contained objects, too.
public void quitAll() throws java.rmi.RemoteException
If the bean is a simple AbleBean, this method just calls its quitEnabledEventProcessing() method; if the bean is an AbleBeanContainer, the bean additionally calls the same method on each contained bean.
quitEnabledEventProcessing()
public void suspendAll() throws java.rmi.RemoteException
If the bean is a simple AbleBean, this method just calls its suspendEnabledEventProcessing() method; if the bean is an AbleBeanContainer, the bean additionally calls the same method on each contained bean.
AbleObject.suspendEnabledEventProcessing()
public void resumeAll() throws java.rmi.RemoteException
If the bean is a simple AbleBean, this method just calls its resumeEnabledEventProcessing() method; if the bean is an AbleBeanContainer, the bean additionally calls the same method on each contained bean.
AbleObject.resumeEnabledEventProcessing()
public void handleAbleEvent(AbleEvent theAbleEvent) throws java.rmi.RemoteException
In this implementation, special processing occurs for EOF on the active data source. All other events are passed up to the superclass (AbleObject) for processing.
theAbleEvent
- The event to handle.
public void addBean(AbleBean theAbleBean) throws java.rmi.RemoteException
theAbleBean
- A bean that is to be added to this container. If the
specified bean is already contained in this agent,
this action is ignored.
Note that if the bean to be added has a current parent, that parentage will be lost. This is because an ABLE bean can have only one parent at a time and this method will set the specified bean's parent to be this agent!
If there is already a bean with the same name as theAbleBean a unique name will be generated by appending a colon and integer
AbleBeanContainer.removeBean(com.ibm.able.AbleBean)
,
AbleBeanContainer.containsBean(com.ibm.able.AbleBean)
,
AbleBeanContainer.getBean(java.lang.String)
,
AbleBeanContainer.getBeans()
public void removeBean(AbleBean theAbleBean) throws java.rmi.RemoteException
theAbleBean
- A bean that is to be removed from this agent. If the
specified bean is not contained in this agent, the
request is simply ignored.
Note that if the remove is successful, the bean's parent is set to null.
public void removeAllBeans() throws java.rmi.RemoteException
public boolean containsBean(AbleBean theAbleBean) throws java.rmi.RemoteException
theAbleBean
- A bean that is to be looked for in this agent.
public boolean containsBean(java.lang.String theName) throws java.rmi.RemoteException
theName
- The specific name of a bean that is to be looked for in this
agent.
public AbleBean getBean(java.lang.String theName) throws java.rmi.RemoteException
theName
- The specific name of a bean that is to be looked for in this
agent and, if found, returned.
public java.util.Vector getBeans() throws java.rmi.RemoteException
public void addSensor(AbleSensor theSensor) throws java.rmi.RemoteException
theSensor
- The sensor to be added to the list of sensors.
public void removeSensor(java.lang.String theSensorName) throws java.rmi.RemoteException
theSensorName
- The name of the sensor to be removed.
public java.lang.Object invokeSensor(java.lang.String theSensorName, java.lang.Object[] theArgs) throws java.rmi.RemoteException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.SecurityException
theSensorName
- The name of the sensor containing an encapsulated method.
theArgs
- An array of arguments that the method expects.
public void setSensors(java.util.Hashtable theSensors) throws java.rmi.RemoteException
theSensors
- A list of AbleSensor objects that replaces the current
list. The input list is cloned.
public java.util.Hashtable getSensors() throws java.rmi.RemoteException
public void addEffector(AbleEffector theEffector) throws java.rmi.RemoteException
theEffector
- The effector to be added to the list of effectors.
public void removeEffector(java.lang.String theEffectorName) throws java.rmi.RemoteException
theEffectorName
- The name of the effector to be removed.
public java.lang.Object invokeEffector(java.lang.String theEffectorName, java.lang.Object[] theArgs) throws java.rmi.RemoteException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.SecurityException
theEffectorName
- The name of the effector containing an encapsulated method.
theArgs
- An array of arguments that the method expects.
public void setEffectors(java.util.Hashtable theEffectors) throws java.rmi.RemoteException
theEffectors
- A list of AbleEffector objects that replaces the
current list. The input list is cloned.
public java.util.Hashtable getEffectors() throws java.rmi.RemoteException
public void propertyChange(java.beans.PropertyChangeEvent theEvent)
theEvent
- The property change event.
protected void buildProcessList() throws java.rmi.RemoteException
public void rmiRebind() throws java.rmi.RemoteException
public void rmiUnbind() throws java.rmi.RemoteException
protected java.lang.String clsNm()
protected void debugTrace(java.lang.String theMessage)
theMessage
- A String containing text to be traced.
public static void main(java.lang.String[] args) throws java.rmi.RemoteException
public java.lang.String toString()
public static java.lang.String Copyright()
|
ABLE, Version 1.1b | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |