SunONE Application Server v8.0 PE

javax.management.relation
Class RoleInfo

java.lang.Object
  extended byjavax.management.relation.RoleInfo
All Implemented Interfaces:
java.io.Serializable

public class RoleInfo
extends java.lang.Object
implements java.io.Serializable

A RoleInfo object summarises a role in a relation type.

See Also:
Serialized Form

Field Summary
static int ROLE_CARDINALITY_INFINITY
          To specify an unlimited cardinality.
 
Constructor Summary
RoleInfo(RoleInfo theRoleInfo)
          Copy constructor.
RoleInfo(java.lang.String theName, java.lang.String theRefMBeanClassName)
          Constructor.
RoleInfo(java.lang.String theName, java.lang.String theRefMBeanClassName, boolean theIsReadable, boolean theIsWritable)
          Constructor.
RoleInfo(java.lang.String theName, java.lang.String theRefMBeanClassName, boolean theIsReadable, boolean theIsWritable, int theMinDegree, int theMaxDegree, java.lang.String theDescription)
          Constructor.
 
Method Summary
 boolean checkMaxDegree(int theValue)
          Returns a boolean to specify if given value is less or equal than expected maximum degree (true if yes).
 boolean checkMinDegree(int theValue)
          Returns a boolean to specify if given value is greater or equal than expected minimum degree (true if yes).
 java.lang.String getDescription()
          Returns description text for the role.
 int getMaxDegree()
          Returns maximum degree for corresponding role reference.
 int getMinDegree()
          Returns minimum degree for corresponding role reference.
 java.lang.String getName()
          Returns the name of the role.
 java.lang.String getRefMBeanClassName()
          Returns name of type of MBean expected to be referenced in corresponding role.
 boolean isReadable()
          Returns read access mode for the role (true if it is readable).
 boolean isWritable()
          Returns write access mode for the role (true if it is writable).
 java.lang.String toString()
          Returns a string describing the role info.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ROLE_CARDINALITY_INFINITY

public static int ROLE_CARDINALITY_INFINITY
To specify an unlimited cardinality.

Constructor Detail

RoleInfo

public RoleInfo(java.lang.String theName,
                java.lang.String theRefMBeanClassName,
                boolean theIsReadable,
                boolean theIsWritable,
                int theMinDegree,
                int theMaxDegree,
                java.lang.String theDescription)
         throws java.lang.IllegalArgumentException,
                InvalidRoleInfoException,
                java.lang.ClassNotFoundException,
                NotCompliantMBeanException
Constructor.

Parameters:
theName - name of the role.
theRefMBeanClassName - name of the class of MBean(s) expected to be referenced in corresponding role. If an MBean M is in this role, then the MBean server must return true for isInstanceOf(M, theRefMBeanClassName).
theIsReadable - flag to indicate if the corresponding role can be read
theIsWritable - flag to indicate if the corresponding role can be set
theMinDegree - minimum degree for role, i.e. minimum number of MBeans to provide in corresponding role Must be less or equal than theMaxDegree. (ROLE_CARDINALITY_INFINITY for unlimited)
theMaxDegree - maximum degree for role, i.e. maximum number of MBeans to provide in corresponding role Must be greater or equal than theMinDegree (ROLE_CARDINALITY_INFINITY for unlimited)
theDescription - description of the role (can be null)
Throws:
java.lang.IllegalArgumentException - if null parameter
InvalidRoleInfoException - if the minimum degree is greater than the maximum degree.
java.lang.ClassNotFoundException - As of JMX 1.2, this exception can no longer be thrown. It is retained in the declaration of this class for compatibility with existing code.
NotCompliantMBeanException - if the class theRefMBeanClassName is not a MBean class.

RoleInfo

public RoleInfo(java.lang.String theName,
                java.lang.String theRefMBeanClassName,
                boolean theIsReadable,
                boolean theIsWritable)
         throws java.lang.IllegalArgumentException,
                java.lang.ClassNotFoundException,
                NotCompliantMBeanException
Constructor.

Parameters:
theName - name of the role
theRefMBeanClassName - name of the class of MBean(s) expected to be referenced in corresponding role. If an MBean M is in this role, then the MBean server must return true for isInstanceOf(M, theRefMBeanClassName).
theIsReadable - flag to indicate if the corresponding role can be read
theIsWritable - flag to indicate if the corresponding role can be set

Minimum and maximum degrees defaulted to 1.

Description of role defaulted to null.

Throws:
java.lang.IllegalArgumentException - if null parameter
java.lang.ClassNotFoundException - As of JMX 1.2, this exception can no longer be thrown. It is retained in the declaration of this class for compatibility with existing code.
NotCompliantMBeanException - As of JMX 1.2, this exception can no longer be thrown. It is retained in the declaration of this class for compatibility with existing code.

RoleInfo

public RoleInfo(java.lang.String theName,
                java.lang.String theRefMBeanClassName)
         throws java.lang.IllegalArgumentException,
                java.lang.ClassNotFoundException,
                NotCompliantMBeanException
Constructor.

Parameters:
theName - name of the role
theRefMBeanClassName - name of the class of MBean(s) expected to be referenced in corresponding role. If an MBean M is in this role, then the MBean server must return true for isInstanceOf(M, theRefMBeanClassName).

IsReadable and IsWritable defaulted to true.

Minimum and maximum degrees defaulted to 1.

Description of role defaulted to null.

Throws:
java.lang.IllegalArgumentException - if null parameter
java.lang.ClassNotFoundException - As of JMX 1.2, this exception can no longer be thrown. It is retained in the declaration of this class for compatibility with existing code.
NotCompliantMBeanException - As of JMX 1.2, this exception can no longer be thrown. It is retained in the declaration of this class for compatibility with existing code.

RoleInfo

public RoleInfo(RoleInfo theRoleInfo)
         throws java.lang.IllegalArgumentException
Copy constructor.

Parameters:
theRoleInfo - the RoleInfo to be copied.
Throws:
java.lang.IllegalArgumentException - if null parameter
Method Detail

getName

public java.lang.String getName()
Returns the name of the role.

Returns:
the name of the role.

isReadable

public boolean isReadable()
Returns read access mode for the role (true if it is readable).

Returns:
true if the role is readable.

isWritable

public boolean isWritable()
Returns write access mode for the role (true if it is writable).

Returns:
true if the role is writable.

getDescription

public java.lang.String getDescription()
Returns description text for the role.

Returns:
the description of the role.

getMinDegree

public int getMinDegree()
Returns minimum degree for corresponding role reference.

Returns:
the minimum degree.

getMaxDegree

public int getMaxDegree()
Returns maximum degree for corresponding role reference.

Returns:
the maximum degree.

getRefMBeanClassName

public java.lang.String getRefMBeanClassName()

Returns name of type of MBean expected to be referenced in corresponding role.

Returns:
the name of the referenced type.

checkMinDegree

public boolean checkMinDegree(int theValue)
Returns a boolean to specify if given value is greater or equal than expected minimum degree (true if yes).

Parameters:
theValue - value
Returns:
true if greater or equal than minimum degree, false otherwise.

checkMaxDegree

public boolean checkMaxDegree(int theValue)
Returns a boolean to specify if given value is less or equal than expected maximum degree (true if yes).

Parameters:
theValue - value
Returns:
true if less or equal than maximum degree, false otherwise.

toString

public java.lang.String toString()
Returns a string describing the role info.

Returns:
a description of the role info.

SunONE Application Server v8.0 PE

Submit a bug or feature

Copyright 2003 Sun Microsystems, Inc. All rights reserved.