Home » openjdk-7 » javax » management » relation » [javadoc | source]
javax.management.relation
public class: RelationSupport [javadoc | source]
java.lang.Object
   javax.management.relation.RelationSupport

All Implemented Interfaces:
    RelationSupportMBean, MBeanRegistration

A RelationSupport object is used internally by the Relation Service to represent simple relations (only roles, no properties or methods), with an unlimited number of roles, of any relation type. As internal representation, it is not exposed to the user.

RelationSupport class conforms to the design patterns of standard MBean. So the user can decide to instantiate a RelationSupport object himself as a MBean (as it follows the MBean design patterns), to register it in the MBean Server, and then to add it in the Relation Service.

The user can also, when creating his own MBean relation class, have it extending RelationSupport, to retrieve the implementations of required interfaces (see below).

It is also possible to have in a user relation MBean class a member being a RelationSupport object, and to implement the required interfaces by delegating all to this member.

RelationSupport implements the Relation interface (to be handled by the Relation Service).

It implements also the MBeanRegistration interface to be able to retrieve the MBean Server where it is registered (if registered as a MBean) to access to its Relation Service.

Constructor:
 public RelationSupport(String relationId,
    ObjectName relationServiceName,
    String relationTypeName,
    RoleList list) throws InvalidRoleValueException, IllegalArgumentException 
    Creates a {@code RelationSupport} object.

    This constructor has to be used when the RelationSupport object will be registered as a MBean by the user, or when creating a user relation MBean whose class extends RelationSupport.

    Nothing is done at the Relation Service level, i.e. the {@code RelationSupport} object is not added to the {@code RelationService} and no checks are performed to see if the provided values are correct. The object is always created, EXCEPT if:

    - any of the required parameters is {@code null}.

    - the same name is used for two roles.

    To be handled as a relation, the {@code RelationSupport} object has to be added to the Relation Service using the Relation Service method addRelation().

    Parameters:
    relationId - relation identifier, to identify the relation in the Relation Service.

    Expected to be unique in the given Relation Service.

    relationServiceName - ObjectName of the Relation Service where the relation will be registered.

    This parameter is required as it is the Relation Service that is aware of the definition of the relation type of the given relation, so that will be able to check update operations (set).

    relationTypeName - Name of relation type.

    Expected to have been created in the given Relation Service.

    list - list of roles (Role objects) to initialize the relation. Can be {@code null}.

    Expected to conform to relation info in associated relation type.

    Throws:
    InvalidRoleValueException - if the same name is used for two roles.
    IllegalArgumentException - if any of the required parameters (relation id, relation service ObjectName, or relation type name) is {@code null}.
    exception: InvalidRoleValueException - if the same name is used for two roles.
    exception: IllegalArgumentException - if any of the required parameters (relation id, relation service ObjectName, or relation type name) is {@code null}.
 public RelationSupport(String relationId,
    ObjectName relationServiceName,
    MBeanServer relationServiceMBeanServer,
    String relationTypeName,
    RoleList list) throws InvalidRoleValueException, IllegalArgumentException 
    Creates a {@code RelationSupport} object.

    This constructor has to be used when the user relation MBean implements the interfaces expected to be supported by a relation by delegating to a RelationSupport object.

    This object needs to know the Relation Service expected to handle the relation. So it has to know the MBean Server where the Relation Service is registered.

    According to a limitation, a relation MBean must be registered in the same MBean Server as the Relation Service expected to handle it. So the user relation MBean has to be created and registered, and then the wrapped RelationSupport object can be created within the identified MBean Server.

    Nothing is done at the Relation Service level, i.e. the {@code RelationSupport} object is not added to the {@code RelationService} and no checks are performed to see if the provided values are correct. The object is always created, EXCEPT if:

    - any of the required parameters is {@code null}.

    - the same name is used for two roles.

    To be handled as a relation, the {@code RelationSupport} object has to be added to the Relation Service using the Relation Service method addRelation().

    Parameters:
    relationId - relation identifier, to identify the relation in the Relation Service.

    Expected to be unique in the given Relation Service.

    relationServiceName - ObjectName of the Relation Service where the relation will be registered.

    This parameter is required as it is the Relation Service that is aware of the definition of the relation type of the given relation, so that will be able to check update operations (set).

    relationServiceMBeanServer - MBean Server where the wrapping MBean is or will be registered.

    Expected to be the MBean Server where the Relation Service is or will be registered.

    relationTypeName - Name of relation type.

    Expected to have been created in the given Relation Service.

    list - list of roles (Role objects) to initialize the relation. Can be {@code null}.

    Expected to conform to relation info in associated relation type.

    Throws:
    InvalidRoleValueException - if the same name is used for two roles.
    IllegalArgumentException - if any of the required parameters (relation id, relation service ObjectName, relation service MBeanServer, or relation type name) is {@code null}.
    exception: InvalidRoleValueException - if the same name is used for two roles.
    exception: IllegalArgumentException - if any of the required parameters (relation id, relation service ObjectName, relation service MBeanServer, or relation type name) is {@code null}.
Method from javax.management.relation.RelationSupport Summary:
getAllRoles,   getAllRolesInt,   getReferencedMBeans,   getRelationId,   getRelationServiceName,   getRelationTypeName,   getRole,   getRoleCardinality,   getRoleInt,   getRoles,   getRolesInt,   handleMBeanUnregistration,   handleMBeanUnregistrationInt,   isInRelationService,   postDeregister,   postRegister,   preDeregister,   preRegister,   retrieveAllRoles,   setRelationServiceManagementFlag,   setRole,   setRoleInt,   setRoles,   setRolesInt
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.management.relation.RelationSupport Detail:
 public RoleResult getAllRoles() throws RelationServiceNotRegisteredException 
    Returns all roles present in the relation.
 RoleResult getAllRolesInt(boolean relationServCallFlg,
    RelationService relationServ) throws IllegalArgumentException, RelationServiceNotRegisteredException 
 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.
 Object getRoleInt(String roleName,
    boolean relationServCallFlg,
    RelationService relationServ,
    boolean multiRoleFlg) throws IllegalArgumentException, RoleNotFoundException, RelationServiceNotRegisteredException 
 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.

 RoleResult getRolesInt(String[] roleNameArray,
    boolean relationServCallFlg,
    RelationService relationServ) throws IllegalArgumentException, RelationServiceNotRegisteredException 
 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.

  void handleMBeanUnregistrationInt(ObjectName objectName,
    String roleName,
    boolean relationServCallFlg,
    RelationService relationServ) throws IllegalArgumentException, RoleNotFoundException, InvalidRoleValueException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException 
 public Boolean isInRelationService() 
    Returns an internal flag specifying if the object is still handled by the Relation Service.
 public  void postDeregister() 
 public  void postRegister(Boolean registrationDone) 
 public  void preDeregister() throws Exception 
 public ObjectName preRegister(MBeanServer server,
    ObjectName name) throws Exception 
 public RoleList retrieveAllRoles() 
    Returns all roles in the relation without checking read mode.
 public  void setRelationServiceManagementFlag(Boolean flag) throws IllegalArgumentException 
 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).

 Object setRoleInt(Role aRole,
    boolean relationServCallFlg,
    RelationService relationServ,
    boolean multiRoleFlg) throws IllegalArgumentException, RoleNotFoundException, InvalidRoleValueException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException 
 public RoleResult setRoles(RoleList list) 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.

 RoleResult setRolesInt(RoleList list,
    boolean relationServCallFlg,
    RelationService relationServ) throws IllegalArgumentException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException