| Constructor: |
public RoleInfo(RoleInfo roleInfo) throws IllegalArgumentException {
if (roleInfo == null) {
// Revisit [cebro] Localize message
String excMsg = "Invalid parameter.";
throw new IllegalArgumentException(excMsg);
}
try {
init(roleInfo.getName(),
roleInfo.getRefMBeanClassName(),
roleInfo.isReadable(),
roleInfo.isWritable(),
roleInfo.getMinDegree(),
roleInfo.getMaxDegree(),
roleInfo.getDescription());
} catch (InvalidRoleInfoException exc3) {
// OK : Can never happen as the minimum degree and the maximum
// degree were already checked at the time the roleInfo
// instance was created.
}
}
Parameters:
roleInfo - the RoleInfo instance to be copied.
Throws:
IllegalArgumentException - if null parameter
- exception:
IllegalArgumentException - if null parameter
|
public RoleInfo(String roleName,
String mbeanClassName) throws IllegalArgumentException, ClassNotFoundException, NotCompliantMBeanException {
try {
init(roleName,
mbeanClassName,
true,
true,
1,
1,
null);
} catch (InvalidRoleInfoException exc) {
// OK : Can never happen as the minimum
// degree equals the maximum degree.
}
return;
}
Parameters:
roleName - name of the role
mbeanClassName - 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.
Throws:
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.
- exception:
IllegalArgumentException - if null parameter
- exception:
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.
- exception:
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.
|
public RoleInfo(String roleName,
String mbeanClassName,
boolean read,
boolean write) throws IllegalArgumentException, ClassNotFoundException, NotCompliantMBeanException {
try {
init(roleName,
mbeanClassName,
read,
write,
1,
1,
null);
} catch (InvalidRoleInfoException exc) {
// OK : Can never happen as the minimum
// degree equals the maximum degree.
}
return;
}
|
public RoleInfo(String roleName,
String mbeanClassName,
boolean read,
boolean write,
int min,
int max,
String descr) throws IllegalArgumentException, InvalidRoleInfoException, ClassNotFoundException, NotCompliantMBeanException {
//
// Constructors
//
init(roleName,
mbeanClassName,
read,
write,
min,
max,
descr);
return;
}
Parameters:
roleName - name of the role.
mbeanClassName - 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 - flag to indicate if the corresponding role
can be read
write - flag to indicate if the corresponding role
can be set
min - 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 - 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 - description of the role (can be null)
Throws:
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.
- exception:
IllegalArgumentException - if null parameter
- exception:
InvalidRoleInfoException - if the minimum degree is
greater than the maximum degree.
- exception:
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.
- exception:
NotCompliantMBeanException - if the class mbeanClassName
is not a MBean class.
|
| Method from javax.management.relation.RoleInfo Detail: |
public boolean checkMaxDegree(int value) {
if (value >= ROLE_CARDINALITY_INFINITY &&
(maxDegree == ROLE_CARDINALITY_INFINITY ||
(value != ROLE_CARDINALITY_INFINITY &&
value < = maxDegree))) {
return true;
} else {
return false;
}
}
Returns true if the value parameter is lower than or equal to
the expected maximum degree, false otherwise. |
public boolean checkMinDegree(int value) {
if (value >= ROLE_CARDINALITY_INFINITY &&
(minDegree == ROLE_CARDINALITY_INFINITY
|| value >= minDegree)) {
return true;
} else {
return false;
}
}
Returns true if the value parameter is greater than or equal to
the expected minimum degree, false otherwise. |
public String getDescription() {
return description;
}
Returns description text for the role. |
public int getMaxDegree() {
return maxDegree;
}
Returns maximum degree for corresponding role reference. |
public int getMinDegree() {
return minDegree;
}
Returns minimum degree for corresponding role reference. |
public String getName() {
return name;
}
Returns the name of the role. |
public String getRefMBeanClassName() {
return referencedMBeanClassName;
}
|
public boolean isReadable() {
return isReadable;
}
Returns read access mode for the role (true if it is readable). |
public boolean isWritable() {
return isWritable;
}
Returns write access mode for the role (true if it is writable). |
public String toString() {
StringBuilder result = new StringBuilder();
result.append("role info name: " + name);
result.append("; isReadable: " + isReadable);
result.append("; isWritable: " + isWritable);
result.append("; description: " + description);
result.append("; minimum degree: " + minDegree);
result.append("; maximum degree: " + maxDegree);
result.append("; MBean class: " + referencedMBeanClassName);
return result.toString();
}
Returns a string describing the role info. |