Executing JMX operations (exec) Beside attribute provides a way for the execution of exposed JMX operations with optional arguments. The same as for writing attributes, Jolokia must be able to serialize the arguments. See for details. Execution of overloaded methods is supported. The JMX specifications recommends to avoid overloaded methods when exposing them via JMX, though.
GET exec request The format of an GET exec request is /exec/////....]]> GET Exec Request
Part Description Example
<mbean name> MBean's ObjectName java.lang:type=Threading
<operation name> Name of the operation to execute. If this is an overloaded method, it is mandatory to provide a method signature as well. A signature consist the fully qualified argument class names or native types, separated by commas and enclosed with parentheses. For calling a non-argument overloaded method use () as signature. loadUsers(java.lang.String,int)
<arg1>, <arg2>, ... String representation for the arguments required to execute this operation. Only certain data types can be used here as described in . "true","true"
The following request will trigger a garbage collection: http://localhost:8080/jolokia/exec/java.lang:type=Memory/gc
POST exec request POST Exec Request
Key Description Example
type exec
mbean MBean's ObjectName java.lang:type=Threading
operation The operation to execute, optionally with a signature as described above. dumpAllThreads
arguments An array of arguments for invoking this operation. The value must be serializable as described in . [true,true]
The following request dumps all threads (along with locked monitors and locked synchronizers, thats what the boolean arguments are for):
Exec response For an exec operation, the response contains the return value of the operation. null is returned if either the operation returns a null value or the operation is declared as void. A typical response for an URL like looks like The return value get serialized as described in .