|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is implemented by an MBean that represents a relation.
Relations with only roles can be created by the relation service using a
RelationSupport
(src) object.More complicated relations have to implemented manually. The
RelationSupport
(src) can be used to help in the implementation.Any properties or methods must be exposed for management by the implementing MBean.
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. |
RoleList (src) |
retrieveAllRoles()
Retrieve all the roles in this relation without checking the role mode. |
void |
setRole(Role (src) role)
Sets the passed role for this relation. |
RoleResult (src) |
setRoles(RoleList (src) roleList)
Sets the roles. |
Method Detail |
public java.util.List getRole(java.lang.String roleName) throws java.lang.IllegalArgumentException, RoleNotFoundException (src) , RelationServiceNotRegisteredException (src)
The return value is an ArrayList of object names in the role.
roleName
- the role name.
java.lang.IllegalArgumentException
- for a null role name.
RoleNotFoundException (src)
- when there is no such role or
it is not readable.
RelationServiceNotRegisteredException (src)
- when the relation service
is not registered with an MBeanServer.public RoleResult (src) getRoles(java.lang.String[] roleNames) throws java.lang.IllegalArgumentException, RelationServiceNotRegisteredException (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 java.lang.Integer getRoleCardinality(java.lang.String roleName) throws java.lang.IllegalArgumentException, RoleNotFoundException (src)
roleName
- the role name.
java.lang.IllegalArgumentException
- for a null role name.
RoleNotFoundException (src)
- when there is no such role.public RoleResult (src) getAllRoles() throws RelationServiceNotRegisteredException (src)
RelationServiceNotRegisteredException (src)
- when the relation service
is not registered with an MBeanServer.public RoleList (src) retrieveAllRoles()
public void setRole(Role (src) role) throws java.lang.IllegalArgumentException, RoleNotFoundException (src) , RelationTypeNotFoundException (src) , InvalidRoleValueException (src) , RelationServiceNotRegisteredException (src) , RelationNotFoundException (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.
role
- the new role.
java.lang.IllegalArgumentException
- for a null role.
InvalidRoleValueException (src)
- if the role is not valid.
RoleNotFoundException (src)
- if the role is not writable.
This test is not performed at initialisation.
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.public RoleResult (src) setRoles(RoleList (src) roleList) throws java.lang.IllegalArgumentException, RelationServiceNotRegisteredException (src) , RelationTypeNotFoundException (src) , RelationNotFoundException (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.
roleList
- the new roles.
java.lang.IllegalArgumentException
- for a null role name.
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.public void handleMBeanUnregistration(ObjectName (src) objectName, java.lang.String roleName) throws java.lang.IllegalArgumentException, RoleNotFoundException (src) , InvalidRoleValueException (src) , RelationServiceNotRegisteredException (src) , RelationTypeNotFoundException (src) , RelationNotFoundException (src)
The object name should be removed from the role.
Calling this method manually may result in incorrect behaviour
objectName
- the object name unregistered.roleName
- the role the containing the object.
RoleNotFoundException (src)
- if the role does exist or it is not
writable.
InvalidRoleValueException (src)
- when the role does not conform
to the associated role info.
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
public java.util.Map getReferencedMBeans()
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.
public java.lang.String getRelationTypeName()
public ObjectName (src) getRelationServiceName()
public java.lang.String getRelationId()
|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |