agentland.resource.namer
Class NamerAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.util.GoodAgent
|
+--agentland.resource.namer.NamerAgent
- public class NamerAgent
- extends GoodAgent
- implements Namer, ResourceManager
- See Also:
- Serialized Form
Method Summary |
void |
addRequestHook(AgentID watcher)
This is so agents can watch all resource requests on the java
side and add/modify them if necessary/desired. |
void |
addTranslation(String start,
String target)
|
void |
addWatchedOccupation(String s)
|
boolean |
clearTranslation(String trans)
Remove translation from lists. |
boolean |
clearWatchedOccupation(String occ)
Remove watched occupation from list. |
boolean |
connect(AgentID start,
AgentID end)
Connect two agents together (in whatever sense makes sense.) |
Collection |
getAgentNames(AgentID id)
Return any known String names for an agentID. |
ResourceBunch |
lookup(Request req,
Context con,
AgentID requestor)
Get a list of things which match the name of request. |
protected void |
queryAndAddTranslation(AgentID start_id)
|
void |
registerInstance(AgentID resID)
Register a Managed Agent as alive and kicking. |
void |
removeRequestHook(AgentID watcher)
|
void |
replaceFor(AgentID requestor,
Resource res,
Request req,
Context con)
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 request,
Context context,
AgentID requestor)
|
AgentID |
translate(AgentID start_id)
Given an ID, translate it into a new ID. |
AgentID |
translate(String start_id)
|
Methods inherited from class agentland.util.GoodAgent |
addSpy,
addSpy,
alert,
alertString,
beep,
error,
getAlert,
getHistory,
getHistoryElement,
getPersistentMap,
log,
notify,
removeSpy,
removeSpy,
resetHistory,
safeRely,
safeRely,
safeRely,
setNiceLogName,
tell |
Methods inherited from class metaglue.AgentAgent |
addMonitor,
alive,
defrost,
defrostAll,
defrostBoolean,
defrostInt,
defrostString,
fixAttribute,
fixAttribute,
freeze,
freeze,
freeze,
freezeAll,
freezeVar,
getAgentID,
getAttribute,
getCatalog,
getCatalogID,
getDesignation,
getFrozenVariables,
getLogLevel,
getMetaglueAgent,
getMetaglueAgentID,
getOccupation,
getProperties,
getSociety,
log,
log,
obtainMetaglueAgent,
obtainMetaglueAgent,
obtainMetaglueAgentByName,
reliesOn,
reliesOn,
reliesOn,
reliesOnSynch,
removeFrozen,
replaceExceptionHandler,
setFreezeName,
setLogLevel,
setLogName,
shutdown,
startAgent,
startAgentOn,
startAgentOn,
startup,
status,
tiedTo,
tiedTo,
tiedTo,
tiedTo,
tieToDesignation,
whereAreYou |
cm
protected ConnectionMaker cm
- Agent that will create connections for us
NamerAgent
public NamerAgent()
throws RemoteException
request
public ResourceBunch request(Request request,
Context context,
AgentID requestor)
throws RemoteException
- Specified by:
- request in interface ResourceManager
addTranslation
public void addTranslation(String start,
String target)
throws RemoteException
- Specified by:
- addTranslation in interface Namer
queryAndAddTranslation
protected void queryAndAddTranslation(AgentID start_id)
translate
public AgentID translate(AgentID start_id)
- Given an ID, translate it into a new ID.
- Specified by:
- translate in interface Namer
translate
public AgentID translate(String start_id)
throws RemoteException
- Specified by:
- translate in interface Namer
addWatchedOccupation
public void addWatchedOccupation(String s)
throws RemoteException
- Specified by:
- addWatchedOccupation in interface Namer
clearTranslation
public boolean clearTranslation(String trans)
- Remove translation from lists.
- Specified by:
- clearTranslation in interface Namer
- Returns:
- true if found and removed.
clearWatchedOccupation
public boolean clearWatchedOccupation(String occ)
throws RemoteException
- Remove watched occupation from list.
- Specified by:
- clearWatchedOccupation in interface Namer
- Returns:
- true if found and removed.
registerInstance
public void registerInstance(AgentID resID)
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
lookup
public ResourceBunch lookup(Request req,
Context con,
AgentID requestor)
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
replaceFor
public void replaceFor(AgentID requestor,
Resource res,
Request req,
Context con)
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
connect
public boolean connect(AgentID start,
AgentID end)
throws RemoteException
- Description copied from interface: ResourceManager
- Connect two agents together (in whatever sense makes sense.)
- Specified by:
- connect in interface ResourceManager
addRequestHook
public void addRequestHook(AgentID watcher)
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
removeRequestHook
public void removeRequestHook(AgentID watcher)
throws RemoteException
- Specified by:
- removeRequestHook in interface ResourceManager
getAgentNames
public Collection getAgentNames(AgentID id)
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