The ModelMBeanOperationInfo object describes a management operation of the ModelMBean.
It is a subclass of MBeanOperationInfo with the addition of an associated Descriptor
and an implementation of the DescriptorAccess interface.
The default descriptor will have name, descriptorType, displayName and role fields set.
The default value of the name and displayName fields is the operation name.
| Constructor: |
public ModelMBeanOperationInfo(ModelMBeanOperationInfo inInfo) {
super(inInfo.getName(),
inInfo.getDescription(),
inInfo.getSignature(),
inInfo.getReturnType(),
inInfo.getImpact());
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
MODELMBEAN_LOGGER.logp(Level.FINER,
ModelMBeanOperationInfo.class.getName(),
"ModelMBeanOperationInfo(ModelMBeanOperationInfo)",
"Entry");
}
Descriptor newDesc = inInfo.getDescriptor();
operationDescriptor = validDescriptor(newDesc);
}
Constructs a new ModelMBeanOperationInfo object from this
ModelMBeanOperation Object. Parameters:
inInfo - the ModelMBeanOperationInfo to be duplicated
|
public ModelMBeanOperationInfo(String description,
Method operationMethod) {
super(description, operationMethod);
// create default descriptor
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
MODELMBEAN_LOGGER.logp(Level.FINER,
ModelMBeanOperationInfo.class.getName(),
"ModelMBeanOperationInfo(String,Method)",
"Entry");
}
operationDescriptor = validDescriptor(null);
}
Constructs a ModelMBeanOperationInfo object with a default
descriptor. The Descriptor of the constructed
object will include fields contributed by any annotations
on the {@code Method} object that contain the DescriptorKey meta-annotation. Parameters:
operationMethod - The java.lang.reflect.Method object
describing the MBean operation.
description - A human readable description of the operation.
|
public ModelMBeanOperationInfo(String description,
Method operationMethod,
Descriptor descriptor) {
super(description, operationMethod);
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
MODELMBEAN_LOGGER.logp(Level.FINER,
ModelMBeanOperationInfo.class.getName(),
"ModelMBeanOperationInfo(String,Method,Descriptor)",
"Entry");
}
operationDescriptor = validDescriptor(descriptor);
}
Constructs a ModelMBeanOperationInfo object. The Descriptor of the constructed object will include fields
contributed by any annotations on the {@code Method} object
that contain the DescriptorKey meta-annotation. Parameters:
operationMethod - The java.lang.reflect.Method object
describing the MBean operation.
description - A human readable description of the
operation.
descriptor - An instance of Descriptor containing the
appropriate metadata for this instance of the
ModelMBeanOperationInfo. If it is null a default
descriptor will be created. If the descriptor does not
contain all the fields "name", "descriptorType",
"displayName", and "role", the missing ones are added with
their default values.
Throws:
RuntimeOperationsException - Wraps an
IllegalArgumentException. The descriptor is invalid; or
descriptor field "name" is present but not equal to
operation name; or descriptor field "DescriptorType" is
present but not equal to "operation"; or descriptor
optional field "role" is not equal to "operation",
"getter", or "setter".
- exception:
RuntimeOperationsException - Wraps an
IllegalArgumentException. The descriptor is invalid; or
descriptor field "name" is present but not equal to
operation name; or descriptor field "DescriptorType" is
present but not equal to "operation"; or descriptor
optional field "role" is not equal to "operation",
"getter", or "setter".
|
public ModelMBeanOperationInfo(String name,
String description,
MBeanParameterInfo[] signature,
String type,
int impact) {
super(name, description, signature, type, impact);
// create default descriptor
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
MODELMBEAN_LOGGER.logp(Level.FINER,
ModelMBeanOperationInfo.class.getName(),
"ModelMBeanOperationInfo(" +
"String,String,MBeanParameterInfo[],String,int)",
"Entry");
}
operationDescriptor = validDescriptor(null);
}
Constructs a ModelMBeanOperationInfo object with a default descriptor. Parameters:
name - The name of the method.
description - A human readable description of the operation.
signature - MBeanParameterInfo objects describing the
parameters(arguments) of the method.
type - The type of the method's return value.
impact - The impact of the method, one of INFO, ACTION,
ACTION_INFO, UNKNOWN.
|
public ModelMBeanOperationInfo(String name,
String description,
MBeanParameterInfo[] signature,
String type,
int impact,
Descriptor descriptor) {
super(name, description, signature, type, impact);
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
MODELMBEAN_LOGGER.logp(Level.FINER,
ModelMBeanOperationInfo.class.getName(),
"ModelMBeanOperationInfo(String,String," +
"MBeanParameterInfo[],String,int,Descriptor)",
"Entry");
}
operationDescriptor = validDescriptor(descriptor);
}
Constructs a ModelMBeanOperationInfo object. Parameters:
name - The name of the method.
description - A human readable description of the operation.
signature - MBeanParameterInfo objects describing the
parameters(arguments) of the method.
type - The type of the method's return value.
impact - The impact of the method, one of INFO, ACTION,
ACTION_INFO, UNKNOWN.
descriptor - An instance of Descriptor containing the
appropriate metadata for this instance of the
MBeanOperationInfo. If it is null then a default descriptor
will be created. If the descriptor does not contain all the
fields "name", "descriptorType", "displayName", and "role",
the missing ones are added with their default values.
Throws:
RuntimeOperationsException - Wraps an
IllegalArgumentException. The descriptor is invalid; or
descriptor field "name" is present but not equal to
operation name; or descriptor field "DescriptorType" is
present but not equal to "operation"; or descriptor optional
field "role" is not equal to "operation", "getter", or
"setter".
- exception:
RuntimeOperationsException - Wraps an
IllegalArgumentException. The descriptor is invalid; or
descriptor field "name" is present but not equal to
operation name; or descriptor field "DescriptorType" is
present but not equal to "operation"; or descriptor optional
field "role" is not equal to "operation", "getter", or
"setter".
|
| Method from javax.management.modelmbean.ModelMBeanOperationInfo Detail: |
public Object clone() {
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
MODELMBEAN_LOGGER.logp(Level.FINER,
ModelMBeanOperationInfo.class.getName(),
"clone()", "Entry");
}
return(new ModelMBeanOperationInfo(this)) ;
}
Creates and returns a new ModelMBeanOperationInfo which is a
duplicate of this ModelMBeanOperationInfo. |
public Descriptor getDescriptor() {
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
MODELMBEAN_LOGGER.logp(Level.FINER,
ModelMBeanOperationInfo.class.getName(),
"getDescriptor()", "Entry");
}
if (operationDescriptor == null) {
operationDescriptor = validDescriptor(null);
}
return((Descriptor) operationDescriptor.clone());
}
Returns a copy of the associated Descriptor of the
ModelMBeanOperationInfo. |
public void setDescriptor(Descriptor inDescriptor) {
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
MODELMBEAN_LOGGER.logp(Level.FINER,
ModelMBeanOperationInfo.class.getName(),
"setDescriptor(Descriptor)", "Entry");
}
operationDescriptor = validDescriptor(inDescriptor);
}
Sets associated Descriptor (full replace) for the
ModelMBeanOperationInfo If the new Descriptor is null, then
the associated Descriptor reverts to a default descriptor.
The Descriptor is validated before it is assigned. If the
new Descriptor is invalid, then a
RuntimeOperationsException wrapping an
IllegalArgumentException is thrown. |
public String toString() {
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
MODELMBEAN_LOGGER.logp(Level.FINER,
ModelMBeanOperationInfo.class.getName(),
"toString()", "Entry");
}
String retStr =
"ModelMBeanOperationInfo: " + this.getName() +
" ; Description: " + this.getDescription() +
" ; Descriptor: " + this.getDescriptor() +
" ; ReturnType: " + this.getReturnType() +
" ; Signature: ";
MBeanParameterInfo[] pTypes = this.getSignature();
for (int i=0; i < pTypes.length; i++)
{
retStr = retStr.concat((pTypes[i]).getType() + ", ");
}
return retStr;
}
Returns a string containing the entire contents of the
ModelMBeanOperationInfo in human readable form. |