Top Description Fields Constructors Methods
javax.management.relation

public Class RoleInfo

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Annotations
@SuppressWarnings:serial
Imports
com.sun.jmx.mbeanserver.GetPropertyAction, java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .ObjectStreamField, .Serializable, java.security.AccessController, javax.management.MBeanServer, .NotCompliantMBeanException

A RoleInfo object summarises a role in a relation type.

The serialVersionUID of this class is 2504952983494636987L.

Since
1.5

Field Summary

Modifier and TypeField and Description
private static boolean
private String
private boolean
private boolean
private int
private int
private String
private static final ObjectStreamField[]
private static final long
private static final ObjectStreamField[]
private static final long
private String
public static final int
ROLE_CARDINALITY_INFINITY

To specify an unlimited cardinality.

private static final ObjectStreamField[]
private static final long

Constructor Summary

AccessConstructor and Description
public
RoleInfo(String
name of the role.
roleName
,
String
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, mbeanClassName).
mbeanClassName
,
boolean
flag to indicate if the corresponding role can be read
read
,
boolean
flag to indicate if the corresponding role can be set
write
,
int
minimum degree for role, i.e. minimum number of MBeans to provide in corresponding role Must be less than or equal to max. (ROLE_CARDINALITY_INFINITY for unlimited)
min
,
int
maximum degree for role, i.e. maximum number of MBeans to provide in corresponding role Must be greater than or equal to min (ROLE_CARDINALITY_INFINITY for unlimited)
max
,
String
description of the role (can be null)
descr
)

Constructor.

public
RoleInfo(String
name of the role
roleName
,
String
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, mbeanClassName).
mbeanClassName
,
boolean
flag to indicate if the corresponding role can be read
read
,
boolean
flag to indicate if the corresponding role can be set

Minimum and maximum degrees defaulted to 1.

Description of role defaulted to null.

write
)

Constructor.

public
RoleInfo(String
name of the role
roleName
,
String
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, mbeanClassName).

IsReadable and IsWritable defaulted to true.

Minimum and maximum degrees defaulted to 1.

Description of role defaulted to null.

mbeanClassName
)

Constructor.

public
RoleInfo(RoleInfo
the RoleInfo instance to be copied.
roleInfo
)

Copy constructor.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if lower than or equal to maximum degree, false otherwise.
checkMaxDegree
(int
the value to be checked
value
)

Returns true if the value parameter is lower than or equal to the expected maximum degree, false otherwise.

public boolean

Returns:

true if greater than or equal to minimum degree, false otherwise.
checkMinDegree
(int
the value to be checked
value
)

Returns true if the value parameter is greater than or equal to the expected minimum degree, false otherwise.

public String

Returns:

the description of the role.
getDescription
()

Returns description text for the role.

public int

Returns:

the maximum degree.
getMaxDegree
()

Returns maximum degree for corresponding role reference.

public int

Returns:

the minimum degree.
getMinDegree
()

Returns minimum degree for corresponding role reference.

public String

Returns:

the name of the role.
getName
()

Returns the name of the role.

public String

Returns:

the name of the referenced type.
getRefMBeanClassName
()

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

private void
init(String roleName, String mbeanClassName, boolean read, boolean write, int min, int max, String descr)

public boolean

Returns:

true if the role is readable.
isReadable
()

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

public boolean

Returns:

true if the role is writable.
isWritable
()

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

private void
public String

Returns:

a description of the role info.
toString
()

Overrides java.lang.Object.toString.

Returns a string describing the role info.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

compatback to summary
private static boolean compat
descriptionback to summary
private String description
isReadableback to summary
private boolean isReadable
isWritableback to summary
private boolean isWritable
maxDegreeback to summary
private int maxDegree
minDegreeback to summary
private int minDegree
nameback to summary
private String name
newSerialPersistentFieldsback to summary
private static final ObjectStreamField[] newSerialPersistentFields
newSerialVersionUIDback to summary
private static final long newSerialVersionUID
oldSerialPersistentFieldsback to summary
private static final ObjectStreamField[] oldSerialPersistentFields
oldSerialVersionUIDback to summary
private static final long oldSerialVersionUID
referencedMBeanClassNameback to summary
private String referencedMBeanClassName
ROLE_CARDINALITY_INFINITYback to summary
public static final int ROLE_CARDINALITY_INFINITY

To specify an unlimited cardinality.

serialPersistentFieldsback to summary
private static final ObjectStreamField[] serialPersistentFields
Serial Fields:
name:String
Role name
isReadable:boolean
Read access mode: true if role is readable
isWritable:boolean
Write access mode: true if role is writable
description:String
Role description
minDegree:int
Minimum degree (i.e. minimum number of referenced MBeans in corresponding role)
maxDegree:int
Maximum degree (i.e. maximum number of referenced MBeans in corresponding role)
referencedMBeanClassName:String
Name of class of MBean(s) expected to be referenced in corresponding role
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

RoleInfoback to summary
public RoleInfo(String roleName, String mbeanClassName, boolean read, boolean write, int min, int max, String descr) throws IllegalArgumentException, InvalidRoleInfoException, ClassNotFoundException, NotCompliantMBeanException

Constructor.

Parameters
roleName:String

name of the role.

mbeanClassName:String

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, mbeanClassName).

read:boolean

flag to indicate if the corresponding role can be read

write:boolean

flag to indicate if the corresponding role can be set

min:int

minimum degree for role, i.e. minimum number of MBeans to provide in corresponding role Must be less than or equal to max. (ROLE_CARDINALITY_INFINITY for unlimited)

max:int

maximum degree for role, i.e. maximum number of MBeans to provide in corresponding role Must be greater than or equal to min (ROLE_CARDINALITY_INFINITY for unlimited)

descr:String

description of the role (can be null)

Exceptions
IllegalArgumentException:
if null parameter
InvalidRoleInfoException:
if the minimum degree is greater than the maximum degree.
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 mbeanClassName is not a MBean class.
RoleInfoback to summary
public RoleInfo(String roleName, String mbeanClassName, boolean read, boolean write) throws IllegalArgumentException, ClassNotFoundException, NotCompliantMBeanException

Constructor.

Parameters
roleName:String

name of the role

mbeanClassName:String

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, mbeanClassName).

read:boolean

flag to indicate if the corresponding role can be read

write:boolean

flag to indicate if the corresponding role can be set

Minimum and maximum degrees defaulted to 1.

Description of role defaulted to null.

Exceptions
IllegalArgumentException:
if null parameter
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.
RoleInfoback to summary
public RoleInfo(String roleName, String mbeanClassName) throws IllegalArgumentException, ClassNotFoundException, NotCompliantMBeanException

Constructor.

Parameters
roleName:String

name of the role

mbeanClassName:String

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, mbeanClassName).

IsReadable and IsWritable defaulted to true.

Minimum and maximum degrees defaulted to 1.

Description of role defaulted to null.

Exceptions
IllegalArgumentException:
if null parameter
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.
RoleInfoback to summary
public RoleInfo(RoleInfo roleInfo) throws IllegalArgumentException

Copy constructor.

Parameters
roleInfo:RoleInfo

the RoleInfo instance to be copied.

Exceptions
IllegalArgumentException:
if null parameter

Method Detail

checkMaxDegreeback to summary
public boolean checkMaxDegree(int value)

Returns true if the value parameter is lower than or equal to the expected maximum degree, false otherwise.

Parameters
value:int

the value to be checked

Returns:boolean

true if lower than or equal to maximum degree, false otherwise.

checkMinDegreeback to summary
public boolean checkMinDegree(int value)

Returns true if the value parameter is greater than or equal to the expected minimum degree, false otherwise.

Parameters
value:int

the value to be checked

Returns:boolean

true if greater than or equal to minimum degree, false otherwise.

getDescriptionback to summary
public String getDescription()

Returns description text for the role.

Returns:String

the description of the role.

getMaxDegreeback to summary
public int getMaxDegree()

Returns maximum degree for corresponding role reference.

Returns:int

the maximum degree.

getMinDegreeback to summary
public int getMinDegree()

Returns minimum degree for corresponding role reference.

Returns:int

the minimum degree.

getNameback to summary
public String getName()

Returns the name of the role.

Returns:String

the name of the role.

getRefMBeanClassNameback to summary
public String getRefMBeanClassName()

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

Returns:String

the name of the referenced type.

initback to summary
private void init(String roleName, String mbeanClassName, boolean read, boolean write, int min, int max, String descr) throws IllegalArgumentException, InvalidRoleInfoException
isReadableback to summary
public boolean isReadable()

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

Returns:boolean

true if the role is readable.

isWritableback to summary
public boolean isWritable()

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

Returns:boolean

true if the role is writable.

readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException

Deserializes a RoleInfo from an ObjectInputStream.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string describing the role info.

Returns:String

a description of the role info.

writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException

Serializes a RoleInfo to an ObjectOutputStream.