|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Observable | +--magenta.GdmoObject | +--magenta.AgentProxy | +--magenta.Agent
class Agent - GdmoObject that forms foundation of Magenta.
Contains the components:
The Agent class does not handle events or have any interface but it contains the foundation upon which these applications can be built. Managers can be implemented by subclassing Agent and overriding the handleEvent method and using the hooks into the Agent's subcomponents provided by getObjectManager, getComManager, etc.
This class can be invoked from the commandline as follows. If hostname and port are not specified, they default to localhost:4444.
usage: java magenta.Agent [hostname:port]
Field Summary | |
private ComManager |
cm
handle to the internal ComManager component |
static java.lang.String |
DEFAULTHOSTPORT
default host:port that agent will listen on |
private EventManager |
em
handle to the internal EventManager component |
private java.lang.String |
hostName
hostname where this agent resides |
private ObjectManager |
om
handle to the internal ObjectManager component |
private int |
port
port this agent will listen on |
Fields inherited from class magenta.AgentProxy |
hostInfo |
Fields inherited from class magenta.GdmoObject |
classCtorCalls, instantiated, name, path |
Fields inherited from class java.util.Observable |
changed, obs |
Constructor Summary | |
Agent(java.lang.String path,
java.lang.String name)
Agent constructor - Instantiate the components of a Magenta agent. |
Method Summary | |
ComManager |
getComManager()
Agent::getComManager - get handle on ComManager. |
EventManager |
getEventManager()
Agent::getEventManager - get handle on EventManager. |
java.lang.String |
getHostName()
Agent::getHostName Access function for hostName member. |
ObjectManager |
getObjectManager()
Agent::getObjectManager - access method for internal ObjectManager component |
int |
getPort()
Agent::getPort - Access function for port member. |
java.lang.String |
handleEvent(java.lang.String eventreport)
Agent::handleEvent - prints out an eventreport. |
void |
log(java.lang.String message)
Agent::log - generic output method for debug related messages. |
static void |
main(java.lang.String[] args)
Agent main routine - The entry point for execution of this object. |
java.lang.String |
setHostInfo(java.lang.String newHostInfo)
Agent::setHostInfo - set the hostname:port and start ComManager. |
Methods inherited from class magenta.AgentProxy |
getHostInfo, toString |
Methods inherited from class magenta.GdmoObject |
get, getName, getPath, set, setInstantiated, setName, updateClassCtorCalls |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static java.lang.String DEFAULTHOSTPORT
private ComManager cm
private EventManager em
private ObjectManager om
private java.lang.String hostName
private int port
Constructor Detail |
public Agent(java.lang.String path, java.lang.String name)
path
- path to the object in the objectmanagername
- name for this object in the objectmanagerMethod Detail |
public java.lang.String setHostInfo(java.lang.String newHostInfo)
setHostInfo
in class AgentProxy
newHostInfo
- string in format hostname:portpublic ComManager getComManager()
public EventManager getEventManager()
public ObjectManager getObjectManager()
public void log(java.lang.String message)
message
- String object to be printed out or logged.public java.lang.String handleEvent(java.lang.String eventreport)
eventreport
- contents of event report.public int getPort()
public java.lang.String getHostName()
public static void main(java.lang.String[] args)
args
- the command-line arguments
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |