Standard MBean

public interface Memory
             MBean {
    public MemoryUsage getUsage();
}
public class Memory implements Memory
             MBean {
    public MemoryUsage getMemoryUsage() {
         return memoryUsageSnapshot();
    }
    private static native MemoryUsage
            memoryUsageSnapshot();
    ...
}
          
 

MXBean

public interface Memory
             MXBean {
    public MemoryUsage getUsage();
}
public class Memory implements Memory
             MXBean {
    public MemoryUsage getMemoryUsage() {
         return memoryUsageSnapshot();
    }
    private static native MemoryUsage
            memoryUsageSnapshot();
    ...
}