An
AgentId
allows for uniquely identifying and localizing an agent throughout the distributed system. It defines variable members describing the identifier and all needed function members to manipulate the structure (creation, serialization, etc).
However before describing the structure of an AgentId we must take into account a second requirement: an agent may be created onto a remote agent server, and the creating entity needs to know the new identifier created for that agent. As agents live in an asynchronous world it is not so easy to get back the identifier from the remote server. We decided instead to make the creating entity responsible for creating the identifier.
The two requirements are then:
- static localization of agents to allow the system to forward notifications ;
- local generation of identifiers for remote agents.
The AgentId is then built of three parts:
- the identification of the agent server hosting the creating agent (from field),
- the identification of the agent server hosting the created agent (to field),
- a stamp, local to the agent server hosting the creating agent (stamp field) ; see AgentIdStamp class.
The three fields form the unique global identifier of the agent, that is two agents may share a common stamp, as long as their from or to fields differ. The to field identifies the agent server hosting the agent, so it is used by the channel to forward notifications to the agent.
@see AgentIdStamp