Java Reference
In-Depth Information
public MBeanAttributeInfo( String name, String description,
java.lang.reflect.Method getter,
java.lang.reflect.Method setter )
public MBeanAttributeInfo( String name, String type, String
description, boolean isReadable,
boolean isWritable, boolean isIs )
You create an instance of
MBeanAttributeInfo
by either specifying all the details
of an attribute (the second constructor) or passing in the
Method
objects for the
getter and setter methods for the attribute.
The constructor that accepts the
Method
arguments only uses them to get the
information it needs to describe the attribute. The
Method
parameters are not
stored for invocation when it is time to access the attribute.
Objects access information from an
MBeanAttributeInfo
class by calling one
of the provided convenience methods:
■
getType()
—Returns the attribute's class type (such as
java.lang.String
)
■
isReadable()
—Returns a
boolean
value indicating whether this attribute
is readable
■
isWritable()
—Returns a
boolean
value indicating whether this attribute
is writable
■
isIs()
—Returns a
boolean
value indicating whether this attribute is acces-
sible using an
is
type method
5.3.5
The MBeanOperationInfo class
The
MBeanOperationInfo
class is the metadata class that encapsulates an opera-
tion exposed by an MBean. Just like some of the other metadata classes, it can be
constructed in two ways: by using a
Method
object or by passing in a signature and
a return value type. The following are its two constructors:
public MBeanOperationInfo( String description,
java.lang.reflect.Method method
public MBeanOperationInfo( String name, String description,
MBeanParameterInfo[] signature,
String type, int impact )
Notice that the second constructor takes an
int
argument called
impact
. The
MBeanOperationInfo
class defines four
public static final
member variables
containing values for this argument. These values describe the impact of invok-
ing the specified operation: