javax.management.relation
Class RelationSupport

java.lang.Object
  extended byjavax.management.relation.RelationSupport
All Implemented Interfaces:
MBeanRegistration, Relation, RelationSupportMBean

public class RelationSupport
extends java.lang.Object
implements RelationSupportMBean, MBeanRegistration

Version:
$Revision: 1.6 $
Author:
Bronwen Cassidy

Constructor Summary
RelationSupport(java.lang.String relationId, ObjectName relationServiceObjectName, MBeanServer server, java.lang.String relationTypeName, RoleList roleList)
           
RelationSupport(java.lang.String relationId, ObjectName relationServiceObjectName, java.lang.String relationTypeName, RoleList roleList)
           
 
Method Summary
 RoleResult getAllRoles()
           
 java.util.Map getReferencedMBeans()
           
 java.lang.String getRelationId()
           
 ObjectName getRelationServiceName()
           
 java.lang.String getRelationTypeName()
           
 java.util.List getRole(java.lang.String roleName)
           
 java.lang.Integer getRoleCardinality(java.lang.String roleName)
           
 RoleResult getRoles(java.lang.String[] roleNames)
           
 void handleMBeanUnregistration(ObjectName objectName, java.lang.String roleName)
           
 java.lang.Boolean isInRelationService()
           
 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.
 RoleList retrieveAllRoles()
           
 void setRelationServiceManagementFlag(java.lang.Boolean isHandledByRelationService)
           
 void setRole(Role role)
           
 RoleResult setRoles(RoleList roleList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationSupport

public RelationSupport(java.lang.String relationId,
                       ObjectName relationServiceObjectName,
                       MBeanServer server,
                       java.lang.String relationTypeName,
                       RoleList roleList)
                throws InvalidRoleValueException,
                       java.lang.IllegalArgumentException

RelationSupport

public RelationSupport(java.lang.String relationId,
                       ObjectName relationServiceObjectName,
                       java.lang.String relationTypeName,
                       RoleList roleList)
                throws InvalidRoleValueException,
                       java.lang.IllegalArgumentException
Method Detail

getRole

public java.util.List getRole(java.lang.String roleName)
                       throws java.lang.IllegalArgumentException,
                              RoleNotFoundException,
                              RelationServiceNotRegisteredException
Specified by:
getRole in interface Relation
Throws:
java.lang.IllegalArgumentException
RoleNotFoundException
RelationServiceNotRegisteredException

getRoles

public RoleResult getRoles(java.lang.String[] roleNames)
                    throws java.lang.IllegalArgumentException,
                           RelationServiceNotRegisteredException
Specified by:
getRoles in interface Relation
Throws:
java.lang.IllegalArgumentException
RelationServiceNotRegisteredException

getAllRoles

public RoleResult getAllRoles()
                       throws RelationServiceNotRegisteredException
Specified by:
getAllRoles in interface Relation
Throws:
RelationServiceNotRegisteredException

retrieveAllRoles

public RoleList retrieveAllRoles()
Specified by:
retrieveAllRoles in interface Relation

setRole

public void setRole(Role role)
             throws java.lang.IllegalArgumentException,
                    RoleNotFoundException,
                    RelationTypeNotFoundException,
                    InvalidRoleValueException,
                    RelationServiceNotRegisteredException,
                    RelationNotFoundException
Specified by:
setRole in interface Relation
Throws:
java.lang.IllegalArgumentException
RoleNotFoundException
RelationTypeNotFoundException
InvalidRoleValueException
RelationServiceNotRegisteredException
RelationNotFoundException

setRoles

public RoleResult setRoles(RoleList roleList)
                    throws java.lang.IllegalArgumentException,
                           RelationServiceNotRegisteredException,
                           RelationTypeNotFoundException,
                           RelationNotFoundException
Specified by:
setRoles in interface Relation
Throws:
java.lang.IllegalArgumentException
RelationServiceNotRegisteredException
RelationTypeNotFoundException
RelationNotFoundException

getRoleCardinality

public java.lang.Integer getRoleCardinality(java.lang.String roleName)
                                     throws java.lang.IllegalArgumentException,
                                            RoleNotFoundException
Specified by:
getRoleCardinality in interface Relation
Throws:
java.lang.IllegalArgumentException
RoleNotFoundException

handleMBeanUnregistration

public void handleMBeanUnregistration(ObjectName objectName,
                                      java.lang.String roleName)
                               throws java.lang.IllegalArgumentException,
                                      RoleNotFoundException,
                                      InvalidRoleValueException,
                                      RelationServiceNotRegisteredException,
                                      RelationTypeNotFoundException,
                                      RelationNotFoundException
Specified by:
handleMBeanUnregistration in interface Relation
Throws:
java.lang.IllegalArgumentException
RoleNotFoundException
InvalidRoleValueException
RelationServiceNotRegisteredException
RelationTypeNotFoundException
RelationNotFoundException

getReferencedMBeans

public java.util.Map getReferencedMBeans()
Specified by:
getReferencedMBeans in interface Relation

getRelationTypeName

public java.lang.String getRelationTypeName()
Specified by:
getRelationTypeName in interface Relation

getRelationServiceName

public ObjectName getRelationServiceName()
Specified by:
getRelationServiceName in interface Relation

getRelationId

public java.lang.String getRelationId()
Specified by:
getRelationId in interface Relation

isInRelationService

public java.lang.Boolean isInRelationService()
Specified by:
isInRelationService in interface RelationSupportMBean

setRelationServiceManagementFlag

public void setRelationServiceManagementFlag(java.lang.Boolean isHandledByRelationService)
                                      throws java.lang.IllegalArgumentException
Specified by:
setRelationServiceManagementFlag in interface RelationSupportMBean
Throws:
java.lang.IllegalArgumentException

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws java.lang.Exception
Description copied from interface: MBeanRegistration
Allows the MBean to perform any operations before being registered to the MBeanServer.

Any exception will cause the MBean not being registered.

Specified by:
preRegister in interface MBeanRegistration
Parameters:
server - The MBeanServer on which the MBean will be registered.
name - The ObjectName of the MBean.
Returns:
ObjectName The name of the registered MBean
Throws:
java.lang.Exception - Exception of the operation. Note that this is caught by the MBeanServer and re-thrown as an MBeanRegistrationException.

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Description copied from interface: MBeanRegistration
Called upon after a registration ( successful or not ).

Specified by:
postRegister in interface MBeanRegistration
Parameters:
registrationDone - Evaluates to true of the registrations is successful, false otherwise.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Description copied from interface: MBeanRegistration
Called upon before an MBean will be de-registered by the MBeanServer.

Specified by:
preDeregister in interface MBeanRegistration
Throws:
java.lang.Exception - Would be caught by the MBeanServer and rethrown as an MBeanRegistrationException.

postDeregister

public void postDeregister()
Description copied from interface: MBeanRegistration
Called upon after the MBean has been de-registered.

Specified by:
postDeregister in interface MBeanRegistration


Copyright © 2001-2002 MX4J Team. All Rights Reserved.