@Retention(value=RUNTIME) @Target(value=METHOD) public @interface JmxAttributeMethod
getXxx()
, isXxx()
, or setXxx()
for the xxx
field. The Xxx
should match
precisely to associate the get and set JMX features. For example, if you are getting and setting the fooBar
field then it should be getFooBar()
and setFooBar()
. isFooBar()
is also allowed if
foobar
is a boolean or Boolean field. Instead of annotating the methods, you can use the
JmxAttributeField
to annotate the fields you want to expose.
Notice that although the field-name is fooBar
with a lowercase 'f', the method name camel-cases it and turns
it into getFooBar()
with a capital 'F'. This class is similar to Spring's @ManagedAttribute. In addition,
the "getXxx()" method must not return void and must have no arguments. isXxx()
is allowed if it returns
boolean or Boolean and the method has no arguments. The "setXxx()" method must return void and must take a single
argument -- the same argument as the getter returns.
@JmxAttributeMethod(description = "Number of times our cache was hit") public int getCacheHitCount() {
Modifier and Type | Optional Element and Description |
---|---|
String |
description
Description of the attribute for jconsole.
|
public abstract String description
This documentation content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.