|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RemoteObject | +--java.rmi.server.RemoteServer | +--java.rmi.server.UnicastRemoteObject | +--metaglue.AgentAgent | +--metaglue.MetaglueAgent
A Metaglue Agent starts agents on the VM that it is running on. A Metaglue Agent belongs to a single society, but it can manipulate agents from any society on the VM. A Metaglue Agent uses a particular Catalog Agent to get its information about agents. Multiple Metaglue Agents can exist on a single VM. A Metaglue Agent is made unique in a particular society by its designation which includes: the host of its VM. and the Catalog Agent ID of the Catalog Agent that this Metaglue Agent gets information about agents from.
Inner classes inherited from class metaglue.AgentAgent |
AgentAgent.Attribute |
Field Summary | |
static String |
defaultSociety
all the Metaglue Agents on the VM this list must be kept on the VM and not in a Catalog because the Metaglue Agents on the VM may all have different Catalog Agents that do not know about each other also this list provides an efficiency for having direct access to a Metaglue Agent from other agents this makes sense for Metaglue Agents because an agent's starting Metaglue Agent is always local. |
static MetaglueAgent |
meto
This is, when main() is called, the agent that main() produces. |
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Fields inherited from interface metaglue.Agent |
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING |
Constructor Summary | |
MetaglueAgent(AgentID agentID)
This is main constructor, since we normally grab catalog. |
|
MetaglueAgent(AgentID agentID,
Catalog cat)
Creates a Metaglue Agent. |
Method Summary | |
static void |
_addClassLoader(ChainingClassLoader cl)
|
static ChainingClassLoader |
_setupClassLoader()
|
static MetaglueAgent |
_startupMetaglue(boolean loadingCatalog,
String society,
InetAddress localHost,
String catalog,
CatalogAgent catalog_pointer,
String cname_suggest)
|
static void |
clearStartLock()
Clears the lock for this Metaglue Agent starting an agent Called by the process reading the start info |
byte[] |
fetchClassInfo(String name)
This will fetch the data for the given class name. |
protected byte[] |
fetchSystemResourceData(String rsrc)
|
Agent |
findAgent(AgentID agentID)
Finds an agent with agent ID |
Agent |
findAgentBlockIfStarting(AgentID agentID)
|
Agent |
findAgentBlocking(AgentID agentID)
Find an agent, wait until agent shows up. |
Agent |
findAgentBlocking(AgentID agentID,
boolean retry_if_not_found)
|
protected Metaglue |
findOtherMetaglue(String soc)
Find a metaglue agent othen than self (but of proper society) that accept agents. |
boolean |
getAcceptAgents()
Returns true if this MVM will allow new agents to start there. |
Catalog |
getCatalog()
Gets the Catalog that this Metaglue Agent uses |
CatalogID |
getCatalogID()
|
ManagedConnection |
getDatabaseConnection()
Gets the current db connection. |
static MetaglueAgent |
getMetaglueAgent(AgentID agentID)
Deprecated. Use getVMMetaglueAgent() with no arguments. |
static StartInfo |
getStartInfo()
Gets the start info for a starting agent |
protected void |
getStartLock()
Sets the lock for this Metaglue Agent starting an agent It should be cleared by the process reading the start info |
static MetaglueAgent |
getVMMetaglueAgent()
Gets a non-remote copy of the Metaglue Agent on the VM |
protected boolean |
isForwardingClassFetcher()
|
static Agent |
loadAgent(String argString)
|
static void |
loadAgents(String[] args)
Load the agents listed in the argument list. |
static void |
main(String[] args)
Establishes a Metalgue VM with Metaglue Agent to maintain it which in turn starts any listed agents. |
boolean |
pingMVM(String society,
String host)
Is any VM of given society and host alive? |
void |
setAcceptAgents(boolean v)
Allows you to decide if more agents can be accepted at this MVM |
void |
setDatabase(boolean local_db,
String dbname)
Sets the database connection parameters. |
static String[] |
setup(String[] args)
|
static String[] |
setup(String[] args,
boolean acceptAgents)
|
void |
shutdownAgent(AgentID agentID)
Shuts down the agent by removing it from the Catalog |
void |
startAgent(AgentID agentID,
Object[] parameters)
Starts an agent on the VM maintained by this Metaglue Agent |
static void |
startLocalLogManager(String society,
InetAddress localHost)
|
static void |
startThreadWatcher()
|
Methods inherited from class metaglue.AgentAgent |
addMonitor, alive, buildEHAFor, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getOldLogs, getProperties, getProxyHandlerClass, getSociety, installAPH, log, log, log, lookupClass, reliesOn, reliesOn, reliesOn, reliesOnSynch, removeAPHFromCatalog, removeFrozen, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, toString, whereAreYou |
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 |
Methods inherited from interface metaglue.Agent |
addMonitor, alive, getAgentID, getMetaglueAgentID, getOldLogs, shutdown, startup, whereAreYou |
Field Detail |
public static MetaglueAgent meto
public static String defaultSociety
Constructor Detail |
public MetaglueAgent(AgentID agentID, Catalog cat) throws RemoteException, AgentAlreadyStartedException, FindAgentException, MissingCatalogException
agentID
- agent ID of this Metaglue AgentAgentAlreadyStartedException
- living Metaglue agent
already exists on this VM or agent with same agent ID appears
in CatalogFindAgentException
- problem finding Catalog Agent
(entry found but not actually Catalog Agent, named host for
Catalog Agent missing, remote problems connecting with Catalog
Agent)MissingCatalogException
- Catalog Agent found but inacccessibleMetaglueSystemError
- the URL created to find the
Catalog Agent is badNullPointerException
- (runtime) agentID is nullIllegalArgumentException
- (runtime) agentID does not
have designation of type MetaglueAgentIDpublic MetaglueAgent(AgentID agentID) throws RemoteException, AgentAlreadyStartedException, FindAgentException, MissingCatalogException
Method Detail |
public static void startThreadWatcher()
public static MetaglueAgent getMetaglueAgent(AgentID agentID)
public static MetaglueAgent getVMMetaglueAgent()
public CatalogID getCatalogID() throws RemoteException
getCatalogID
in class AgentAgent
public Catalog getCatalog()
getCatalog
in class AgentAgent
public Agent findAgent(AgentID agentID) throws AgentNotFoundException, AgentStartingException, FindAgentException
agentID
- agent ID of agent to findAgentNotFoundException
- Agent with agent ID not found in CatalogFindAgentException
- problem finding Agent (remote
problems finding Agent in Catalog)public Agent findAgentBlockIfStarting(AgentID agentID) throws AgentNotFoundException, FindAgentException
public Agent findAgentBlocking(AgentID agentID) throws FindAgentException
public Agent findAgentBlocking(AgentID agentID, boolean retry_if_not_found) throws FindAgentException, AgentNotFoundException
public boolean pingMVM(String society, String host)
public void startAgent(AgentID agentID, Object[] parameters) throws AgentNotDefinedException, NativityException, AgentAlreadyStartedException, SpreadException, StartAgentException, RemoteException
startAgent
in interface Metaglue
agentID
- agent ID of agent to startparameters
- list of arguments to constructor of agentAgentNotDefinedException
- no such agent with required
constructor or its stub/skel files has not been createdStartAgentException
- null agentID or remote problems
talking to CatalogNativityException
- problem instantiating agentAgentAlreadyStartedException
- a living agent with
agentID found in CatalogSpreadException
- agent could not spreadpublic static void clearStartLock()
public static StartInfo getStartInfo()
public void shutdownAgent(AgentID agentID) throws RemoteException
shutdownAgent
in interface Metaglue
agentID
- Agent ID of the agent to shut downpublic void setDatabase(boolean local_db, String dbname)
local_db
- Specifies whether to use a local databasedbname
- Specifies a different local database name, if given.
Uses the default name `metaglue' if null.public ManagedConnection getDatabaseConnection()
public static MetaglueAgent _startupMetaglue(boolean loadingCatalog, String society, InetAddress localHost, String catalog, CatalogAgent catalog_pointer, String cname_suggest)
public static ChainingClassLoader _setupClassLoader()
public static void _addClassLoader(ChainingClassLoader cl)
public static void startLocalLogManager(String society, InetAddress localHost)
public static void loadAgents(String[] args)
public static Agent loadAgent(String argString)
public boolean getAcceptAgents()
getAcceptAgents
in interface Metaglue
public void setAcceptAgents(boolean v)
public static String[] setup(String[] args)
public static String[] setup(String[] args, boolean acceptAgents)
acceptAgents
- does this metaglue agent start other agents?public byte[] fetchClassInfo(String name) throws ClassNotFoundException
fetchClassInfo
in interface Metaglue
name
- the name of the class to fetchpublic static void main(String[] args)
args
- {society catalog-host [agents...]}protected Metaglue findOtherMetaglue(String soc) throws RemoteException
protected byte[] fetchSystemResourceData(String rsrc) throws ClassNotFoundException
protected boolean isForwardingClassFetcher()
protected void getStartLock()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |