com.agentfactory.cldc
Class Service

java.lang.Object
  extended by com.agentfactory.cldc.Service
Direct Known Subclasses:
MessageTransportService, MigrationManager, P2PMigrationManager, PeerToPeerMTS, UniqueNameService

public abstract class Service
extends java.lang.Object

This class is extended by the application developer to create local platform services. The message transport service is an example of a local platform service. Local platform services are used when agents must share an information space or be capable of accessing a shared object.

Author:
Conor Muldoon

Constructor Summary
Service(java.lang.Object nm)
          Constructs a new instance of Service.
 
Method Summary
abstract  void modifyBinding(java.lang.Object oldName, java.lang.Object newName)
          Changes the name of an agent in the service's registry if one exists.
abstract  FOS processAction(AgentName agentName, int actionID, FOS data)
          Performs an action on the service.
abstract  FOS processPer(AgentName agentName, int perceptionID)
          Perceives information from within the service.
 void register(java.util.Hashtable table)
          Adds the name of the service to the specified hash table.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Service

public Service(java.lang.Object nm)
Constructs a new instance of Service.

Parameters:
nm - the name of the service.
Method Detail

register

public void register(java.util.Hashtable table)
Adds the name of the service to the specified hash table.

Parameters:
table - the hash table that the name is added to.

modifyBinding

public abstract void modifyBinding(java.lang.Object oldName,
                                   java.lang.Object newName)
Changes the name of an agent in the service's registry if one exists.

Parameters:
oldName - the old name of the agent.
newName - the new name of the agent.

processPer

public abstract FOS processPer(AgentName agentName,
                               int perceptionID)
                        throws MalformedLogicException
Perceives information from within the service.

Parameters:
agentName - the agent that wishes to perceive the information.
perceptionID - the ID of the information that is to be perceived.
Returns:
a first order structure that represents the information that has been perceived in the service.
Throws:
MalformedLogicException - if there is a logic error.

processAction

public abstract FOS processAction(AgentName agentName,
                                  int actionID,
                                  FOS data)
                           throws MalformedLogicException
Performs an action on the service.

Parameters:
agentName - the name of the agent that is performing the action.
actionID - the ID of the action that is to be performed.
data - the data that is to be used in performing the action.
Returns:
true if the action was performed successfully, false otherwise.
Throws:
MalformedLogicException - if there is a logic error.