ABLE, Version 1.1b

com.ibm.able.platform.agents
Class FipaAccAgentAppl

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.platform.agents.FipaAccAgentAppl

public class FipaAccAgentAppl
extends FipaAgentDefaultAgent
implements FipaAccAgent

This class provides an implementation of a FIPA Agent Communication Channel (ACC) agent.

This implementation of an ACC agent will

Version:
$Revision: 1.4 $, $Date: 2000/02/22 19:23:13 $
See Also:
Serialized Form

Fields inherited from class com.ibm.able.platform.agents.FipaAgentDefaultAgent
myAmsAd, myDfAd, myDfServices
 
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
FipaAccAgentAppl()
          Create a new Able Platform FIPA ACC agent.
 
Method Summary
static java.lang.String Copyright()
          Determine the copyright of this class.
 void forward(FipaAclMessage theAclMessage)
          Forward a message to the agent(s) addressed on the envelope.
 void forward(java.lang.String theAclMessage)
          Forward a message to the agent(s) addressed on the envelope.
 void init()
          Initialize and configure the agent.
static void main(java.lang.String[] args)
          Create a FIPA ACC agent and register it with RMI so that it is available over the network.
 java.lang.String toString()
          Retrieve a string describing (the contents of) the object.
 
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, msgRequest, msgRequestWhen, msgRequestWhenever, msgSubscribe, quitAgent, 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, handleAbleEvent, 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
 

Constructor Detail

FipaAccAgentAppl

public FipaAccAgentAppl()
                 throws java.rmi.RemoteException
Create a new Able Platform FIPA ACC agent.

The name and comment are set to pre-defined values, but the agent does not otherwise initialise itself or begin running until init() is called.

Throws:
java.rmi.RemoteException - On any error.
Method Detail

forward

public void forward(FipaAclMessage theAclMessage)
             throws java.rmi.RemoteException
Forward a message to the agent(s) addressed on the envelope.

This version of forward() takes an AclMessage object whose :content slot can be either an AbleEvent object or any arbitrary object. If the content slot contains an instance of an AbleEvent, then that event is forwarded to each recipient by calling each recipient's handleAbleEvent() method and passing the AbleEvent as an argument.

If the content slot contains an arbitrary object (that isn't an instance of an AbleEvent), then an AbleEvent object is created such that the event action is derived from the Fipa.AclMessageType, and the AclMessage itself is set to be the event's action argument. This newly created AbleEvent is then forwarded to each recipient by calling each recipient's handleAbleEvent() method and passing the AbleEvent as an argument.

Specified by:
forward in interface FipaAccAgent
Parameters:
theAclMessage - an AclMessage object whose ":content" slot is either
  1. a valid AbleEvent object where the "action" of the event object is the name of a method in the recipient, and the "argObject" is some object required by the method. For example, an event for an AMS might have "register" as the action and a FipaAmsAgentDefinition object as the argument.
  2. any Java Object other than an AbleEvent. In this case, an AbleEvent is constructed based on the information in the AclMessage itself, and that event is forwarded on to each recipient.

Throws:
java.rmi.RemoteException - On any error.

forward

public void forward(java.lang.String theAclMessage)
             throws java.rmi.RemoteException
Forward a message to the agent(s) addressed on the envelope.

This version of forward() takes a string KQML message, parses it, and creates the necessary structures which are forwarded on to the recipients.

Note that this version of forward() currently has no implementation!

Specified by:
forward in interface FipaAccAgent
Parameters:
theAclMessage - a message in KQML format.

Throws:
java.rmi.RemoteException - On any error.

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.

Furthermore, the AMS Agent Description is filled in; the ACC registers with the AMS; the DF agent is started, if necessary; and the ACC registers with the DF.

Overrides:
init in class AbleDefaultAgent

main

public static void main(java.lang.String[] args)
Create a FIPA ACC agent and register it with RMI so that it is available over the network.

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, Version 1.1b

ABLE: Produced by Joe, Don, and Jeff who say, 'Thanks for your support.'