metaglue
Class CatalogAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.util.NotifierAgent
|
+--metaglue.CatalogAgent
- public class CatalogAgent
- extends NotifierAgent
- implements Catalog
- See Also:
- Serialized Form
|
Field Summary |
protected static int |
GRAVEDIGGER_SLEEP
How long gravedigger should sleep between body searches. |
protected boolean |
should_dig
Whether the grave_digger should quit. |
|
Method Summary |
void |
add(AgentID agentID,
Remote agentAgent)
|
protected void |
add(AgentID agentID,
Remote agentAgent,
boolean freeze)
|
void |
addCatalogMonitor(CatalogMessageListener cml)
These are methods added for the specific catalog log
propagation routines due to bugs involved in trying
to have the catalog propagate messages normally |
protected void |
body_hunt()
This is what gravedigger runs to look for dead agents--pulling
out dead agents allows the enumerateAgents thing to work better |
protected String |
catalogHostName()
Get host machine catalog is on. |
int |
checkStatus(AgentID agentID)
Returns status of given agent:
Agent.NOT_RUNNING, STARTING, NO_METAGLUE, DIED, ALIVE |
protected void |
dealWithBody(String lst,
AgentID listingID)
Verify and then possibly remove the given agent (with catalog
listing name. |
void |
doneBooting()
|
Vector |
enumerateAgents()
Return an enumeration of all of the AgentID's in this catalog |
Vector |
enumerateAgents(Filter filter)
Get all agents which pass the test of the given filter. |
protected void |
freezeStub(AgentID id,
Remote stub)
Freeze a stub in the table in case the catalog dies. |
Catalog |
getCatalog()
|
protected void |
gravedigger()
The sleep, then search-and-destroy loop for finding dead
agents. |
void |
log(int lvl,
String msg)
Log, and tell all catalogmonitors about the log as well. |
Agent |
lookup(AgentID agentID)
Find an agent by id. |
Agent |
lookupBlocking(AgentID agentID)
|
protected void |
purgeIcebox()
Empty out the icebox. |
void |
rebuildTables()
|
void |
remove(AgentID agentID)
Remove agent from the catalog. |
void |
removeCatalogMonitor(CatalogMessageListener cml)
|
protected void |
removeFrozen(AgentID id)
|
protected void |
removeFrozen(int iid,
AgentID id)
|
void |
replaceStartingMG(AgentID aID,
AgentID mID)
|
| Methods inherited from class agentland.util.NotifierAgent |
addSpy,
addSpy,
getNoteTypes,
getNotifyTable,
gossip,
hack_notify,
lookupSpy,
notify,
notify,
passNotify,
putNotifyTable,
removeAllSpies,
removeNotifyTable,
removeSpy,
removeSpy,
removeSpy,
removeSpy,
removeSpy |
| Methods inherited from class metaglue.AgentAgent |
addMonitor,
alive,
defrost,
defrostAll,
defrostBoolean,
defrostInt,
defrostString,
fixAttribute,
fixAttribute,
freeze,
freeze,
freeze,
freezeAll,
freezeVar,
getAgentID,
getAttribute,
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 |
GRAVEDIGGER_SLEEP
protected static final int GRAVEDIGGER_SLEEP
- How long gravedigger should sleep between body searches.
(in ms)
should_dig
protected boolean should_dig
- Whether the grave_digger should quit.
CatalogAgent
public CatalogAgent(AgentID agentID)
throws RemoteException
CatalogAgent
public CatalogAgent(AgentID agentID,
boolean purge_icebox)
throws RemoteException
doneBooting
public void doneBooting()
catalogHostName
protected String catalogHostName()
throws RemoteException
- Get host machine catalog is on.
checkStatus
public int checkStatus(AgentID agentID)
throws RemoteException
- Returns status of given agent:
Agent.NOT_RUNNING, STARTING, NO_METAGLUE, DIED, ALIVE
- Specified by:
- checkStatus in interface Catalog
lookup
public Agent lookup(AgentID agentID)
throws RemoteException,
NotBoundException,
AccessException
- Find an agent by id. Removes agent if it is found to be dead, dead
dead.
- Specified by:
- lookup in interface Catalog
replaceStartingMG
public void replaceStartingMG(AgentID aID,
AgentID mID)
throws RemoteException
- Specified by:
- replaceStartingMG in interface Catalog
lookupBlocking
public Agent lookupBlocking(AgentID agentID)
throws RemoteException,
AccessException
- Specified by:
- lookupBlocking in interface Catalog
getCatalog
public Catalog getCatalog()
throws RemoteException
- Overrides:
- getCatalog in class AgentAgent
add
public void add(AgentID agentID,
Remote agentAgent)
throws RemoteException,
AlreadyBoundException
- Specified by:
- add in interface Catalog
add
protected void add(AgentID agentID,
Remote agentAgent,
boolean freeze)
throws RemoteException,
AlreadyBoundException
- Parameters:
freeze - whether to freeze stub in icebox--this should be true.
it is false when the defrosting happens and the tables are being
rebuilt.
remove
public void remove(AgentID agentID)
throws RemoteException,
AccessException
- Remove agent from the catalog.
- Specified by:
- remove in interface Catalog
purgeIcebox
protected void purgeIcebox()
- Empty out the icebox.
rebuildTables
public void rebuildTables()
removeFrozen
protected void removeFrozen(AgentID id)
removeFrozen
protected void removeFrozen(int iid,
AgentID id)
- Parameters:
iid - icebox id of agent in question.id - agent id
freezeStub
protected void freezeStub(AgentID id,
Remote stub)
- Freeze a stub in the table in case the catalog dies.
Precondition: stub is NOT an agent placeholder.
body_hunt
protected void body_hunt()
- This is what gravedigger runs to look for dead agents--pulling
out dead agents allows the enumerateAgents thing to work better
dealWithBody
protected void dealWithBody(String lst,
AgentID listingID)
- Verify and then possibly remove the given agent (with catalog
listing name. Used by gravedigger.
gravedigger
protected void gravedigger()
- The sleep, then search-and-destroy loop for finding dead
agents.
enumerateAgents
public Vector enumerateAgents()
throws RemoteException
- Return an enumeration of all of the AgentID's in this catalog
- Specified by:
- enumerateAgents in interface Catalog
enumerateAgents
public Vector enumerateAgents(Filter filter)
- Get all agents which pass the test of the given filter.
- Specified by:
- enumerateAgents in interface Catalog
- Tags copied from interface: Catalog
- Returns:
- Vector of AgentIDs
addCatalogMonitor
public void addCatalogMonitor(CatalogMessageListener cml)
throws RemoteException
- These are methods added for the specific catalog log
propagation routines due to bugs involved in trying
to have the catalog propagate messages normally
- Specified by:
- addCatalogMonitor in interface Catalog
removeCatalogMonitor
public void removeCatalogMonitor(CatalogMessageListener cml)
throws RemoteException
- Specified by:
- removeCatalogMonitor in interface Catalog
log
public void log(int lvl,
String msg)
- Log, and tell all catalogmonitors about the log as well.
- Overrides:
- log in class AgentAgent
- Tags copied from class: AgentAgent
- Parameters:
level - The log level.info - The string to send to the log.- See Also:
LogStream