Java Reference
In-Depth Information
Relation type
The relation type is an object that acts as a template for relations. It contains a
list of role information objects that describe the members of a relation. The rela-
tion service uses relation types to validate relations by examining the relation
type role information and comparing it to the role values in the relation. The
relation type is defined by the class
javax.management.relation.RelationType
.
Role information
As we mentioned earlier, role information objects are contained within
Relation-
Type
objects. The role information distinctly defines a member of a relation. An
instance of the
RoleInfo
class contains a unique name of a role as well as the mul-
tiplicity of the MBeans for that role. The role name cannot be null and must be
unique for a given relation type. The multiplicity defines the number of MBeans
that can be referenced by the role.
For example, a
FamilyCar
relation type might have a
RoleInfo
object
wheels
with a multiplicity of four
Wheel
MBeans, whereas a
Tricycle
relation type would
have a multiplicity of three
Wheel
MBeans. In addition, a
CookieJar
relation type
might have a multiplicity of 0 to 100
Cookie
MBeans, depending on how hungry
you were.
A
RoleInfo
object also specifies two more constraints for a relation type: the
class name of the MBeans that can act as a role in a relation of the type that con-
tains the
RoleInfo
object, and the access mode of the role. The access mode
determines the read and write permissions of the role.
Relation
Relations are represented by the
Relation
class. Every relation is an object rep-
resenting an instance of a particular relation type (not an actual instance of the
RelationType
class, but the
Relation
class). The relation is an object, registered
in the relation service, that defines an association between existing MBeans in
an agent. A relation can reference several different classes of MBeans and
present them in such a way that the user can clearly understand the association
between them.
MBeans participating in a relation are said to be a
role
of a relation. A role is
validated against the
RoleInfo
object of the
Relation
's relation type. As we men-
tioned earlier, a relation is either
internal
or
external
. An external relation
exposes methods that can operate of any
number
of its member MBeans; this
functionality provides a powerful way to manage your enterprise's collection of
existing MBeans.