Table of Contents

Mycila JMX

This small project enables to export your classes easily through JMX.

Maven Repository


Available in Maven Central Repository:


Available in OSS Repository:

Maven dependency


Maven sites


1. Annotations

2. Dynamic naming

A bean can implement the interface JmxSelfNaming to return the its ObjectName

3. How to use

Supposing you have annotated your class like this

public final class MyService {

    private String name;

    private int internalField = 10;

    public String getName() { return name; }

    public void setName(String name) { = name; }

    @JmxMethod(parameters = {@JmxParam(value = "number", description = "put a big number please !")})
    void increment(int n) {
        internalField += n;

Then create an exporter which will be able to export your beans:

MycilaJmxExporter exporter = new MycilaJmxExporter();

And export your service:


4. JmxMetadataAssembler

JmxMetadataAssembler are implementations which describes the exportable members of a class and how to export them. Several implementation exist:


CustomMetadataAssembler assembler = new CustomMetadataAssembler()
    .addAttribute(MyClass.class, "myRWField")
    .addProperty(MyClass.class, "myProperty")
    .addOperation(MyClass.class, "goMethod");

You will be able to find other examples in the Unit Tests

5. Mycile Guice Integration

When using the service discovery feature of Mycile Guice (Google Guice extensions) JMX annoteated beans are automatically discovered and exported

6. Tools alpha