|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.management.relation.RelationSupport
Implements the management interface for a relation created internally within the relation service. The relation can have only roles - no attributes or methods.
The relation support managed bean can be created externally, including extending it, and then registered with the relation service.
Constructor Summary | |
RelationSupport(java.lang.String relationId,
ObjectName (src) relationService,
MBeanServer (src) mbeanServer,
java.lang.String relationTypeName,
RoleList (src) roleList)
Construct a new relation support object. |
|
RelationSupport(java.lang.String relationId,
ObjectName (src) relationService,
java.lang.String relationTypeName,
RoleList (src) roleList)
Construct a new relation support object. |
Method Summary | |
RoleResult (src) |
getAllRoles()
Retrieves all the roles in this relation. |
java.util.Map |
getReferencedMBeans()
Retrieves MBeans referenced by roles of this relation. |
java.lang.String |
getRelationId()
Retrieves the relation id used to identify the relation within the relation service. |
ObjectName (src) |
getRelationServiceName()
Retrieves the object name of the relation service this relation is registered with. |
java.lang.String |
getRelationTypeName()
Retrieves the relation type for this relation. |
java.util.List |
getRole(java.lang.String roleName)
Retrieves the role for the passed role name. |
java.lang.Integer |
getRoleCardinality(java.lang.String roleName)
Retrieves the number of MBeans in a given role. |
RoleResult (src) |
getRoles(java.lang.String[] roleNames)
Retrieves the roles in this relation with the passed names. |
void |
handleMBeanUnregistration(ObjectName (src) objectName,
java.lang.String roleName)
The relation service will call this service when an MBean referenced in a role is unregistered. |
java.lang.Boolean |
isInRelationService()
Check to see whether this relation thinks it is in relation service. |
void |
postDeregister()
This method is called by the MBeanServer after deregistration takes place. |
void |
postRegister(java.lang.Boolean registered)
This method is called by the MBeanServer after registration takes place or when registration fails. |
void |
preDeregister()
This method is called by the MBeanServer before deregistration takes place. |
ObjectName (src) |
preRegister(MBeanServer (src) server,
ObjectName (src) objectName)
This method is called by the MBeanServer before registration takes place. |
RoleList (src) |
retrieveAllRoles()
Retrieve all the roles in this relation without checking the role mode. |
void |
setRelationServiceManagementFlag(java.lang.Boolean value)
Set the flag to specify whether this relation is registered with the relation service. |
void |
setRole(Role (src) role)
Sets the passed role for this relation. |
RoleResult (src) |
setRoles(RoleList (src) roleList)
Sets the roles. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RelationSupport(java.lang.String relationId, ObjectName (src) relationService, java.lang.String relationTypeName, RoleList (src) roleList) throws java.lang.IllegalArgumentException, InvalidRoleValueException (src)
This constructor is intended for use when manually registrating a relation support object or an class that extends it.
Constructing the object does not register it with the relation service, only the following is validated at this stage.
The relation id is mandatory.
The relation service name is mandatory.
.
The relation type name is mandatory.
The same name is used for more than one role.
relationId
- the relation IdrelationService
- the object name of the relation servicerelationTypeName
- the name of the relation typeroleList
- the roles in this relation
java.lang.IllegalArgumentException
- for null values.
InvalidRoleValueException (src)
- when two roles have the same name.public RelationSupport(java.lang.String relationId, ObjectName (src) relationService, MBeanServer (src) mbeanServer, java.lang.String relationTypeName, RoleList (src) roleList) throws java.lang.IllegalArgumentException, InvalidRoleValueException (src)
This constructor is intended for use when manually registrating a relation that delegates to relation support.
Constructing the object does not register it with the relation service, only the following is validated at this stage.
The relation id is mandatory.
The relation service name is mandatory.
.
The mbean service is mandatory.
.
The relation type name is mandatory.
The same name is used for more than one role.
relationId
- the relation IdrelationService
- the object name of the relation servicembeanServer
- the object name of the relation servicerelationTypeName
- the name of the relation typeroleList
- the roles in this relation
java.lang.IllegalArgumentException
- for null values.
InvalidRoleValueException (src)
- when two roles have the same name.Method Detail |
public RoleResult (src) getAllRoles() throws RelationServiceNotRegisteredException (src)
Relation (src)
getAllRoles
in interface Relation (src)
RelationServiceNotRegisteredException (src)
- when the relation service
is not registered with an MBeanServer.public java.util.Map getReferencedMBeans()
Relation (src)
The return value is a map keyed by MBean object names. The objects are associated with an ArrayList that contains all the role names the MBean has within this relation.
getReferencedMBeans
in interface Relation (src)
public java.lang.String getRelationId()
Relation (src)
getRelationId
in interface Relation (src)
public ObjectName (src) getRelationServiceName()
Relation (src)
getRelationServiceName
in interface Relation (src)
public java.lang.String getRelationTypeName()
Relation (src)
getRelationTypeName
in interface Relation (src)
public java.util.List getRole(java.lang.String roleName) throws java.lang.IllegalArgumentException, RoleNotFoundException (src) , RelationServiceNotRegisteredException (src)
Relation (src)
The return value is an ArrayList of object names in the role.
getRole
in interface Relation (src)
roleName
- the role name.
java.lang.IllegalArgumentException
- for a null role name.
RelationServiceNotRegisteredException (src)
- when the relation service
is not registered with an MBeanServer.
RoleNotFoundException (src)
- when there is no such role or
it is not readable.public java.lang.Integer getRoleCardinality(java.lang.String roleName) throws java.lang.IllegalArgumentException, RoleNotFoundException (src)
Relation (src)
getRoleCardinality
in interface Relation (src)
roleName
- the role name.
RoleNotFoundException (src)
- when there is no such role.
java.lang.IllegalArgumentException
- for a null role name.public RoleResult (src) getRoles(java.lang.String[] roleNames) throws java.lang.IllegalArgumentException, RelationServiceNotRegisteredException (src)
Relation (src)
getRoles
in interface Relation (src)
roleNames
- an array of role names
java.lang.IllegalArgumentException
- for a null role names.
RelationServiceNotRegisteredException (src)
- when the relation service
is not registered with an MBeanServer.public void handleMBeanUnregistration(ObjectName (src) objectName, java.lang.String roleName) throws java.lang.IllegalArgumentException, RoleNotFoundException (src) , InvalidRoleValueException (src) , RelationServiceNotRegisteredException (src) , RelationTypeNotFoundException (src) , RelationNotFoundException (src)
Relation (src)
The object name should be removed from the role.
Calling this method manually may result in incorrect behaviour
handleMBeanUnregistration
in interface Relation (src)
objectName
- the object name unregistered.roleName
- the role the containing the object.
RelationTypeNotFoundException (src)
- when the relation type has
not been registered in the relation service.
RoleNotFoundException (src)
- if the role does exist or it is not
writable.
RelationServiceNotRegisteredException (src)
- when the relation service
is not registered with an MBeanServer.
InvalidRoleValueException (src)
- when the role does not conform
to the associated role info.
RelationNotFoundException (src)
- when this method is called for
for an MBean not registered with the relation service.
java.lang.IllegalArgumentException
public RoleList (src) retrieveAllRoles()
Relation (src)
retrieveAllRoles
in interface Relation (src)
public void setRole(Role (src) role) throws java.lang.IllegalArgumentException, RoleNotFoundException (src) , RelationTypeNotFoundException (src) , InvalidRoleValueException (src) , RelationServiceNotRegisteredException (src) , RelationNotFoundException (src)
Relation (src)
The role is checked according to its role definition in the relation type. The role is not valid if there are the wrong number of MBeans, an MBean is of an incorrect class or an MBean does not exist.
The notification RELATION_BASIC_UPDATE is sent when the relation is not an MBean or RELATION_MBEAN_UPDATE when it is.
setRole
in interface Relation (src)
role
- the new role.
RoleNotFoundException (src)
- if the role is not writable.
This test is not performed at initialisation.
InvalidRoleValueException (src)
- if the role is not valid.
RelationServiceNotRegisteredException (src)
- when the relation service
is not registered with an MBeanServer.
RelationTypeNotFoundException (src)
- when the relation type has
not been registered in the relation service.
RelationNotFoundException (src)
- when this method is called for
for an MBean not registered with the relation service.
java.lang.IllegalArgumentException
- for a null role.public RoleResult (src) setRoles(RoleList (src) roleList) throws java.lang.IllegalArgumentException, RelationServiceNotRegisteredException (src) , RelationTypeNotFoundException (src) , RelationNotFoundException (src)
Relation (src)
The roles are checked according to its role definition in the relation type. The role is not valid if there are the wrong number of MBeans, an MBean is of an incorrect class or an MBean does not exist.
A notification RELATION_BASIC_UPDATE is sent when the relation is not an MBean or RELATION_MBEAN_UPDATE when it is for every updated role.
The return role result has a role list for successfully updated roles and an unresolved list for roles not set.
setRoles
in interface Relation (src)
roleList
- the new roles.
RelationTypeNotFoundException (src)
- when the relation type has
not been registered in the relation service.
java.lang.IllegalArgumentException
- for a null role name.
RelationServiceNotRegisteredException (src)
- when the relation service
is not registered with an MBeanServer.
RelationNotFoundException (src)
- when this method is called for
for an MBean not registered with the relation service.public java.lang.Boolean isInRelationService()
RelationSupportMBean (src)
WARNING: This is not a dynamic check. The flag is set within the relation support object by the relation service, malicious programs may modifiy it to an incorrect value.
isInRelationService
in interface RelationSupportMBean (src)
public void setRelationServiceManagementFlag(java.lang.Boolean value) throws java.lang.IllegalArgumentException
RelationSupportMBean (src)
WARNING: This method is exposed for management by the relation service. Using this method outside of the relation service does not affect the registration with the relation service.
setRelationServiceManagementFlag
in interface RelationSupportMBean (src)
value
- pass true for managed by the relation service, false
otherwise.
java.lang.IllegalArgumentException
- for a null valuepublic ObjectName (src) preRegister(MBeanServer (src) server, ObjectName (src) objectName) throws java.lang.Exception
MBeanRegistration (src)
The MBean can stop the registration by throwing an exception.The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preRegister
in interface MBeanRegistration (src)
java.lang.Exception
- for any error, the MBean is not registered.public void postRegister(java.lang.Boolean registered)
MBeanRegistration (src)
postRegister
in interface MBeanRegistration (src)
registered
- the MBeanServer passes true when the
MBean was registered, false otherwise.public void preDeregister() throws java.lang.Exception
MBeanRegistration (src)
The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preDeregister
in interface MBeanRegistration (src)
java.lang.Exception
public void postDeregister()
MBeanRegistration (src)
postDeregister
in interface MBeanRegistration (src)
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |