javax.management.relation
Class RelationSupport

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.management.relation.RelationSupport
All Implemented Interfaces:
MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration , Relation sample code for javax.management.relation.Relation definition code for javax.management.relation.Relation , RelationSupportMBean sample code for javax.management.relation.RelationSupportMBean definition code for javax.management.relation.RelationSupportMBean

public class RelationSupport
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements RelationSupportMBean sample code for javax.management.relation.RelationSupportMBean definition code for javax.management.relation.RelationSupportMBean , MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.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.

Since:
1.5

Constructor Summary
RelationSupport sample code for javax.management.relation.RelationSupport.RelationSupport(java.lang.String, javax.management.ObjectName, javax.management.MBeanServer, java.lang.String, javax.management.relation.RoleList) definition code for javax.management.relation.RelationSupport.RelationSupport(java.lang.String, javax.management.ObjectName, javax.management.MBeanServer, java.lang.String, javax.management.relation.RoleList) (String sample code for java.lang.String definition code for java.lang.String  theRelId, ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  theRelServiceName, MBeanServer sample code for javax.management.MBeanServer definition code for javax.management.MBeanServer  theRelServiceMBeanServer, String sample code for java.lang.String definition code for java.lang.String  theRelTypeName, RoleList sample code for javax.management.relation.RoleList definition code for javax.management.relation.RoleList  theRoleList)
          Creates object.
RelationSupport sample code for javax.management.relation.RelationSupport.RelationSupport(java.lang.String, javax.management.ObjectName, java.lang.String, javax.management.relation.RoleList) definition code for javax.management.relation.RelationSupport.RelationSupport(java.lang.String, javax.management.ObjectName, java.lang.String, javax.management.relation.RoleList) (String sample code for java.lang.String definition code for java.lang.String  theRelId, ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  theRelServiceName, String sample code for java.lang.String definition code for java.lang.String  theRelTypeName, RoleList sample code for javax.management.relation.RoleList definition code for javax.management.relation.RoleList  theRoleList)
          Creates object.
 
Method Summary
 RoleResult sample code for javax.management.relation.RoleResult definition code for javax.management.relation.RoleResult getAllRoles sample code for javax.management.relation.RelationSupport.getAllRoles() definition code for javax.management.relation.RelationSupport.getAllRoles() ()
          Returns all roles present in the relation.
 Map sample code for java.util.Map definition code for java.util.Map getReferencedMBeans sample code for javax.management.relation.RelationSupport.getReferencedMBeans() definition code for javax.management.relation.RelationSupport.getReferencedMBeans() ()
          Retrieves MBeans referenced in the various roles of the relation.
 String sample code for java.lang.String definition code for java.lang.String getRelationId sample code for javax.management.relation.RelationSupport.getRelationId() definition code for javax.management.relation.RelationSupport.getRelationId() ()
          Returns relation identifier (used to uniquely identify the relation inside the Relation Service).
 ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName getRelationServiceName sample code for javax.management.relation.RelationSupport.getRelationServiceName() definition code for javax.management.relation.RelationSupport.getRelationServiceName() ()
          Returns ObjectName of the Relation Service handling the relation.
 String sample code for java.lang.String definition code for java.lang.String getRelationTypeName sample code for javax.management.relation.RelationSupport.getRelationTypeName() definition code for javax.management.relation.RelationSupport.getRelationTypeName() ()
          Returns name of associated relation type.
 List sample code for java.util.List definition code for java.util.List getRole sample code for javax.management.relation.RelationSupport.getRole(java.lang.String) definition code for javax.management.relation.RelationSupport.getRole(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  theRoleName)
          Retrieves role value for given role name.
 Integer sample code for java.lang.Integer definition code for java.lang.Integer getRoleCardinality sample code for javax.management.relation.RelationSupport.getRoleCardinality(java.lang.String) definition code for javax.management.relation.RelationSupport.getRoleCardinality(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  theRoleName)
          Returns the number of MBeans currently referenced in the given role.
 RoleResult sample code for javax.management.relation.RoleResult definition code for javax.management.relation.RoleResult getRoles sample code for javax.management.relation.RelationSupport.getRoles(java.lang.String[]) definition code for javax.management.relation.RelationSupport.getRoles(java.lang.String[]) (String sample code for java.lang.String definition code for java.lang.String [] theRoleNameArray)
          Retrieves values of roles with given names.
 void handleMBeanUnregistration sample code for javax.management.relation.RelationSupport.handleMBeanUnregistration(javax.management.ObjectName, java.lang.String) definition code for javax.management.relation.RelationSupport.handleMBeanUnregistration(javax.management.ObjectName, java.lang.String) (ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  theObjName, String sample code for java.lang.String definition code for java.lang.String  theRoleName)
          Callback used by the Relation Service when a MBean referenced in a role is unregistered.
 Boolean sample code for java.lang.Boolean definition code for java.lang.Boolean isInRelationService sample code for javax.management.relation.RelationSupport.isInRelationService() definition code for javax.management.relation.RelationSupport.isInRelationService() ()
          Returns an internal flag specifying if the object is still handled by the Relation Service.
 void postDeregister sample code for javax.management.relation.RelationSupport.postDeregister() definition code for javax.management.relation.RelationSupport.postDeregister() ()
          Allows the MBean to perform any operations needed after having been unregistered in the MBean server.
 void postRegister sample code for javax.management.relation.RelationSupport.postRegister(java.lang.Boolean) definition code for javax.management.relation.RelationSupport.postRegister(java.lang.Boolean) (Boolean sample code for java.lang.Boolean definition code for java.lang.Boolean  registrationDone)
          Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.
 void preDeregister sample code for javax.management.relation.RelationSupport.preDeregister() definition code for javax.management.relation.RelationSupport.preDeregister() ()
          Allows the MBean to perform any operations it needs before being unregistered by the MBean server.
 ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName preRegister sample code for javax.management.relation.RelationSupport.preRegister(javax.management.MBeanServer, javax.management.ObjectName) definition code for javax.management.relation.RelationSupport.preRegister(javax.management.MBeanServer, javax.management.ObjectName) (MBeanServer sample code for javax.management.MBeanServer definition code for javax.management.MBeanServer  server, ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  name)
          Allows the MBean to perform any operations it needs before being registered in the MBean server.
 RoleList sample code for javax.management.relation.RoleList definition code for javax.management.relation.RoleList retrieveAllRoles sample code for javax.management.relation.RelationSupport.retrieveAllRoles() definition code for javax.management.relation.RelationSupport.retrieveAllRoles() ()
          Returns all roles in the relation without checking read mode.
 void setRelationServiceManagementFlag sample code for javax.management.relation.RelationSupport.setRelationServiceManagementFlag(java.lang.Boolean) definition code for javax.management.relation.RelationSupport.setRelationServiceManagementFlag(java.lang.Boolean) (Boolean sample code for java.lang.Boolean definition code for java.lang.Boolean  theFlg)
          Specifies whether this relation is handled by the Relation Service.
 void setRole sample code for javax.management.relation.RelationSupport.setRole(javax.management.relation.Role) definition code for javax.management.relation.RelationSupport.setRole(javax.management.relation.Role) (Role sample code for javax.management.relation.Role definition code for javax.management.relation.Role  theRole)
          Sets the given role.
 RoleResult sample code for javax.management.relation.RoleResult definition code for javax.management.relation.RoleResult setRoles sample code for javax.management.relation.RelationSupport.setRoles(javax.management.relation.RoleList) definition code for javax.management.relation.RelationSupport.setRoles(javax.management.relation.RoleList) (RoleList sample code for javax.management.relation.RoleList definition code for javax.management.relation.RoleList  theRoleList)
          Sets the given roles.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

RelationSupport sample code for javax.management.relation.RelationSupport(java.lang.String, javax.management.ObjectName, java.lang.String, javax.management.relation.RoleList) definition code for javax.management.relation.RelationSupport(java.lang.String, javax.management.ObjectName, java.lang.String, javax.management.relation.RoleList)

public RelationSupport(String sample code for java.lang.String definition code for java.lang.String  theRelId,
                       ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  theRelServiceName,
                       String sample code for java.lang.String definition code for java.lang.String  theRelTypeName,
                       RoleList sample code for javax.management.relation.RoleList definition code for javax.management.relation.RoleList  theRoleList)
                throws InvalidRoleValueException sample code for javax.management.relation.InvalidRoleValueException definition code for javax.management.relation.InvalidRoleValueException ,
                       IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException 
Creates 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 those class extends RelationSupport.

Nothing is done at the Relation Service level, i.e. the RelationSupport object is not added, and no check if the provided values are correct. The object is always created, EXCEPT if:

- one mandatory parameter is not provided

- the same name is used for two roles.

To be handled as a relation, the object has then to be added in the Relation Service using Relation Service method addRelation().

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

Expected to be unique in the given Relation Service.

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

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

theRelTypeName - Name of relation type.

Expected to have been created in given Relation Service.

theRoleList - list of roles (Role objects) to initialised the relation. Can be null.

Expected to conform to relation info in associated relation type.

Throws:
InvalidRoleValueException sample code for javax.management.relation.InvalidRoleValueException definition code for javax.management.relation.InvalidRoleValueException - if the same name is used for two roles.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if a required value (Relation Service Object Name, etc.) is not provided as parameter.

RelationSupport sample code for javax.management.relation.RelationSupport(java.lang.String, javax.management.ObjectName, javax.management.MBeanServer, java.lang.String, javax.management.relation.RoleList) definition code for javax.management.relation.RelationSupport(java.lang.String, javax.management.ObjectName, javax.management.MBeanServer, java.lang.String, javax.management.relation.RoleList)

public RelationSupport(String sample code for java.lang.String definition code for java.lang.String  theRelId,
                       ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  theRelServiceName,
                       MBeanServer sample code for javax.management.MBeanServer definition code for javax.management.MBeanServer  theRelServiceMBeanServer,
                       String sample code for java.lang.String definition code for java.lang.String  theRelTypeName,
                       RoleList sample code for javax.management.relation.RoleList definition code for javax.management.relation.RoleList  theRoleList)
                throws InvalidRoleValueException sample code for javax.management.relation.InvalidRoleValueException definition code for javax.management.relation.InvalidRoleValueException ,
                       IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException 
Creates 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 with identified MBean Server.

Nothing is done at the Relation Service level, i.e. the RelationSupport object is not added, and no check if the provided values are correct. The object is always created, EXCEPT if:

- one required parameter is not provided

- the same name is used for two roles.

To be handled as a relation, the object has then to be added in the Relation Service using the Relation Service method addRelation().

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

Expected to be unique in the given Relation Service.

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

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

theRelServiceMBeanServer - 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.

theRelTypeName - Name of relation type.

Expected to have been created in given Relation Service.

theRoleList - list of roles (Role objects) to initialised the relation. Can be null.

Expected to conform to relation info in associated relation type.

Throws:
InvalidRoleValueException sample code for javax.management.relation.InvalidRoleValueException definition code for javax.management.relation.InvalidRoleValueException - if the same name is used for two roles.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if a required value (Relation Service Object Name, etc.) is not provided as parameter.
Method Detail

getRole sample code for javax.management.relation.RelationSupport.getRole(java.lang.String) definition code for javax.management.relation.RelationSupport.getRole(java.lang.String)

public List sample code for java.util.List definition code for java.util.List  getRole(String sample code for java.lang.String definition code for java.lang.String  theRoleName)
             throws IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException ,
                    RoleNotFoundException sample code for javax.management.relation.RoleNotFoundException definition code for javax.management.relation.RoleNotFoundException ,
                    RelationServiceNotRegisteredException sample code for javax.management.relation.RelationServiceNotRegisteredException definition code for javax.management.relation.RelationServiceNotRegisteredException 
Retrieves role value for given role name.

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

Specified by:
getRole sample code for javax.management.relation.Relation.getRole(java.lang.String) definition code for javax.management.relation.Relation.getRole(java.lang.String) in interface Relation sample code for javax.management.relation.Relation definition code for javax.management.relation.Relation
Parameters:
theRoleName - name of role
Returns:
the ArrayList of ObjectName objects being the role value
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if null role name
RoleNotFoundException sample code for javax.management.relation.RoleNotFoundException definition code for javax.management.relation.RoleNotFoundException - if:

- there is no role with given name

- the role is not readable.

RelationServiceNotRegisteredException sample code for javax.management.relation.RelationServiceNotRegisteredException definition code for javax.management.relation.RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server
See Also:
setRole(javax.management.relation.Role) sample code for javax.management.relation.RelationSupport.setRole(javax.management.relation.Role) definition code for javax.management.relation.RelationSupport.setRole(javax.management.relation.Role)

getRoles sample code for javax.management.relation.RelationSupport.getRoles(java.lang.String[]) definition code for javax.management.relation.RelationSupport.getRoles(java.lang.String[])

public RoleResult sample code for javax.management.relation.RoleResult definition code for javax.management.relation.RoleResult  getRoles(String sample code for java.lang.String definition code for java.lang.String [] theRoleNameArray)
                    throws IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException ,
                           RelationServiceNotRegisteredException sample code for javax.management.relation.RelationServiceNotRegisteredException definition code for javax.management.relation.RelationServiceNotRegisteredException 
Retrieves values of roles with given names.

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

Specified by:
getRoles sample code for javax.management.relation.Relation.getRoles(java.lang.String[]) definition code for javax.management.relation.Relation.getRoles(java.lang.String[]) in interface Relation sample code for javax.management.relation.Relation definition code for javax.management.relation.Relation
Parameters:
theRoleNameArray - array of names of roles to be retrieved
Returns:
a RoleResult object, including a RoleList (for roles successfully retrieved) and a RoleUnresolvedList (for roles not retrieved).
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if null role name
RelationServiceNotRegisteredException sample code for javax.management.relation.RelationServiceNotRegisteredException definition code for javax.management.relation.RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server
See Also:
setRoles(javax.management.relation.RoleList) sample code for javax.management.relation.RelationSupport.setRoles(javax.management.relation.RoleList) definition code for javax.management.relation.RelationSupport.setRoles(javax.management.relation.RoleList)

getAllRoles sample code for javax.management.relation.RelationSupport.getAllRoles() definition code for javax.management.relation.RelationSupport.getAllRoles()

public RoleResult sample code for javax.management.relation.RoleResult definition code for javax.management.relation.RoleResult  getAllRoles()
                       throws RelationServiceNotRegisteredException sample code for javax.management.relation.RelationServiceNotRegisteredException definition code for javax.management.relation.RelationServiceNotRegisteredException 
Returns all roles present in the relation.

Specified by:
getAllRoles sample code for javax.management.relation.Relation.getAllRoles() definition code for javax.management.relation.Relation.getAllRoles() in interface Relation sample code for javax.management.relation.Relation definition code for javax.management.relation.Relation
Returns:
a RoleResult object, including a RoleList (for roles successfully retrieved) and a RoleUnresolvedList (for roles not readable).
Throws:
RelationServiceNotRegisteredException sample code for javax.management.relation.RelationServiceNotRegisteredException definition code for javax.management.relation.RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server

retrieveAllRoles sample code for javax.management.relation.RelationSupport.retrieveAllRoles() definition code for javax.management.relation.RelationSupport.retrieveAllRoles()

public RoleList sample code for javax.management.relation.RoleList definition code for javax.management.relation.RoleList  retrieveAllRoles()
Returns all roles in the relation without checking read mode.

Specified by:
retrieveAllRoles sample code for javax.management.relation.Relation.retrieveAllRoles() definition code for javax.management.relation.Relation.retrieveAllRoles() in interface Relation sample code for javax.management.relation.Relation definition code for javax.management.relation.Relation
Returns:
a RoleList

getRoleCardinality sample code for javax.management.relation.RelationSupport.getRoleCardinality(java.lang.String) definition code for javax.management.relation.RelationSupport.getRoleCardinality(java.lang.String)

public Integer sample code for java.lang.Integer definition code for java.lang.Integer  getRoleCardinality(String sample code for java.lang.String definition code for java.lang.String  theRoleName)
                           throws IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException ,
                                  RoleNotFoundException sample code for javax.management.relation.RoleNotFoundException definition code for javax.management.relation.RoleNotFoundException 
Returns the number of MBeans currently referenced in the given role.

Specified by:
getRoleCardinality sample code for javax.management.relation.Relation.getRoleCardinality(java.lang.String) definition code for javax.management.relation.Relation.getRoleCardinality(java.lang.String) in interface Relation sample code for javax.management.relation.Relation definition code for javax.management.relation.Relation
Parameters:
theRoleName - name of role
Returns:
the number of currently referenced MBeans in that role
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if null role name
RoleNotFoundException sample code for javax.management.relation.RoleNotFoundException definition code for javax.management.relation.RoleNotFoundException - if there is no role with given name

setRole sample code for javax.management.relation.RelationSupport.setRole(javax.management.relation.Role) definition code for javax.management.relation.RelationSupport.setRole(javax.management.relation.Role)

public void setRole(Role sample code for javax.management.relation.Role definition code for javax.management.relation.Role  theRole)
             throws IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException ,
                    RoleNotFoundException sample code for javax.management.relation.RoleNotFoundException definition code for javax.management.relation.RoleNotFoundException ,
                    RelationTypeNotFoundException sample code for javax.management.relation.RelationTypeNotFoundException definition code for javax.management.relation.RelationTypeNotFoundException ,
                    InvalidRoleValueException sample code for javax.management.relation.InvalidRoleValueException definition code for javax.management.relation.InvalidRoleValueException ,
                    RelationServiceNotRegisteredException sample code for javax.management.relation.RelationServiceNotRegisteredException definition code for javax.management.relation.RelationServiceNotRegisteredException ,
                    RelationNotFoundException sample code for javax.management.relation.RelationNotFoundException definition code for javax.management.relation.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).

Specified by:
setRole sample code for javax.management.relation.Relation.setRole(javax.management.relation.Role) definition code for javax.management.relation.Relation.setRole(javax.management.relation.Role) in interface Relation sample code for javax.management.relation.Relation definition code for javax.management.relation.Relation
Parameters:
theRole - role to be set (name and new value)
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if null role
RoleNotFoundException sample code for javax.management.relation.RoleNotFoundException definition code for javax.management.relation.RoleNotFoundException - if the role is not writable (no test on the write access mode performed when initialising the role)
InvalidRoleValueException sample code for javax.management.relation.InvalidRoleValueException definition code for javax.management.relation.InvalidRoleValueException - if value provided for role is not valid, i.e.:

- the number of referenced MBeans in given value is less than expected minimum degree

- the number of referenced MBeans in provided value exceeds expected maximum degree

- one referenced MBean in the value is not an Object of the MBean class expected for that role

- a MBean provided for that role does not exist

RelationServiceNotRegisteredException sample code for javax.management.relation.RelationServiceNotRegisteredException definition code for javax.management.relation.RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server
RelationTypeNotFoundException sample code for javax.management.relation.RelationTypeNotFoundException definition code for javax.management.relation.RelationTypeNotFoundException - if the relation type has not been declared in the Relation Service
RelationNotFoundException sample code for javax.management.relation.RelationNotFoundException definition code for javax.management.relation.RelationNotFoundException - if the relation has not been added in the Relation Service.
See Also:
getRole(java.lang.String) sample code for javax.management.relation.RelationSupport.getRole(java.lang.String) definition code for javax.management.relation.RelationSupport.getRole(java.lang.String)

setRoles sample code for javax.management.relation.RelationSupport.setRoles(javax.management.relation.RoleList) definition code for javax.management.relation.RelationSupport.setRoles(javax.management.relation.RoleList)

public RoleResult sample code for javax.management.relation.RoleResult definition code for javax.management.relation.RoleResult  setRoles(RoleList sample code for javax.management.relation.RoleList definition code for javax.management.relation.RoleList  theRoleList)
                    throws IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException ,
                           RelationServiceNotRegisteredException sample code for javax.management.relation.RelationServiceNotRegisteredException definition code for javax.management.relation.RelationServiceNotRegisteredException ,
                           RelationTypeNotFoundException sample code for javax.management.relation.RelationTypeNotFoundException definition code for javax.management.relation.RelationTypeNotFoundException ,
                           RelationNotFoundException sample code for javax.management.relation.RelationNotFoundException definition code for javax.management.relation.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.

Specified by:
setRoles sample code for javax.management.relation.Relation.setRoles(javax.management.relation.RoleList) definition code for javax.management.relation.Relation.setRoles(javax.management.relation.RoleList) in interface Relation sample code for javax.management.relation.Relation definition code for javax.management.relation.Relation
Parameters:
theRoleList - list of roles to be set
Returns:
a RoleResult object, including a RoleList (for roles successfully set) and a RoleUnresolvedList (for roles not set).
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if null role name
RelationServiceNotRegisteredException sample code for javax.management.relation.RelationServiceNotRegisteredException definition code for javax.management.relation.RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server
RelationTypeNotFoundException sample code for javax.management.relation.RelationTypeNotFoundException definition code for javax.management.relation.RelationTypeNotFoundException - if the relation type has not been declared in the Relation Service.
RelationNotFoundException sample code for javax.management.relation.RelationNotFoundException definition code for javax.management.relation.RelationNotFoundException - if the relation MBean has not been added in the Relation Service.
See Also:
getRoles(java.lang.String[]) sample code for javax.management.relation.RelationSupport.getRoles(java.lang.String[]) definition code for javax.management.relation.RelationSupport.getRoles(java.lang.String[])

handleMBeanUnregistration sample code for javax.management.relation.RelationSupport.handleMBeanUnregistration(javax.management.ObjectName, java.lang.String) definition code for javax.management.relation.RelationSupport.handleMBeanUnregistration(javax.management.ObjectName, java.lang.String)

public void handleMBeanUnregistration(ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  theObjName,
                                      String sample code for java.lang.String definition code for java.lang.String  theRoleName)
                               throws IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException ,
                                      RoleNotFoundException sample code for javax.management.relation.RoleNotFoundException definition code for javax.management.relation.RoleNotFoundException ,
                                      InvalidRoleValueException sample code for javax.management.relation.InvalidRoleValueException definition code for javax.management.relation.InvalidRoleValueException ,
                                      RelationServiceNotRegisteredException sample code for javax.management.relation.RelationServiceNotRegisteredException definition code for javax.management.relation.RelationServiceNotRegisteredException ,
                                      RelationTypeNotFoundException sample code for javax.management.relation.RelationTypeNotFoundException definition code for javax.management.relation.RelationTypeNotFoundException ,
                                      RelationNotFoundException sample code for javax.management.relation.RelationNotFoundException definition code for javax.management.relation.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.

Specified by:
handleMBeanUnregistration sample code for javax.management.relation.Relation.handleMBeanUnregistration(javax.management.ObjectName, java.lang.String) definition code for javax.management.relation.Relation.handleMBeanUnregistration(javax.management.ObjectName, java.lang.String) in interface Relation sample code for javax.management.relation.Relation definition code for javax.management.relation.Relation
Parameters:
theObjName - ObjectName of unregistered MBean
theRoleName - name of role where the MBean is referenced
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if null parameter
RoleNotFoundException sample code for javax.management.relation.RoleNotFoundException definition code for javax.management.relation.RoleNotFoundException - if role does not exist in the relation or is not writable
InvalidRoleValueException sample code for javax.management.relation.InvalidRoleValueException definition code for javax.management.relation.InvalidRoleValueException - if role value does not conform to the associated role info (this will never happen when called from the Relation Service)
RelationServiceNotRegisteredException sample code for javax.management.relation.RelationServiceNotRegisteredException definition code for javax.management.relation.RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server
RelationTypeNotFoundException sample code for javax.management.relation.RelationTypeNotFoundException definition code for javax.management.relation.RelationTypeNotFoundException - if the relation type has not been declared in the Relation Service.
RelationNotFoundException sample code for javax.management.relation.RelationNotFoundException definition code for javax.management.relation.RelationNotFoundException - if this method is called for a relation MBean not added in the Relation Service.

getReferencedMBeans sample code for javax.management.relation.RelationSupport.getReferencedMBeans() definition code for javax.management.relation.RelationSupport.getReferencedMBeans()

public Map sample code for java.util.Map definition code for java.util.Map  getReferencedMBeans()
Retrieves MBeans referenced in the various roles of the relation.

Specified by:
getReferencedMBeans sample code for javax.management.relation.Relation.getReferencedMBeans() definition code for javax.management.relation.Relation.getReferencedMBeans() in interface Relation sample code for javax.management.relation.Relation definition code for javax.management.relation.Relation
Returns:
a HashMap mapping:

ObjectName -> ArrayList of String (role names)


getRelationTypeName sample code for javax.management.relation.RelationSupport.getRelationTypeName() definition code for javax.management.relation.RelationSupport.getRelationTypeName()

public String sample code for java.lang.String definition code for java.lang.String  getRelationTypeName()
Returns name of associated relation type.

Specified by:
getRelationTypeName sample code for javax.management.relation.Relation.getRelationTypeName() definition code for javax.management.relation.Relation.getRelationTypeName() in interface Relation sample code for javax.management.relation.Relation definition code for javax.management.relation.Relation
Returns:
the name of the relation type.

getRelationServiceName sample code for javax.management.relation.RelationSupport.getRelationServiceName() definition code for javax.management.relation.RelationSupport.getRelationServiceName()

public ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  getRelationServiceName()
Returns ObjectName of the Relation Service handling the relation.

Specified by:
getRelationServiceName sample code for javax.management.relation.Relation.getRelationServiceName() definition code for javax.management.relation.Relation.getRelationServiceName() in interface Relation sample code for javax.management.relation.Relation definition code for javax.management.relation.Relation
Returns:
the ObjectName of the Relation Service.

getRelationId sample code for javax.management.relation.RelationSupport.getRelationId() definition code for javax.management.relation.RelationSupport.getRelationId()

public String sample code for java.lang.String definition code for java.lang.String  getRelationId()
Returns relation identifier (used to uniquely identify the relation inside the Relation Service).

Specified by:
getRelationId sample code for javax.management.relation.Relation.getRelationId() definition code for javax.management.relation.Relation.getRelationId() in interface Relation sample code for javax.management.relation.Relation definition code for javax.management.relation.Relation
Returns:
the relation id.

preRegister sample code for javax.management.relation.RelationSupport.preRegister(javax.management.MBeanServer, javax.management.ObjectName) definition code for javax.management.relation.RelationSupport.preRegister(javax.management.MBeanServer, javax.management.ObjectName)

public ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  preRegister(MBeanServer sample code for javax.management.MBeanServer definition code for javax.management.MBeanServer  server,
                              ObjectName sample code for javax.management.ObjectName definition code for javax.management.ObjectName  name)
                       throws Exception sample code for java.lang.Exception definition code for java.lang.Exception 
Description copied from interface: MBeanRegistration sample code for javax.management.MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName) definition code for javax.management.MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName)
Allows the MBean to perform any operations it needs before being registered in the MBean server. If the name of the MBean is not specified, the MBean can provide a name for its registration. If any exception is raised, the MBean will not be registered in the MBean server.

Specified by:
preRegister sample code for javax.management.MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName) definition code for javax.management.MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName) in interface MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration
Parameters:
server - The MBean server in which the MBean will be registered.
name - The object name of the MBean. This name is null if the name parameter to one of the createMBean or registerMBean methods in the MBeanServer sample code for javax.management.MBeanServer definition code for javax.management.MBeanServer interface is null. In that case, this method must return a non-null ObjectName for the new MBean.
Returns:
The name under which the MBean is to be registered. This value must not be null. If the name parameter is not null, it will usually but not necessarily be the returned value.
Throws:
Exception sample code for java.lang.Exception definition code for java.lang.Exception - This exception will be caught by the MBean server and re-thrown as an MBeanRegistrationException sample code for javax.management.MBeanRegistrationException definition code for javax.management.MBeanRegistrationException .

postRegister sample code for javax.management.relation.RelationSupport.postRegister(java.lang.Boolean) definition code for javax.management.relation.RelationSupport.postRegister(java.lang.Boolean)

public void postRegister(Boolean sample code for java.lang.Boolean definition code for java.lang.Boolean  registrationDone)
Description copied from interface: MBeanRegistration sample code for javax.management.MBeanRegistration.postRegister(java.lang.Boolean) definition code for javax.management.MBeanRegistration.postRegister(java.lang.Boolean)
Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.

Specified by:
postRegister sample code for javax.management.MBeanRegistration.postRegister(java.lang.Boolean) definition code for javax.management.MBeanRegistration.postRegister(java.lang.Boolean) in interface MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration
Parameters:
registrationDone - Indicates whether or not the MBean has been successfully registered in the MBean server. The value false means that the registration phase has failed.

preDeregister sample code for javax.management.relation.RelationSupport.preDeregister() definition code for javax.management.relation.RelationSupport.preDeregister()

public void preDeregister()
                   throws Exception sample code for java.lang.Exception definition code for java.lang.Exception 
Description copied from interface: MBeanRegistration sample code for javax.management.MBeanRegistration.preDeregister() definition code for javax.management.MBeanRegistration.preDeregister()
Allows the MBean to perform any operations it needs before being unregistered by the MBean server.

Specified by:
preDeregister sample code for javax.management.MBeanRegistration.preDeregister() definition code for javax.management.MBeanRegistration.preDeregister() in interface MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration
Throws:
Exception sample code for java.lang.Exception definition code for java.lang.Exception - This exception will be caught by the MBean server and re-thrown as an MBeanRegistrationException sample code for javax.management.MBeanRegistrationException definition code for javax.management.MBeanRegistrationException .

postDeregister sample code for javax.management.relation.RelationSupport.postDeregister() definition code for javax.management.relation.RelationSupport.postDeregister()

public void postDeregister()
Description copied from interface: MBeanRegistration sample code for javax.management.MBeanRegistration.postDeregister() definition code for javax.management.MBeanRegistration.postDeregister()
Allows the MBean to perform any operations needed after having been unregistered in the MBean server.

Specified by:
postDeregister sample code for javax.management.MBeanRegistration.postDeregister() definition code for javax.management.MBeanRegistration.postDeregister() in interface MBeanRegistration sample code for javax.management.MBeanRegistration definition code for javax.management.MBeanRegistration

isInRelationService sample code for javax.management.relation.RelationSupport.isInRelationService() definition code for javax.management.relation.RelationSupport.isInRelationService()

public Boolean sample code for java.lang.Boolean definition code for java.lang.Boolean  isInRelationService()
Returns an internal flag specifying if the object is still handled by the Relation Service.

Specified by:
isInRelationService sample code for javax.management.relation.RelationSupportMBean.isInRelationService() definition code for javax.management.relation.RelationSupportMBean.isInRelationService() in interface RelationSupportMBean sample code for javax.management.relation.RelationSupportMBean definition code for javax.management.relation.RelationSupportMBean
Returns:
a Boolean equal to Boolean.TRUE sample code for java.lang.Boolean.TRUE definition code for java.lang.Boolean.TRUE if the object is still handled by the Relation Service and Boolean.FALSE sample code for java.lang.Boolean.FALSE definition code for java.lang.Boolean.FALSE otherwise.

setRelationServiceManagementFlag sample code for javax.management.relation.RelationSupport.setRelationServiceManagementFlag(java.lang.Boolean) definition code for javax.management.relation.RelationSupport.setRelationServiceManagementFlag(java.lang.Boolean)

public void setRelationServiceManagementFlag(Boolean sample code for java.lang.Boolean definition code for java.lang.Boolean  theFlg)
                                      throws IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException 
Description copied from interface: RelationSupportMBean sample code for javax.management.relation.RelationSupportMBean.setRelationServiceManagementFlag(java.lang.Boolean) definition code for javax.management.relation.RelationSupportMBean.setRelationServiceManagementFlag(java.lang.Boolean)

Specifies whether this relation is handled by the Relation Service.

BEWARE, this method has to be exposed as the Relation Service will access the relation through its management interface. It is RECOMMENDED NOT to use this method. Using it does not affect the registration of the relation object in the Relation Service, but will provide wrong information about it!

Specified by:
setRelationServiceManagementFlag sample code for javax.management.relation.RelationSupportMBean.setRelationServiceManagementFlag(java.lang.Boolean) definition code for javax.management.relation.RelationSupportMBean.setRelationServiceManagementFlag(java.lang.Boolean) in interface RelationSupportMBean sample code for javax.management.relation.RelationSupportMBean definition code for javax.management.relation.RelationSupportMBean
Parameters:
theFlg - whether the relation is handled by the Relation Service.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if null parameter