agentland.resource.namer
Class NamerEHA

java.lang.Object
  |
  +--agentland.resource.namer.NamerEHA

public class NamerEHA
extends Object
implements ExceptionHandler, Namer, Good, ResourceManager


Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Constructor Summary
NamerEHA(MetagluePrimitives ap, AgentID agentID, Catalog c)
           
 
Method Summary
 void addMonitor(Spy param0)
          Add a log monitor that gets all the screen output.
 void addRequestHook(AgentID param0)
          This is so agents can watch all resource requests on the java side and add/modify them if necessary/desired.
 void addTranslation(String param0, String param1)
           
 void addWatchedOccupation(String param0)
           
 boolean alive()
           
 boolean connect(AgentID param0, AgentID param1)
          Connect two agents together (in whatever sense makes sense.)
 Agent getAgent()
          get the internal stub used.
 AgentID getAgentID()
           
 Collection getAgentNames(AgentID param0)
          Return any known String names for an agentID.
 AgentID getAgtID()
          get the internal agentID used.
 Vector getHistory()
           
 String getHistoryElement(int param0)
           
 AgentID getMetaglueAgentID()
           
 void instantiate(Agent a)
           
 ResourceBunch lookup(Request param0, Context param1, AgentID param2)
          Get a list of things which match the name of request.
 void registerInstance(AgentID param0)
          Register a Managed Agent as alive and kicking.
 void removeRequestHook(AgentID param0)
           
 void replaceExceptionHandler(AgentExceptionHandler r)
           
 void replaceFor(AgentID param0, Resource param1, Request param2, Context param3)
          On behalf of some agent, replace the resource named with some other requested resource and context as defined by the passed request
 ResourceBunch request(Request param0, Context param1, AgentID param2)
           
 void resetHistory()
           
 void setAgent(Agent a)
          set the internal stub used to passed agent.
 void setAgtID(AgentID a)
          set the internal agentID used to passed agent.
 void shutdown()
           
 void startup()
           
 void tell(Secret param0)
          This is called if the Agent is to recieve a particular secret.
 AgentID translate(AgentID param0)
          Given an ID, translate it into a new ID.
 AgentID translate(String param0)
           
 InetAddress whereAreYou()
          Returns the InetAddress of the machine where the agent is running
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamerEHA

public NamerEHA(MetagluePrimitives ap,
                AgentID agentID,
                Catalog c)
         throws RemoteException
Method Detail

getAgent

public Agent getAgent()
Description copied from interface: ExceptionHandler
get the internal stub used. (Used for resource management interception)
Specified by:
getAgent in interface ExceptionHandler

setAgent

public void setAgent(Agent a)
Description copied from interface: ExceptionHandler
set the internal stub used to passed agent. (Used for resource management interception)
Specified by:
setAgent in interface ExceptionHandler

getAgtID

public AgentID getAgtID()
Description copied from interface: ExceptionHandler
get the internal agentID used. (Used for resource management interception)
Specified by:
getAgtID in interface ExceptionHandler

setAgtID

public void setAgtID(AgentID a)
Description copied from interface: ExceptionHandler
set the internal agentID used to passed agent. (Used for resource management interception)
Specified by:
setAgtID in interface ExceptionHandler

instantiate

public void instantiate(Agent a)
Specified by:
instantiate in interface ExceptionHandler

replaceExceptionHandler

public void replaceExceptionHandler(AgentExceptionHandler r)
Specified by:
replaceExceptionHandler in interface ExceptionHandler

addRequestHook

public void addRequestHook(AgentID param0)
                    throws RemoteException
Description copied from interface: ResourceManager
This is so agents can watch all resource requests on the java side and add/modify them if necessary/desired. (So a person locator can add person's location to request info.)
Specified by:
addRequestHook in interface ResourceManager

connect

public boolean connect(AgentID param0,
                       AgentID param1)
                throws RemoteException
Description copied from interface: ResourceManager
Connect two agents together (in whatever sense makes sense.)
Specified by:
connect in interface ResourceManager

getAgentNames

public Collection getAgentNames(AgentID param0)
                         throws RemoteException
Description copied from interface: ResourceManager
Return any known String names for an agentID. This can be used for speech recog, management of resource or whatall.
Specified by:
getAgentNames in interface ResourceManager

lookup

public ResourceBunch lookup(Request param0,
                            Context param1,
                            AgentID param2)
                     throws RemoteException
Description copied from interface: ResourceManager
Get a list of things which match the name of request. Do not actually request anything, just get the things that fill the request.
Specified by:
lookup in interface ResourceManager

registerInstance

public void registerInstance(AgentID param0)
                      throws RemoteException
Description copied from interface: ResourceManager
Register a Managed Agent as alive and kicking. Should be called in the agent's constructor.
Specified by:
registerInstance in interface ResourceManager

removeRequestHook

public void removeRequestHook(AgentID param0)
                       throws RemoteException
Specified by:
removeRequestHook in interface ResourceManager

replaceFor

public void replaceFor(AgentID param0,
                       Resource param1,
                       Request param2,
                       Context param3)
                throws RemoteException
Description copied from interface: ResourceManager
On behalf of some agent, replace the resource named with some other requested resource and context as defined by the passed request
Specified by:
replaceFor in interface ResourceManager

request

public ResourceBunch request(Request param0,
                             Context param1,
                             AgentID param2)
                      throws RemoteException
Specified by:
request in interface ResourceManager

tell

public void tell(Secret param0)
          throws RemoteException
Description copied from interface: Spy
This is called if the Agent is to recieve a particular secret.

addMonitor

public void addMonitor(Spy param0)
                throws RemoteException
Description copied from interface: Agent
Add a log monitor that gets all the screen output.

alive

public boolean alive()
              throws RemoteException

getAgentID

public AgentID getAgentID()

getMetaglueAgentID

public AgentID getMetaglueAgentID()
                           throws RemoteException

shutdown

public void shutdown()
              throws RemoteException

startup

public void startup()
             throws RemoteException

whereAreYou

public InetAddress whereAreYou()
                        throws RemoteException
Description copied from interface: Agent
Returns the InetAddress of the machine where the agent is running

getHistory

public Vector getHistory()
                  throws RemoteException
Specified by:
getHistory in interface Good

getHistoryElement

public String getHistoryElement(int param0)
                         throws RemoteException
Specified by:
getHistoryElement in interface Good

resetHistory

public void resetHistory()
                  throws RemoteException
Specified by:
resetHistory in interface Good

addTranslation

public void addTranslation(String param0,
                           String param1)
                    throws RemoteException
Specified by:
addTranslation in interface Namer

addWatchedOccupation

public void addWatchedOccupation(String param0)
                          throws RemoteException
Specified by:
addWatchedOccupation in interface Namer

translate

public AgentID translate(String param0)
                  throws RemoteException
Specified by:
translate in interface Namer

translate

public AgentID translate(AgentID param0)
                  throws RemoteException
Description copied from interface: Namer
Given an ID, translate it into a new ID. Uses two persistent maps. "translations" is a list of known translations from agentID to agentID. "watchedOccupations" is a list of which occupations demand a query. If an id is on the watched list, and no translation is known, the system will query user for the new agentID and store it for further use. (Does via promptbox, so it needs a display.)
Specified by:
translate in interface Namer