next up previous contents
Next: The Output Framework Up: AgentSystem Class Previous: Initializing   Contents

Resource maintaining

One of the most important parts are the methods to let a service proxy register its interface/-s in the System and of course to let them be unregistered. When a service (System Agent) registers a proxy in the platform, it calls the method registerService(Object proxy) which itself calls the method getInterfaces(Class cl) to get all the interfaces that are implemented by the proxy. Only the ProxyIFace, the Serializable and the Remote interfaces are ignored since they are basic interfaces. All others are stored in the proxies OTMHashtable with the names of the interfaces (if the proxy had more then one interface implemented) as key and the proxy as value. For example the RMICommProxy implements the interface RMIAgentCommIFace which is a sub interface of the AgentCommIFace. So the RMIAgentCommProxy implements two interfaces and will be registered two times with each interface name as key. The unregistering is much more easy because the OTMHashtable provides a method to remove all entries with a given value which is in this case the proxy object.

When ever an Agent or System Agent requires (through their helpers) a proxy it calls the getProxy(String proxyinterface, AgentID agentid) method with its ID for security checks. It gets then all proxies which are providing the given interface back. For examples a request for the interface
``tagents.sysagent.communication.AgentCommIFace'' gives you all the communication proxies back. That could be the PLSAgentCommProxy and the RMIAgentCommProxy.


next up previous contents
Next: The Output Framework Up: AgentSystem Class Previous: Initializing   Contents
Thomas Letsch 2001-02-21