The Relation service enables you to manage relations and provides query mechanisms to retrieve these relations. The Relation service is an MBean which is accessed and managed both remotely, in the remote management application, and locally. It enables you to create, access, and delete relations and create, retrieve, and delete relation types, whilst allowing you to maintain the consistency of relations where referenced MBeans are deregistered. The Relation service expects a relation to be managed by it to support the Relation interface javax.management.relation.Relation. The Relation service also expects a relation type to support the Relationtype interface javax.management.relation.RelationType. The Relation service sends a notification every time a relation is created, accessed or deleted.
You can decide to create a relation as an MBean. However, a relation does not necessarily have to be an MBean. There are two ways you can create a relation:
Create a simple relation directly in the Relation service
It is not an MBean.
It is automatically added to the Relation service.
Create the relation.
Register the relation MBean in the MBean server.
Add the relation MBean to the Relation service, so that it will be considered a relation.
Using the Relation service, you can:
Retrieve relations between MBeans.
Retrieve specific roles within a relation: roles are lists of MBeans in a relation, eachidentified by an object name
Define new relations.
Remove relations.
A relation can be represented in two ways:
As a separate whole object, referencing MBeans in roles of the relation.
The roles of the relation can be directly part of MBeans involved in the relation, referencing other involved MBeans.
Name of the role.
Cardinality of the role.
Class name of the MBean to be referenced in each role.
In the Java Dynamic Management Kit, a relation is defined by a set of roles. The MBeans involved in a relation are referred to within the relationship by their object names.