|
XMOJO 5 API Docs | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface has to be implemented by any MBean class expected to represent a relation managed using the Relation Service. Simple relations, i.e. having only roles, no properties or methods, can be created directly by the Relation Service (represented as RelationSupport objects, internally handled by the Relation Service). If the user wants to represent more complex relations, involving properties and/or methods, he has to provide his own class implementing the Relation interface. This can be achieved either by inheriting from RelationSupport class, or by implementing the interface (fully or delegation to a RelationSupport object member). Specifying such user relation class is to introduce properties and/or methods. Those have to be exposed for remote management. So this means that any user relation class must be a MBean class.
Method Summary | |
RoleResult |
getAllRoles()
Returns all roles present in the relation |
java.util.Map |
getReferencedMBeans()
Retrieves MBeans referenced in the various roles of the relation. |
java.lang.String |
getRelationId()
Returns relation identifier (used to uniquely identify the relation inside the Relation Service) |
ObjectName |
getRelationServiceName()
Returns ObjectName of the Relation Service handling the relation |
java.lang.String |
getRelationTypeName()
Returns name of associated relation type. |
java.util.List |
getRole(java.lang.String theRoleName)
Retrieves role value for given role name. |
java.lang.Integer |
getRoleCardinality(java.lang.String theRoleName)
Returns the number of MBeans currently referenced in the given role. |
RoleResult |
getRoles(java.lang.String[] theRoleNameArray)
Retrieves values of roles with given names. |
void |
handleMBeanUnregistration(ObjectName theObjName,
java.lang.String theRoleName)
Callback used by the Relation Service when a MBean referenced in a role is unregistered. |
RoleList |
retrieveAllRoles()
Returns all roles in the relation without checking read mode |
void |
setRole(Role theRole)
Sets the given role. |
RoleResult |
setRoles(RoleList theRoleList)
Sets the given roles. |
Method Detail |
public RoleResult getAllRoles() throws RelationServiceNotRegisteredException
RelationServiceNotRegisteredException
- - if the Relation Service
is not registered in the MBean Serverpublic java.util.Map getReferencedMBeans()
public java.lang.String getRelationId()
public ObjectName getRelationServiceName()
public java.lang.String getRelationTypeName()
public java.util.List getRole(java.lang.String theRoleName) throws java.lang.IllegalArgumentException, RoleNotFoundException, RelationServiceNotRegisteredException
theRoleName
- - name of rolejava.lang.IllegalArgumentException
- - if null role nameRoleNotFoundException
- - if:
- there is no role with given name
- the role is not readable.RelationServiceNotRegisteredException
- - if the Relation Service
is not registered in the MBean Serverpublic java.lang.Integer getRoleCardinality(java.lang.String theRoleName) throws java.lang.IllegalArgumentException, RoleNotFoundException
theRoleName
- - name of rolejava.lang.IllegalArgumentException
- - if null role nameRoleNotFoundException
- - if there is no role with given namepublic RoleResult getRoles(java.lang.String[] theRoleNameArray) throws java.lang.IllegalArgumentException, RelationServiceNotRegisteredException
theRoleNameArray
- - array of names of roles to be retrievedjava.lang.IllegalArgumentException
- - if null role nameRelationServiceNotRegisteredException
- - if the Relation Service
is not registered in the MBean Serverpublic void handleMBeanUnregistration(ObjectName theObjName, java.lang.String theRoleName) throws java.lang.IllegalArgumentException, RoleNotFoundException, InvalidRoleValueException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException
theObjName
- - ObjectName of unregistered MBeantheRoleName
- - name of role where the MBean is referencedjava.lang.IllegalArgumentException
- - if null parameterRoleNotFoundException
- - if role does not exist in the relation
or is not writableInvalidRoleValueException
- - if role value does not conform to
the associated role info (this will never happen when
called from the Relation Service)RelationServiceNotRegisteredException
- - if the Relation Service
is not registered in the MBean ServerRelationTypeNotFoundException
- - if the relation type has not
been declared in the Relation Service.RelationNotFoundException
- - if this method is called for a
relation MBean not added in the Relation Service.public RoleList retrieveAllRoles()
public void setRole(Role theRole) throws java.lang.IllegalArgumentException, RoleNotFoundException, InvalidRoleValueException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException
theRole
- - role to be set (name and new value)java.lang.IllegalArgumentException
- - if null roleRoleNotFoundException
- - if the role is not writable (no test on
the write access mode performed when initialising the role)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 existRelationServiceNotRegisteredException
- - if the Relation Service
is not registered in the MBean ServerRelationTypeNotFoundException
- - if the relation type has not
been declared in the Relation Service.public RoleResult setRoles(RoleList theRoleList) throws java.lang.IllegalArgumentException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException
theRoleList
- - list of roles to be setjava.lang.IllegalArgumentException
- - if null role nameRelationServiceNotRegisteredException
- - if the Relation Service
is not registered in the MBean ServerRelationTypeNotFoundException
- - if the relation type has not
been declared in the Relation Service.RelationNotFoundException
- - if the relation MBean has not been
added in the Relation Service.
|
XMOJO 5 API Docs | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |