com.j256.simplejmx.common
Annotation Type JmxOperation


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface JmxOperation

This identifies which methods are operations. It is added to methods that are _not_ named "get...", "set...", or "is...". The method can either return void or an object. It is recommended that the method return a simple object that will be for sure in jconsole's classpath. It also should not throw an unknown exception class. This class is similar to Spring's @ManagedOperation.

 @JmxOperation(description = "Reset our max/min values",
               parameterNames = { "minValue", "maxValue" },
               parameterDescriptions = { "low water mark", "high water mark" }
 public void resetMaxMin(int minValue, int maxValue) {
    ...
 

Author:
graywatson

Optional Element Summary
 int action
          Deprecated. Should use the enumerated operationAction().
 String description
          Description of the attribute for jconsole.
 JmxOperationInfo.OperationAction operationAction
          This optional is used by the JMX system to describe what sort of work is being done in this operation.
 String[] parameterDescriptions
          Optional array of strings which describes each of the method parameters.
 String[] parameterNames
          Optional array of strings which gives the name of each of the method parameters.
 

description

public abstract String description
Description of the attribute for jconsole. Default is something like "someMethod operation".

Default:
""

parameterNames

public abstract String[] parameterNames
Optional array of strings which gives the name of each of the method parameters. The array should be the same length as the parameterDescriptions() array. Default is something like "p0". For example:

 @JmxOperation(parameterNames = { "minValue", "maxValue" },
               parameterDescriptions = { "low water mark", "high water mark" }
 public void resetMaxMin(int minValue, int maxValue) {
 ...
 

Default:
{}

parameterDescriptions

public abstract String[] parameterDescriptions
Optional array of strings which describes each of the method parameters. The array should be the same length as the parameterNames() array. If not specified then it will create one with the parameter number and type -- something like "parameter #0 of type: int".

 @JmxOperation(parameterNames = { "minValue", "maxValue" },
               parameterDescriptions = { "low water mark", "high water mark" }
 public void resetMaxMin(int minValue, int maxValue) {
 ...
 

Default:
{}

operationAction

public abstract JmxOperationInfo.OperationAction operationAction
This optional is used by the JMX system to describe what sort of work is being done in this operation.

Default:
com.j256.simplejmx.common.JmxOperationInfo.OperationAction.UNKNOWN

action

@Deprecated
public abstract int action
Deprecated. Should use the enumerated operationAction().

Default:
3


This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.