com.ibm.able.examples.platform
Class SimpleFipaAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--com.ibm.able.AbleObject
|
+--com.ibm.able.agents.AbleDefaultAgent
|
+--com.ibm.able.platform.agents.FipaAgentDefaultAgent
|
+--com.ibm.able.examples.platform.SimpleFipaAgent
- public class SimpleFipaAgent
- extends FipaAgentDefaultAgent
- implements java.io.Serializable
This class provides a simple implementation of the FipaAgent interface.
This agent does nothing really, but when created it will seek
out and register itself with the AMS and DF agents, and when told
to "quit" it will deregister from those agents. It can also accept
FIPA "request" messages, but simply prints a statement that it got
one.
- Version:
- 1.0.0; change log:
Version Description
-------- -----------
1.0.0 Initial release.
- See Also:
- Serialized Form
Fields inherited from class com.ibm.able.agents.AbleDefaultAgent |
activeDataSource,
agentAddr,
agentHost,
agentName,
beans,
effectors,
eventConnections,
numEpochs,
processList,
processListOK,
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 |
SimpleFipaAgent()
Create a new SimpleFipaAgent. |
SimpleFipaAgent(java.lang.String theName,
java.lang.String theComment)
Create a new FipaAgent, specify it's name, and give it a comment. |
Methods inherited from class com.ibm.able.platform.agents.FipaAgentDefaultAgent |
deregisterWithAms,
deregisterWithDf,
destroyAgent,
executeAgent,
invokeAgent,
moveAgent,
msgAcceptProposal,
msgAgree,
msgCancel,
msgCfp,
msgConfirm,
msgDisconfirm,
msgFailure,
msgInform,
msgInformIf,
msgInformRef,
msgNotUnderstood,
msgPropose,
msgQueryIf,
msgQueryRef,
msgRefuse,
msgRejectProposal,
msgRequestWhen,
msgRequestWhenever,
msgSubscribe,
registerWithAms,
registerWithDf,
resumeAgent,
suspendAgent,
waitAgent,
wakeUpAgent |
Methods inherited from class com.ibm.able.agents.AbleDefaultAgent |
addBean,
addEffector,
addEventConnection,
addSensor,
buildProcessList,
clsNm,
containsBean,
containsBean,
debugTrace,
getAgentAddr,
getAgentHost,
getAgentName,
getBean,
getBeans,
getDataSource,
getEffectors,
getNumEpochs,
getProcessList,
getSensors,
init,
invokeEffector,
invokeSensor,
isActiveDataSource,
process,
propertyChange,
quitAll,
quitEnabledEventProcessing,
removeAllBeans,
removeBean,
removeEffector,
removeEventConnection,
removeSensor,
reset,
resumeAll,
rmiRebind,
rmiUnbind,
setActiveDataSource,
setEffectors,
setProcessList,
setSensors,
suspendAll |
Methods inherited from class com.ibm.able.AbleObject |
addAbleEventListener,
addDestBufferConnection,
addPropertyChangeListener,
addPropertyConnection,
addSourceBufferConnection,
addStateChangeListener,
dataChanged,
firePropertyChange,
flushAbleEventQueue,
getAbleEventListeners,
getAbleEventProcessingEnabled,
getAbleEventQueueSize,
getBuffer,
getBufferContents,
getComment,
getDestBufferConnections,
getFileName,
getInputBuffer,
getInputBuffer,
getInputBufferAsStringArray,
getInputBufferContents,
getLogger,
getName,
getOutputBuffer,
getOutputBuffer,
getOutputBufferAsStringArray,
getOutputBufferContents,
getParent,
getPropertyConnectionManager,
getSleepTime,
getSourceBufferConnections,
getState,
hasInputBuffer,
hasOutputBuffer,
isAbleEventPostingEnabled,
isAbleEventProcessingEnabled,
isChanged,
isConnectable,
isDataFlowEnabled,
isTimerEventProcessingEnabled,
notifyAbleEventListeners,
processAbleEvent,
processBufferConnections,
processNoEventProcessingEnabledSituation,
processTimerEvent,
removeAbleEventListener,
removeAllAbleEventListeners,
removeAllBufferConnections,
removeAllPropertyConnections,
removeDestBufferConnection,
removePropertyChangeListener,
removePropertyConnection,
removeSourceBufferConnection,
removeStateChangeListener,
restartEnabledEventProcessing,
restoreFromFile,
restoreFromFile,
restoreFromSerializedFile,
restoreFromStream,
resumeEnabledEventProcessing,
saveToFile,
saveToFile,
setAbleEventProcessingEnabled,
setChanged,
setComment,
setDataFlowEnabled,
setFileName,
setInputBuffer,
setInputBuffer,
setLogger,
setName,
setOutputBuffer,
setOutputBuffer,
setParent,
setSleepTime,
setState,
setTimerEventProcessingEnabled,
sourceConnectionsOK,
startEnabledEventProcessing,
suspendEnabledEventProcessing |
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 |
SimpleFipaAgent
public SimpleFipaAgent()
throws java.rmi.RemoteException
- Create a new SimpleFipaAgent.
This method that takes no parameters allows this class to be used
by BeanBox-like construction tools. It simply sets the name of the
agent to a system generated name.
- Throws:
- java.rmi.RemoteException - On any error.
SimpleFipaAgent
public SimpleFipaAgent(java.lang.String theName,
java.lang.String theComment)
throws java.rmi.RemoteException
- Create a new FipaAgent, specify it's name, and give it a comment.
- Parameters:
theName
- A string containing the name of this new agent.
theComment
- A string containing a comment for this new agent.
- Throws:
- java.rmi.RemoteException - On any error.
quitAgent
public void quitAgent()
throws java.rmi.RemoteException
- Overrides:
- quitAgent in class FipaAgentDefaultAgent
msgRequest
public void msgRequest(FipaAclMessage theAclMessage)
throws java.rmi.RemoteException
- Overrides:
- msgRequest in class FipaAgentDefaultAgent
init
public void init()
throws java.rmi.RemoteException
- Initialize and configure the agent.
In this implementation the bean's state changes from
AbleState.Uninitiated to AbleState.Initiated; timer event
processing is disabled; both Able event posting and processing
are enabled; and the asynchronous thread is started.
- Overrides:
- init in class AbleDefaultAgent
handleAbleEvent
public void handleAbleEvent(AbleEvent theAbleEvent)
throws java.rmi.RemoteException
- Handle an Able event.
- Parameters:
theAbleEvent
- The event to handle.
- Overrides:
- handleAbleEvent in class AbleDefaultAgent
main
public static void main(java.lang.String[] args)
throws java.rmi.RemoteException
toString
public java.lang.String toString()
- Retrieve a string describing (the contents of) the object.
- Returns:
- A String containing the current contents of the object.
- Overrides:
- toString in class FipaAgentDefaultAgent
Copyright
public static java.lang.String Copyright()
- Determine the copyright of this class.
- Returns:
- A String containing this class's copyright statement.
ABLE: Produced by Joe, Don, and Jeff who say, 'Thanks for your support.'