ABLE, Version 1.1b

com.ibm.able.platform.agents
Class FipaDfAgentAppl

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.FipaDfAgentAppl

public class FipaDfAgentAppl
extends FipaAgentDefaultAgent
implements FipaDfAgent

This class provides an implementation of a FIPA Directory Facilitator (DF) agent.

This implementation of a DF agent will

This DF does not register with itself (what's the point, really?)

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
FipaDfAgentAppl()
          Create a new AblePlatform FIPA DF agent.
 
Method Summary
static java.lang.String Copyright()
          Determine the copyright of this class.
 FipaDfAgentDescription deregister(FipaDfAgentDescription theDescription)
          Deregister an agent from this DF.
 java.util.Hashtable getRegisteredAgents()
          Get all the registered agents from this DF.
 void init()
          Initialize and configure the agent.
static void main(java.lang.String[] args)
          Create a FIPA DF agent and register it with RMI so that it is available over the network.
 void modify(FipaDfAgentDescription theDescription)
          Modify a registered agent.
 void quitAgent()
          Terminate this agent.
 FipaDfAgentDescription register(FipaDfAgentDescription theDescription)
          Register an agent with this DF.
 java.util.Vector search(FipaDfAgentDescription theDescription)
          Search the agent registry for an agent with specific attributes.
 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, 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

FipaDfAgentAppl

public FipaDfAgentAppl()
                throws java.rmi.RemoteException
Create a new AblePlatform FIPA DF 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

register

public FipaDfAgentDescription register(FipaDfAgentDescription theDescription)
                                throws java.rmi.RemoteException
Register an agent with this DF.
Specified by:
register in interface FipaDfAgent
Parameters:
theDescription - A FIPA DF agent description identifying the agent to be registered.

Returns:
The FIPA DF agent description of the registered agent.
Throws:
java.rmi.RemoteException - On any error.

deregister

public FipaDfAgentDescription deregister(FipaDfAgentDescription theDescription)
                                  throws java.rmi.RemoteException
Deregister an agent from this DF.
Specified by:
deregister in interface FipaDfAgent
Parameters:
theDescription - A FIPA DF agent description identifying the agent to be deregistered. The agent must, of course, already be registered with this DF.

Returns:
The FIPA DF agent description of the deregistered agent, or null if the agent was not found in the registry.
Throws:
java.rmi.RemoteException - On any error.

search

public java.util.Vector search(FipaDfAgentDescription theDescription)
                        throws java.rmi.RemoteException
Search the agent registry for an agent with specific attributes.

NOTE that this method currently searches only by service-type!

Specified by:
search in interface FipaDfAgent
Parameters:
theDescription - A FIPA DF agent description containing search criteria.

Returns:
A list of FIPA DF agent descriptions of any agents that match the search criteria. Note that if no matching agents are found, the returned list will be empty. (In other words, null is not returned.)
Throws:
java.rmi.RemoteException - On any error.

modify

public void modify(FipaDfAgentDescription theDescription)
            throws java.rmi.RemoteException
Modify a registered agent.

NOTE that this method currently does nothing!

Specified by:
modify in interface FipaDfAgent
Parameters:
theDescription - A FIPA DF agent description identifying the agent to be modified, and how it is to be modified. The agent must, of course, be registered with this DF.

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

getRegisteredAgents

public java.util.Hashtable getRegisteredAgents()
                                        throws java.rmi.RemoteException
Get all the registered agents from this DF.
Specified by:
getRegisteredAgents in interface FipaDfAgent
Returns:
A copy of the hashtable of that contains all registered FIPA DF agent names and descriptions (FipaDfAgentDescription objects).
Throws:
java.rmi.RemoteException - On any error.

quitAgent

public void quitAgent()
               throws java.rmi.RemoteException
Terminate this agent.
Throws:
java.rmi.RemoteException - On any error.
Overrides:
quitAgent 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.

Furthermore, the AMS Agent Description is filled in and the DF registers with the AMS.

Overrides:
init in class AbleDefaultAgent

main

public static void main(java.lang.String[] args)
Create a FIPA DF 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.'