Home » openjdk-7 » javax » management » relation » [javadoc | source]
javax.management.relation
public interface: Relation [javadoc | source]

All Known Implementing Classes:
    RelationSupport, RelationSupportMBean

This interface has to be implemented by any MBean class expected to represent a relation managed using the Relation Service.

Simple relations, i.e. having only roles, no properties or methods, can be created directly by the Relation Service (represented as RelationSupport objects, internally handled by the Relation Service).

If the user wants to represent more complex relations, involving properties and/or methods, he has to provide his own class implementing the Relation interface. This can be achieved either by inheriting from RelationSupport class, or by implementing the interface (fully or delegation to a RelationSupport object member).

Specifying such user relation class is to introduce properties and/or methods. Those have to be exposed for remote management. So this means that any user relation class must be a MBean class.

Method from javax.management.relation.Relation Summary:
getAllRoles,   getReferencedMBeans,   getRelationId,   getRelationServiceName,   getRelationTypeName,   getRole,   getRoleCardinality,   getRoles,   handleMBeanUnregistration,   retrieveAllRoles,   setRole,   setRoles
Method from javax.management.relation.Relation Detail:
 public RoleResult getAllRoles() throws RelationServiceNotRegisteredException
    Returns all roles present in the relation.
 public Map<String> getReferencedMBeans()
    Retrieves MBeans referenced in the various roles of the relation.
 public String getRelationId()
    Returns relation identifier (used to uniquely identify the relation inside the Relation Service).
 public ObjectName getRelationServiceName()
    Returns ObjectName of the Relation Service handling the relation.
 public String getRelationTypeName()
    Returns name of associated relation type.
 public List<ObjectName> getRole(String roleName) throws IllegalArgumentException, RoleNotFoundException, RelationServiceNotRegisteredException
    Retrieves role value for given role name.

    Checks if the role exists and is readable according to the relation type.

 public Integer getRoleCardinality(String roleName) throws IllegalArgumentException, RoleNotFoundException
    Returns the number of MBeans currently referenced in the given role.
 public RoleResult getRoles(String[] roleNameArray) throws IllegalArgumentException, RelationServiceNotRegisteredException
    Retrieves values of roles with given names.

    Checks for each role if it exists and is readable according to the relation type.

 public  void handleMBeanUnregistration(ObjectName objectName,
    String roleName) throws IllegalArgumentException, RoleNotFoundException, InvalidRoleValueException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException
    Callback used by the Relation Service when a MBean referenced in a role is unregistered.

    The Relation Service will call this method to let the relation take action to reflect the impact of such unregistration.

    BEWARE. the user is not expected to call this method.

    Current implementation is to set the role with its current value (list of ObjectNames of referenced MBeans) without the unregistered one.

 public RoleList retrieveAllRoles()
    Returns all roles in the relation without checking read mode.
 public  void setRole(Role role) throws IllegalArgumentException, RoleNotFoundException, RelationTypeNotFoundException, InvalidRoleValueException, RelationServiceNotRegisteredException, RelationNotFoundException
    Sets the given role.

    Will check the role according to its corresponding role definition provided in relation's relation type

    Will send a notification (RelationNotification with type RELATION_BASIC_UPDATE or RELATION_MBEAN_UPDATE, depending if the relation is a MBean or not).

 public RoleResult setRoles(RoleList roleList) throws IllegalArgumentException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException
    Sets the given roles.

    Will check the role according to its corresponding role definition provided in relation's relation type

    Will send one notification (RelationNotification with type RELATION_BASIC_UPDATE or RELATION_MBEAN_UPDATE, depending if the relation is a MBean or not) per updated role.