|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--javax.management.NotificationBroadcasterSupport
|
+--javax.management.relation.RelationService
An MBean that maintains the consistency of all relation types and all relation instances within a JMX agent. It provides query operations to fins related and associated mbeans and their roles in the relation.
| Constructor Summary | |
RelationService(boolean purgeFlag)
constructor |
|
| Method Summary | |
void |
addRelation(ObjectName relationMBeanObjectName)
Add relation of a class that extends RelationSupport, is an external relation and can only be created with this method createRelation() is for internal relations only |
void |
addRelationType(RelationType relationType)
|
java.lang.Integer |
checkRoleReading(java.lang.String roleName,
java.lang.String relationTypeName)
|
java.lang.Integer |
checkRoleWriting(Role role,
java.lang.String relationTypeName,
java.lang.Boolean isInitialized)
|
void |
createRelation(java.lang.String relationId,
java.lang.String relationTypeName,
RoleList roleList)
|
void |
createRelationType(java.lang.String relationTypeName,
RoleInfo[] roleInfos)
|
java.util.Map |
findAssociatedMBeans(ObjectName mbeanObjectName,
java.lang.String relationTypeName,
java.lang.String roleName)
|
java.util.Map |
findReferencingRelations(ObjectName mbeanObjectName,
java.lang.String relationTypeName,
java.lang.String roleName)
|
java.util.List |
findRelationsOfType(java.lang.String relationTypeName)
|
java.util.List |
getAllRelationIds()
|
java.util.List |
getAllRelationTypeNames()
|
RoleResult |
getAllRoles(java.lang.String relationId)
|
MBeanNotificationInfo[] |
getNotificationInfo()
Implement to return more info regarding Notification Types |
boolean |
getPurgeFlag()
|
java.util.Map |
getReferencedMBeans(java.lang.String relationId)
|
java.lang.String |
getRelationTypeName(java.lang.String relationId)
|
java.util.List |
getRole(java.lang.String relationId,
java.lang.String roleName)
|
java.lang.Integer |
getRoleCardinality(java.lang.String relationId,
java.lang.String roleName)
|
RoleInfo |
getRoleInfo(java.lang.String relationTypeName,
java.lang.String roleInfoName)
|
java.util.List |
getRoleInfos(java.lang.String relationTypeName)
|
RoleResult |
getRoles(java.lang.String relationId,
java.lang.String[] roleNames)
|
void |
handleNotification(Notification notification,
java.lang.Object handback)
Called when a notification occurs. |
java.lang.Boolean |
hasRelation(java.lang.String relationId)
|
void |
isActive()
|
java.lang.String |
isRelation(ObjectName objectName)
|
ObjectName |
isRelationMBean(java.lang.String relationId)
|
void |
postDeregister()
Called upon after the MBean has been de-registered. |
void |
postRegister(java.lang.Boolean registrationDone)
Called upon after a registration ( successful or not ). |
void |
preDeregister()
Called upon before an MBean will be de-registered by
the MBeanServer. |
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
Allows the MBean to perform any operations before being registered to the MBeanServer.
|
void |
purgeRelations()
|
void |
removeRelation(java.lang.String relationId)
|
void |
removeRelationType(java.lang.String relationTypeName)
|
void |
sendRelationCreationNotification(java.lang.String relationId)
|
void |
sendRelationRemovalNotification(java.lang.String relationId,
java.util.List unregisteredMBeanList)
|
void |
sendRoleUpdateNotification(java.lang.String relationId,
Role newRole,
java.util.List oldRoleValues)
|
void |
setPurgeFlag(boolean purgeFlag)
|
void |
setRole(java.lang.String relationId,
Role role)
|
RoleResult |
setRoles(java.lang.String relationId,
RoleList roleList)
|
void |
updateRoleMap(java.lang.String relationId,
Role role,
java.util.List oldRoleValues)
Handles update of the RelationService role map for the update of given roles in a given relation |
| Methods inherited from class javax.management.NotificationBroadcasterSupport |
addNotificationListener, removeNotificationListener, sendNotification |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RelationService(boolean purgeFlag)
purgeFlag - - this is a flag, if true indicates an immediate update of relations is to be done when a
notification is recieved for the unregistration of an MBean referenced in a relation
- if false update of relations must be performed explicitly by calling purgeRelations()purgeRelations()| Method Detail |
public void isActive()
throws RelationServiceNotRegisteredException
isActive in interface RelationServiceMBeanRelationServiceNotRegisteredException - - thrown if the RelationService is not registered in the MBeanServer
Currently this class must be registered in the MBeanServer before any relations can be created or added
public boolean getPurgeFlag()
getPurgeFlag in interface RelationServiceMBeanpurgeRelations()public void setPurgeFlag(boolean purgeFlag)
setPurgeFlag in interface RelationServiceMBeanpurgeFlag - - a flag that when set to true indicates to the RelationService that it must update all relations
when it recieves a unregistration notification
if false this will not occur and purgeRelations must be called explicitly
public void createRelationType(java.lang.String relationTypeName,
RoleInfo[] roleInfos)
throws java.lang.IllegalArgumentException,
InvalidRelationTypeException
createRelationType in interface RelationServiceMBeanrelationTypeName - - a string giving relations a type name this must be a unique name
java.lang.IllegalArgumentException - thrown if any of the parameters are null
InvalidRelationTypeException - thrown if the role name, contained in the RoleInfo, already exists.
This method creates a relationType (a RelationTypeSupport Object) from the parameters passed in.
The RelationTypeSupport represents an internal relation
public void addRelationType(RelationType relationType)
throws java.lang.IllegalArgumentException,
InvalidRelationTypeException
addRelationType in interface RelationServiceMBeanrelationType - - an Object implementing the RelationType interface a utility implementation is provided by the
RelationTypeSupport class
java.lang.IllegalArgumentException - if a null RelationType is passed in as a parameter or if that RelationType has no RoleInfo defined
InvalidRelationTypeException - if the RoleInfo obtained from the RelationType is
- empty
- null
- the RoleName is already in use
This method makes an externally defined relation type available through the relationService
The RelationType is immutable, hence the returned values should never change while the relationType is registered with the realtion service
public java.util.List getAllRelationTypeNames()
getAllRelationTypeNames in interface RelationServiceMBean
public java.util.List getRoleInfos(java.lang.String relationTypeName)
throws java.lang.IllegalArgumentException,
RelationTypeNotFoundException
getRoleInfos in interface RelationServiceMBeanrelationTypeName - the string name representation of this RelationType
java.lang.IllegalArgumentException - if the relationTypeName is null
RelationTypeNotFoundException - if the Relationtype for the given relationTypeName is not found
public RoleInfo getRoleInfo(java.lang.String relationTypeName,
java.lang.String roleInfoName)
throws java.lang.IllegalArgumentException,
RelationTypeNotFoundException,
RoleInfoNotFoundException
getRoleInfo in interface RelationServiceMBeanrelationTypeName - string name representing the RelationTyperoleInfoName - string name representing the RoleInfo object
java.lang.IllegalArgumentException - if either the relationtypeName or the roleInfoName is null
RelationTypeNotFoundException - if the RelationType is not in the realtion service
RoleInfoNotFoundException - if the RoleInfo has not been found
public void removeRelationType(java.lang.String relationTypeName)
throws java.lang.IllegalArgumentException,
RelationServiceNotRegisteredException,
RelationTypeNotFoundException
removeRelationType in interface RelationServiceMBeanrelationTypeName - a string name representing the Relationtype Object
java.lang.IllegalArgumentException - if the relationTypeName is null
RelationServiceNotRegisteredException - if the RelationService has not been registered in the MBeanServer
RelationTypeNotFoundException - if the RelationType has not been found
This method removes a RelationType, it's name(represented by the relationTypeName) and any relationIds associated with it, and all MBeans referenced in it's roles
Note: this will not remove any mbeans registered with the MBeanServer this must be done if required via the MBeanServer. Any Mbeans registered with the MBean server will continue to be accessed via the MBeanServer, they will no longer be able to be referenced, queried via the relation service though.
public void createRelation(java.lang.String relationId,
java.lang.String relationTypeName,
RoleList roleList)
throws java.lang.IllegalArgumentException,
RelationServiceNotRegisteredException,
RoleNotFoundException,
InvalidRelationIdException,
RelationTypeNotFoundException,
InvalidRoleValueException
createRelation in interface RelationServiceMBeanrelationId - the id through which this relation is referencedrelationTypeName - a unique name for the RelationTyperoleList - a list of roles to be associated with this relation
java.lang.IllegalArgumentException - - if the relationId, or relationTypeName is null
RelationServiceNotRegisteredException - - if the relationService has not been registered in the MBeanServer
RoleNotFoundException - - if a role defined in the RoleList is null or empty
InvalidRelationIdException - if the relationId is already in use.
RelationTypeNotFoundException
InvalidRoleValueException - - if cardinality is not correct i.e min cardinality is greater than max cardinality
According to the RI spec this method is used only to create internal relations - hence creates an InternalRelation
This creates a relation represented by a RelationSupport Object, and a RelationNotification, with type RELATION_BASIC_CREATION, is sent
public void addRelation(ObjectName relationMBeanObjectName)
throws java.lang.IllegalArgumentException,
RelationServiceNotRegisteredException,
java.lang.NoSuchMethodException,
InvalidRelationIdException,
InstanceNotFoundException,
InvalidRelationServiceException,
RelationTypeNotFoundException,
RoleNotFoundException,
InvalidRoleValueException
addRelation in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationServiceNotRegisteredException
java.lang.NoSuchMethodException
InvalidRelationIdException
InstanceNotFoundException
InvalidRelationServiceException
RelationTypeNotFoundException
RoleNotFoundException
InvalidRoleValueException
public ObjectName isRelationMBean(java.lang.String relationId)
throws java.lang.IllegalArgumentException,
RelationNotFoundException
isRelationMBean in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationNotFoundException
public java.lang.String isRelation(ObjectName objectName)
throws java.lang.IllegalArgumentException
isRelation in interface RelationServiceMBeanjava.lang.IllegalArgumentException
public java.lang.Boolean hasRelation(java.lang.String relationId)
throws java.lang.IllegalArgumentException
hasRelation in interface RelationServiceMBeanjava.lang.IllegalArgumentExceptionpublic java.util.List getAllRelationIds()
getAllRelationIds in interface RelationServiceMBean
public java.lang.Integer checkRoleReading(java.lang.String roleName,
java.lang.String relationTypeName)
throws java.lang.IllegalArgumentException,
RelationTypeNotFoundException
checkRoleReading in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationTypeNotFoundException
public java.lang.Integer checkRoleWriting(Role role,
java.lang.String relationTypeName,
java.lang.Boolean isInitialized)
throws java.lang.IllegalArgumentException,
RelationTypeNotFoundException
checkRoleWriting in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationTypeNotFoundException
public void sendRelationCreationNotification(java.lang.String relationId)
throws java.lang.IllegalArgumentException,
RelationNotFoundException
sendRelationCreationNotification in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationNotFoundException
public void sendRoleUpdateNotification(java.lang.String relationId,
Role newRole,
java.util.List oldRoleValues)
throws java.lang.IllegalArgumentException,
RelationNotFoundException
sendRoleUpdateNotification in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationNotFoundException
public void sendRelationRemovalNotification(java.lang.String relationId,
java.util.List unregisteredMBeanList)
throws java.lang.IllegalArgumentException,
RelationNotFoundException
sendRelationRemovalNotification in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationNotFoundException
public void updateRoleMap(java.lang.String relationId,
Role role,
java.util.List oldRoleValues)
throws java.lang.IllegalArgumentException,
RelationServiceNotRegisteredException,
RelationNotFoundException
updateRoleMap in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationServiceNotRegisteredException
RelationNotFoundException
public void removeRelation(java.lang.String relationId)
throws java.lang.IllegalArgumentException,
RelationServiceNotRegisteredException,
RelationNotFoundException
removeRelation in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationServiceNotRegisteredException
RelationNotFoundException
public void purgeRelations()
throws RelationServiceNotRegisteredException
purgeRelations in interface RelationServiceMBeanRelationServiceNotRegisteredException
public java.util.Map findReferencingRelations(ObjectName mbeanObjectName,
java.lang.String relationTypeName,
java.lang.String roleName)
throws java.lang.IllegalArgumentException
findReferencingRelations in interface RelationServiceMBeanjava.lang.IllegalArgumentException
public java.util.Map findAssociatedMBeans(ObjectName mbeanObjectName,
java.lang.String relationTypeName,
java.lang.String roleName)
throws java.lang.IllegalArgumentException
findAssociatedMBeans in interface RelationServiceMBeanjava.lang.IllegalArgumentException
public java.util.List findRelationsOfType(java.lang.String relationTypeName)
throws java.lang.IllegalArgumentException,
RelationTypeNotFoundException
findRelationsOfType in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationTypeNotFoundException
public java.util.List getRole(java.lang.String relationId,
java.lang.String roleName)
throws java.lang.IllegalArgumentException,
RelationServiceNotRegisteredException,
RelationNotFoundException,
RoleNotFoundException
getRole in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationServiceNotRegisteredException
RelationNotFoundException
RoleNotFoundException
public RoleResult getRoles(java.lang.String relationId,
java.lang.String[] roleNames)
throws java.lang.IllegalArgumentException,
RelationNotFoundException,
RelationServiceNotRegisteredException
getRoles in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationNotFoundException
RelationServiceNotRegisteredException
public RoleResult getAllRoles(java.lang.String relationId)
throws java.lang.IllegalArgumentException,
RelationNotFoundException,
RelationServiceNotRegisteredException
getAllRoles in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationNotFoundException
RelationServiceNotRegisteredException
public java.lang.Integer getRoleCardinality(java.lang.String relationId,
java.lang.String roleName)
throws java.lang.IllegalArgumentException,
RelationNotFoundException,
RoleNotFoundException
getRoleCardinality in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationNotFoundException
RoleNotFoundException
public void setRole(java.lang.String relationId,
Role role)
throws java.lang.IllegalArgumentException,
RelationServiceNotRegisteredException,
RelationNotFoundException,
RoleNotFoundException,
InvalidRoleValueException,
RelationTypeNotFoundException
setRole in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationServiceNotRegisteredException
RelationNotFoundException
RoleNotFoundException
InvalidRoleValueException
RelationTypeNotFoundException
public RoleResult setRoles(java.lang.String relationId,
RoleList roleList)
throws RelationServiceNotRegisteredException,
java.lang.IllegalArgumentException,
RelationNotFoundException
setRoles in interface RelationServiceMBeanRelationServiceNotRegisteredException
java.lang.IllegalArgumentException
RelationNotFoundException
public java.util.Map getReferencedMBeans(java.lang.String relationId)
throws java.lang.IllegalArgumentException,
RelationNotFoundException
getReferencedMBeans in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationNotFoundException
public java.lang.String getRelationTypeName(java.lang.String relationId)
throws java.lang.IllegalArgumentException,
RelationNotFoundException
getRelationTypeName in interface RelationServiceMBeanjava.lang.IllegalArgumentException
RelationNotFoundException
public void handleNotification(Notification notification,
java.lang.Object handback)
NotificationListener
handleNotification in interface NotificationListenernotification - The notification objecthandback - Helps in associating information regarding the listener.public MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface NotificationBroadcastergetNotificationInfo in class NotificationBroadcasterSupport
public ObjectName preRegister(MBeanServer server,
ObjectName name)
throws java.lang.Exception
MBeanRegistrationMBeanServer.
Any exception will cause the MBean not being registered.
preRegister in interface MBeanRegistrationserver - The MBeanServer on which the MBean will be registered.name - The ObjectName of the MBean.
java.lang.Exception - Exception of the operation. Note that this is caught
by the MBeanServer and re-thrown as an
MBeanRegistrationException.public void postRegister(java.lang.Boolean registrationDone)
MBeanRegistration
postRegister in interface MBeanRegistrationregistrationDone - Evaluates to true of the registrations
is successful, false otherwise.
public void preDeregister()
throws java.lang.Exception
MBeanRegistrationMBean will be de-registered by
the MBeanServer.
preDeregister in interface MBeanRegistrationjava.lang.Exception - Would be caught by the MBeanServer
and rethrown as an MBeanRegistrationException.public void postDeregister()
MBeanRegistration
postDeregister in interface MBeanRegistration
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||