Addresses
Three types of addresses are defined:
- agent addresses,
- component addresses,
- node addresses.
Agent and component addresses share a common interface — IAddress
so their use by the end user is unified.
All addresses should be immutable through the entire lifetime of the system.
Agents and components addresses
Both agent and component addresses consists of two elements:
- some identifier (a name in the form of a string in case of a component and UUID for an agent)
- their parent node address (the node they were firstly registered at).
Moreover, agent addresses allows to use a user-friendly name that is meant to be presented to (and partially provided by) the end-user.
The string representation of the address is defined as a name@nodeAddress
for the default implementation of addresses. However, a name does not have to be unique in the case of agents. To get round this problem an agent interface requires an existence of the method that can create an unique string representation (toUniqueString()
). In the default implementation it has a following form: UUID@nodeAddress
.
The user should not provide a final "user-friendly name" but only a template of it as a string. A user-friendly name is generated from this template by a name provider. Although a default name provider currently generates unique names it is neither required nor guaranteed to be true in future.
The uniqueness of addresses within a node is guaranteed on the base of:
- UUID for agent addresses,
- a requirement that there cannot be two components with the same name in one node for component addresses.
Global uniqueness (global to all nodes) is based on a qualification of such addresses with a node address.
Agent addresses are created by a single entity called address provider. Component addresses on the other hand should be constructed by components themselves in case they are needed.
Nodes addresses
A node address interface does not distinguish any parts but the actual implementation contains two separate elements: a "local" part and a hostname. The local part is usually a process ID of the current JVM (it is guaranteed to be unique), however this is implementation dependent and was only tested to work with HotSpot and OpenJDK. In the case when PID in unavailable, a generated ID is used as a fallback value.
The node address is created by node address provider on demand.
Address providers
The agent address generation within a node is provided by a single address provider. Its interface is IAgentAddressProvider
and default implementation is DefaultAgentAddressProvider
.
The address provider uses a name provider INameProvider
to generate user-friendly names from templates.
The figure below shows the overview of the default implementations structure for these interfaces.
Attachments:





