Agent Group Proxies

<This functionality is not available in the Freeware version of Concordia>

The AgentGroupProxy object acts as an agent's proxy for an agent group. It maintains a persistent reference to its associated AgentGroupImpl object. It obtains the reference via a call to a CachedObjectFactory. This is an interface implemented by CachedObjectFactoryImpl, which functions as an object factory that caches all active objects it has created.

The CachedObjectFactoryImpl is a distributed object that may be used to create ordinary or distributed objects. When an agent group proxy is unable to communicate with its associated agent group, it may request the cached object factory to re-create the agent group. The agent group, its proxy and the object factory interact in the following manner:

1. An application obtains a reference to a CachedObjectFactory, either by instantiating a new CachedObjectFactoryImpl object or by looking one up via the Directory Manager or RMI Registry (assuming the object factory has registered itself with the Directory Manager or the Registry).

2. An object (e.g., an agent) creates an agent group proxy by calling AgentGroupProxy's static makeProxy method, passing it: the object factory reference, a Class object representing an agent group derived from AgentGroupImpl and, potentially, the group's name.

3. The AgentGroupProxy requests a reference to the AgentGroupImpl from the object factory.

4. The CachedObjectFactory looks up the AgentGroupImpl in its cache by name and returns it, if it finds it. Otherwise, it creates and caches a new instance before returning it.

5. The application sends requests to the proxy, instead of directly to the agent group. If the agent group fails, the proxy initiates the re-creation of the AgentGroupImpl by requesting the factory to reconstruct it. (The CachedObjectFactory serializes its re-creation requests and uses other mechanisms to avoid creating duplicates. )