| java.lang.Object javax.management.relation.RelationSupport
RelationSupport | public class RelationSupport implements RelationSupportMBean,MBeanRegistration(Code) | | 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 Summary | |
public | RelationSupport(String theRelId, ObjectName theRelServiceName, MBeanServer theRelServiceMBeanServer, String theRelTypeName, RoleList theRoleList) 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. | public | RelationSupport(String theRelId, ObjectName theRelServiceName, String theRelTypeName, RoleList theRoleList) 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. |
Method Summary | |
public RoleResult | getAllRoles() | RoleResult | getAllRolesFriend(RelationService service) This method is a friend method to getAllRoles. | public Map | 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() | public String | getRelationTypeName() Returns name of associated relation type. | public List | getRole(String theRoleName) Retrieves role value for given role name. | public Integer | getRoleCardinality(String theRoleName) | Object | getRoleFriend(String theRoleName, boolean theMultiRoleFlg, RelationService service) This method gets the Role/RoleUnresolved object provided a RoleName. | public RoleResult | getRoles(String[] theRoleNameArray) Retrieves values of roles with given names. | RoleResult | getRolesFriend(String[] theRoleNameArray, RelationService service) This method returns an RoleResult provided a string[] of roleNames. | public void | handleMBeanUnregistration(ObjectName theObjName, String theRoleName) 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. | void | handleMBeanUnregistrationFriend(ObjectName theObjName, String theRoleName, RelationService service) | public Boolean | isInRelationService() Returns an internal flag specifying if the object is still handled by
the Relation Service. | public void | postDeregister() Description copied from interface: MBeanRegistration. | public void | postRegister(Boolean registrationDone) Description copied from interface: MBeanRegistration.
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 in interface MBeanRegistration
Tags copied from interface: MBeanRegistration
Parameters: registrationDone - - Indicates whether or not the MBean has beensuccessfully registered in the MBean server. | public void | preDeregister() Description copied from interface: MBeanRegistration. | public ObjectName | preRegister(MBeanServer server, ObjectName name) Description copied from interface: MBeanRegistration.
Allows the MBean to perform any operations it needs before being
registered in the MBean server. | public RoleList | retrieveAllRoles() | public void | setRelationServiceManagementFlag(Boolean theFlg) Sets the flag to specify that it is handled or not by the Relation Service
BEWARE, this method has to be exposed for the user relation MBeans, as
the Relation Service will access them through their management interface.
It is RECOMMENDED NOT to use this method. | public void | setRole(Role theRole) Sets the given role. | Object | setRoleFriend(Role theRole, boolean theMultiRoleFlg, RelationService service) This method sets the value of a Role. | public RoleResult | setRoles(RoleList theRoleList) Sets the given roles. | RoleResult | setRolesFriend(RoleList theRoleList, boolean theRelServCallFlg, RelationService theRelServ) This method is a localfriend to setRoles. |
RelationSupport | public RelationSupport(String theRelId, ObjectName theRelServiceName, MBeanServer theRelServiceMBeanServer, String theRelTypeName, RoleList theRoleList) throws InvalidRoleValueException, IllegalArgumentException(Code) | | 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 inthe Relation Service. Expected to be unique in the givenRelation Service. Parameters: theRelServiceName - - ObjectName of the Relation Service wherethe relation will be registered. It is required as this isthe Relation Service that is aware of the definition ofthe relation type of given relation, so that will be ableto check update operations (set). Parameters: theRelServiceMBeanServer - - MBean Server where the wrapping MBeanis or will be registered. Expected to be the MBean Serverwhere the Relation Service is or will be registered. Parameters: theRelTypeName - - Name of relation type.Expected to have been created in given Relation Service. Parameters: theRoleList - - list of roles (Role objects) to initialised therelation. Can be null. Expected to conform to relation infoin associated relation type. exception: InvalidRoleValueException - - if the same name is used for two roles. exception: java.lang.IllegalArgumentException - - if a required value(Relation Service Object Name, etc.) is not provided as parameter. |
RelationSupport | public RelationSupport(String theRelId, ObjectName theRelServiceName, String theRelTypeName, RoleList theRoleList) throws InvalidRoleValueException, IllegalArgumentException(Code) | | 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 theRelation Service. Expected to be unique in the givenRelation Service. Parameters: theRelServiceName - - ObjectName of the Relation Service where therelation will be registered. It is required as this is theRelation Service that is aware of the definition of therelation type of given relation, so that will be able tocheck update operations (set). Parameters: theRelTypeName - - Name of relation type.Expected to have been created in given Relation Service. Parameters: theRoleList - - list of roles (Role objects) to initialised therelation. Can be null. Expected to conform to relation infoin associated relation type. exception: InvalidRoleValueException - - if the same name is used for two roles. exception: java.lang.IllegalArgumentException - - if a required value(Relation Service Object Name, etc.) is not provided as parameter. |
getReferencedMBeans | public Map getReferencedMBeans()(Code) | | Retrieves MBeans referenced in the various roles of the relation.
a HashMap mapping:ObjectName -> ArrayList of String (role names) |
getRelationId | public String getRelationId()(Code) | | Returns relation identifier (used to uniquely identify the relation
inside the Relation Service).
Relation identifier |
getRelationServiceName | public ObjectName getRelationServiceName()(Code) | | Returns ObjectName of the Relation Service handling the relation
ObjectName of the Relation Service handling the relation |
getRelationTypeName | public String getRelationTypeName()(Code) | | Returns name of associated relation type.
The name of associated relation type |
isInRelationService | public Boolean isInRelationService()(Code) | | Returns an internal flag specifying if the object is still handled by
the Relation Service.
Internal flag specifying if the object is still handled bythe Relation Service.Specified by:isInRelationService in interface RelationSupportMBean |
postDeregister | public void postDeregister()(Code) | | Description copied from interface: MBeanRegistration.
Allows the MBean to perform any operations needed after having been
de-registered in the MBean server.
Specified by:
postDeregister in interface MBeanRegistration
|
postRegister | public void postRegister(Boolean registrationDone)(Code) | | Description copied from interface: MBeanRegistration.
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 in interface MBeanRegistration
Tags copied from interface: MBeanRegistration
Parameters: registrationDone - - Indicates whether or not the MBean has beensuccessfully registered in the MBean server. The valuefalse means that the registration phase has failed |
preDeregister | public void preDeregister() throws Exception(Code) | | Description copied from interface: MBeanRegistration.
Allows the MBean to perform any operations it needs before being
de-registered by the MBean server.
Specified by:
preDeregister in interface MBeanRegistration
Tags copied from interface: MBeanRegistration
exception: java.langException - - This exception should be caught by theMBean server and re-thrown as an MBeanRegistrationException. |
preRegister | public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception(Code) | | Description copied from interface: MBeanRegistration.
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 in interface MBeanRegistration
Tags copied from interface: MBeanRegistration
Parameters: server - - The MBean server in which the MBean will be registered. Parameters: name - - The object name of the MBean. The name of the MBean registered. exception: java.lang.Exception - - This exception should be caught by theMBean server and re-thrown as an MBeanRegistrationException. |
retrieveAllRoles | public RoleList retrieveAllRoles()(Code) | | Returns all roles in the relation without checking read mode
a RoleList |
setRelationServiceManagementFlag | public void setRelationServiceManagementFlag(Boolean theFlg) throws IllegalArgumentException(Code) | | Sets the flag to specify that it is handled or not by the Relation Service
BEWARE, this method has to be exposed for the user relation MBeans, as
the Relation Service will access them through their 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 in interface RelationSupportMBean
Parameters: theFlg - If true the flag is handled by the relation service false otherwise exception: java.lang.IllegalArgumentException - - if null parameter |
|
|