Design ObjectivesThe design objectives can be summarised as follows:
System ArchitectureThe Jacomma engine lives inside a standard Java Virtual Machine, and logically sits on top of the ICM communication infrastrastructure. The overall system architecture, including JPython interpreters and April Virtual Machines is illustrated in the following figure: The Jacomma FrameworkAgent EnvironmentThe agent environment is accessible through a facade-interface to the framework components: the AgentManager. This is a singleton entity, which spawns and manages local agents and their threads, and provides transparent access to the ICMfunctionality. In relation to the reactive information agent model, it provides the environment abstraction for agents. The interface and the methods provided by it are illustrated in the figure below. The unique instance of the object is bound to a particular implementation at run-time, once the JVM loads the interface definition. Agent ModelBehavior is disembodied from the agent and offered as a set of primitive behavioral components. The agent body or container manifests itself through the Agent interface, while the behavior is abstracted into instances of the Agent.MessageHandler interface. The Agent interface contains internally the message queue and the necessary links for to the communication infrastructure. Message dispatching occurs in a dispatching thread that is exclusively owned by the agent.The Agent also offers a Visitor interface to the contents of the message queue -- the pending messages, where a related entity can obtain exclusive access to the queue. The actual implementation of the interface is irrelevant -- it is internal to the engine implementation and not publically accessible to jacomma applications. Applications need only focus on implementing behavioral elements and not be troubled with engine implementation details. Agent LifetimeHow do we create, initialize and monitor agents? In terms of application development there must be an entity that requests the initial creation of an agent.In addition, since agent behavior is decoupled from its interface, this entity is responsible for populating the agent with its initial behavioral components and responding to events related to the agent lifetime.This role is played by the AgentObserver An instance of this interface is required for every agent\footnote{A particular instance may observe more than one agent}: it receives events, dispatched by the engine, related to the agent lifetime. As an example, the interactions occuring at agent creation and initialization are illustrated below Apart from local agents, an observer can also monitor and receive events related to remote agents. In this setting however, the notification is asynchronous and is based from information provided by the ICM infrastructure. Events are instance of the jacomma.platform.core.Agent (local or managed object events) and jacomma.platform.core.RemoteAgentEvent (remotely monitored agent events). The interface also callbacks related to the lifetime of the engine itself. When there is an engine shutdown, disconnect or reconnect event, the observer of each local agent is notified. The observer can choose its strategy and determine what should happen to the agent: the agent could disconnect temporarily and later reconnect, die or migrate to a different host to continue its execution. Message ReactionActivation of agent behavioris linked with incoming messages through message patterns -- which in turn express the necessary message conditions. All communication is in terms of instance of the jacomma.icm.type.Message class. This class abstracts the \snippet{ICM} message structure. Message patterns are expressed as instances of the jacomma.platform.core.MessagePattern class, created through the factory methods of the class. Engine InternalsThe engine internals contains implementations for the interfaces of the jacomma.platform.core package and auxiliary classes that are necessary for making the engine work. These include ICM connection buffers, message dispatchers and a message router, that handles communication between local agents -- without requiring messages to be passed through the ICM communication server. ICM bindings for Java are defined and implemented in the jacomma.icm package hierarchy. They define an I/O stack which is dynamically configurable, and makes object serialization to the ICM encoding format completely transparent. |
|
|