Top Description Fields Constructors Methods
javax.management.modelmbean

public Class ModelMBeanOperationInfo

extends MBeanOperationInfo
implements DescriptorAccess
Class Inheritance
All Implemented Interfaces
javax.management.DescriptorAccess, javax.management.DescriptorRead
Annotations
@SuppressWarnings:serial
Static Imports
com.sun.jmx.defaults.JmxProperties.MODELMBEAN_LOGGER

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 fields in the descriptor are defined, but not limited to, the following. Note that when the Type in this table is Number, a String that is the decimal representation of a Long can also be used.

ModelMBeanOperationInfo Fields
NameTypeMeaning
nameString Operation name.
descriptorTypeString Must be "operation".
classString Class where method is defined (fully qualified).
roleString Must be "operation", "getter", or "setter".
targetObjectObject Object on which to execute this method.
targetTypeString type of object reference for targetObject. Can be: ObjectReference | Handle | EJBHandle | IOR | RMIReference.
valueObject Cached value for operation.
displayNameString Human readable display name of the operation.
currencyTimeLimitNumber How long cached value is valid.
lastUpdatedTimeStampNumber When cached value was set.
visibilityNumber 1-4 where 1: always visible 4: rarely visible.
presentationStringString XML formatted string to describe how to present operation

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.

Note

because of inconsistencies in previous versions of this specification, it is recommended not to use negative or zero values for currencyTimeLimit. To indicate that a cached value is never valid, omit the currencyTimeLimit field. To indicate that it is always valid, use a very large number for this field.

The serialVersionUID of this class is 6532732096650090465L.

Since
1.5

Field Summary

Modifier and TypeField and Description
private static boolean
private static final String
private static final ObjectStreamField[]
private static final long
private static final ObjectStreamField[]
private static final long
private Descriptor
private static final ObjectStreamField[]
private static final long
Inherited from javax.management.MBeanOperationInfo:
ACTIONACTION_INFOINFOUNKNOWN

Constructor Summary

AccessConstructor and Description
public
ModelMBeanOperationInfo(String
A human readable description of the operation.
description
,
Method
The java.lang.reflect.Method object describing the MBean operation.
operationMethod
)

Constructs a ModelMBeanOperationInfo object with a default descriptor.

public
ModelMBeanOperationInfo(String
A human readable description of the operation.
description
,
Method
The java.lang.reflect.Method object describing the MBean operation.
operationMethod
,
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 the fields "displayName" or "role", the missing ones are added with their default values.
descriptor
)

Constructs a ModelMBeanOperationInfo object.

public
ModelMBeanOperationInfo(String
The name of the method.
name
,
String
A human readable description of the operation.
description
,
MBeanParameterInfo[]
MBeanParameterInfo objects describing the parameters(arguments) of the method.
signature
,
String
The type of the method's return value.
type
,
int
The impact of the method, one of INFO, ACTION, ACTION_INFO, UNKNOWN.
impact
)

Constructs a ModelMBeanOperationInfo object with a default descriptor.

public
ModelMBeanOperationInfo(String
The name of the method.
name
,
String
A human readable description of the operation.
description
,
MBeanParameterInfo[]
MBeanParameterInfo objects describing the parameters(arguments) of the method.
signature
,
String
The type of the method's return value.
type
,
int
The impact of the method, one of INFO, ACTION, ACTION_INFO, UNKNOWN.
impact
,
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 fields "displayName" or "role", the missing ones are added with their default values.
descriptor
)

Constructs a ModelMBeanOperationInfo object.

public
ModelMBeanOperationInfo(ModelMBeanOperationInfo
the ModelMBeanOperationInfo to be duplicated
inInfo
)

Constructs a new ModelMBeanOperationInfo object from this ModelMBeanOperation Object.

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides javax.management.MBeanOperationInfo.clone.

Creates and returns a new ModelMBeanOperationInfo which is a duplicate of this ModelMBeanOperationInfo.

public Descriptor

Returns:

Descriptor associated with the ModelMBeanOperationInfo object.
getDescriptor
()

Overrides javax.management.MBeanFeatureInfo.getDescriptor.

Implements javax.management.DescriptorRead.getDescriptor.

Returns a copy of the associated Descriptor of the ModelMBeanOperationInfo.

private void
public void
setDescriptor(Descriptor
replaces the Descriptor associated with the ModelMBeanOperation.
inDescriptor
)

Implements javax.management.DescriptorAccess.setDescriptor.

Sets associated Descriptor (full replace) for the ModelMBeanOperationInfo If the new Descriptor is null, then the associated Descriptor reverts to a default descriptor.

public String
toString()

Overrides javax.management.MBeanOperationInfo.toString.

Returns a string containing the entire contents of the ModelMBeanOperationInfo in human readable form.

private Descriptor
validDescriptor(final Descriptor
Descriptor to be checked, or null which is equivalent to an empty Descriptor.
in
)

Clones the passed in Descriptor, sets default values, and checks for validity.

private void
Inherited from javax.management.MBeanOperationInfo:
equalsgetImpactgetReturnTypegetSignaturehashCode

Field Detail

compatback to summary
private static boolean compat
currClassback to summary
private static final String currClass
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
operationDescriptorback to summary
private Descriptor operationDescriptor
serialPersistentFieldsback to summary
private static final ObjectStreamField[] serialPersistentFields
Serial Fields:
operationDescriptor:Descriptor
The descriptor containing the appropriate metadata for this instance
serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.management.MBeanOperationInfo.serialVersionUID.

Constructor Detail

ModelMBeanOperationInfoback to summary
public ModelMBeanOperationInfo(String description, Method operationMethod)

Constructs a ModelMBeanOperationInfo object with a default descriptor. The Descriptor of the constructed object will include fields contributed by any annotations on the Method object that contain the DescriptorKey meta-annotation.

Parameters
description:String

A human readable description of the operation.

operationMethod:Method

The java.lang.reflect.Method object describing the MBean operation.

ModelMBeanOperationInfoback to summary
public ModelMBeanOperationInfo(String description, Method operationMethod, Descriptor descriptor)

Constructs a ModelMBeanOperationInfo object. The Descriptor of the constructed object will include fields contributed by any annotations on the Method object that contain the DescriptorKey meta-annotation.

Parameters
description:String

A human readable description of the operation.

operationMethod:Method

The java.lang.reflect.Method object describing the MBean operation.

descriptor: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 the fields "displayName" or "role", the missing ones are added with their default values.

Exceptions
RuntimeOperationsException:
Wraps an IllegalArgumentException. The descriptor is invalid; or descriptor field "name" is not equal to operation name; or descriptor field "DescriptorType" is not equal to "operation"; or descriptor optional field "role" is present but not equal to "operation", "getter", or "setter".
ModelMBeanOperationInfoback to summary
public ModelMBeanOperationInfo(String name, String description, MBeanParameterInfo[] signature, String type, int impact)

Constructs a ModelMBeanOperationInfo object with a default descriptor.

Parameters
name:String

The name of the method.

description:String

A human readable description of the operation.

signature:MBeanParameterInfo[]

MBeanParameterInfo objects describing the parameters(arguments) of the method.

type:String

The type of the method's return value.

impact:int

The impact of the method, one of INFO, ACTION, ACTION_INFO, UNKNOWN.

ModelMBeanOperationInfoback to summary
public ModelMBeanOperationInfo(String name, String description, MBeanParameterInfo[] signature, String type, int impact, Descriptor descriptor)

Constructs a ModelMBeanOperationInfo object.

Parameters
name:String

The name of the method.

description:String

A human readable description of the operation.

signature:MBeanParameterInfo[]

MBeanParameterInfo objects describing the parameters(arguments) of the method.

type:String

The type of the method's return value.

impact:int

The impact of the method, one of INFO, ACTION, ACTION_INFO, UNKNOWN.

descriptor: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 fields "displayName" or "role", the missing ones are added with their default values.

Exceptions
RuntimeOperationsException:
Wraps an IllegalArgumentException. The descriptor is invalid; or descriptor field "name" is not equal to operation name; or descriptor field "DescriptorType" is not equal to "operation"; or descriptor optional field "role" is present but not equal to "operation", "getter", or "setter".
ModelMBeanOperationInfoback to summary
public ModelMBeanOperationInfo(ModelMBeanOperationInfo inInfo)

Constructs a new ModelMBeanOperationInfo object from this ModelMBeanOperation Object.

Parameters
inInfo:ModelMBeanOperationInfo

the ModelMBeanOperationInfo to be duplicated

Method Detail

cloneback to summary
public Object clone()

Overrides javax.management.MBeanOperationInfo.clone.

Creates and returns a new ModelMBeanOperationInfo which is a duplicate of this ModelMBeanOperationInfo.

Returns:Object

Doc from java.lang.Object.clone.

a clone of this instance.

getDescriptorback to summary
public Descriptor getDescriptor()

Overrides javax.management.MBeanFeatureInfo.getDescriptor.

Implements javax.management.DescriptorRead.getDescriptor.

Returns a copy of the associated Descriptor of the ModelMBeanOperationInfo.

Returns:Descriptor

Descriptor associated with the ModelMBeanOperationInfo object.

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

Hides javax.management.MBeanFeatureInfo.readObject.

Deserializes a ModelMBeanOperationInfo from an ObjectInputStream.

setDescriptorback to summary
public void setDescriptor(Descriptor inDescriptor)

Implements javax.management.DescriptorAccess.setDescriptor.

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.

Parameters
inDescriptor:Descriptor

replaces the Descriptor associated with the ModelMBeanOperation.

Exceptions
RuntimeOperationsException:
Wraps an IllegalArgumentException for invalid Descriptor.
See Also
getDescriptor
toStringback to summary
public String toString()

Overrides javax.management.MBeanOperationInfo.toString.

Returns a string containing the entire contents of the ModelMBeanOperationInfo in human readable form.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

validDescriptorback to summary
private Descriptor validDescriptor(final Descriptor in) throws RuntimeOperationsException

Clones the passed in Descriptor, sets default values, and checks for validity. If the Descriptor is invalid (for instance by having the wrong "name"), this indicates programming error and a RuntimeOperationsException will be thrown. The following fields will be defaulted if they are not already set: displayName=this.getName(),name=this.getName(), descriptorType="operation", role="operation"

Parameters
in:Descriptor

Descriptor to be checked, or null which is equivalent to an empty Descriptor.

Exceptions
RuntimeOperationsException:
if Descriptor is invalid
writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException

Hides javax.management.MBeanFeatureInfo.writeObject.

Serializes a ModelMBeanOperationInfo to an ObjectOutputStream.