Search in sources :

Example 1 with ExoMBeanInfoBuilder

use of org.exoplatform.management.jmx.impl.ExoMBeanInfoBuilder in project kernel by exoplatform.

the class AbstractExoMBeanTest method register.

protected Bean register(String name, Class clazz) {
    try {
        ObjectName objectName = ObjectName.getInstance(name);
        ModelMBeanInfo info = new ExoMBeanInfoBuilder(clazz).build();
        RequiredModelMBean mbean = new RequiredModelMBean(info);
        mbean.setManagedResource(clazz.newInstance(), "ObjectReference");
        server.registerMBean(mbean, objectName);
        return new Bean(objectName, (ModelMBeanInfo) server.getMBeanInfo(objectName));
    } catch (Exception e) {
        throw new AssertionError(e);
    }
}
Also used : ExoMBeanInfoBuilder(org.exoplatform.management.jmx.impl.ExoMBeanInfoBuilder) ModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) ObjectName(javax.management.ObjectName) RequiredModelMBean(javax.management.modelmbean.RequiredModelMBean) RequiredModelMBean(javax.management.modelmbean.RequiredModelMBean)

Example 2 with ExoMBeanInfoBuilder

use of org.exoplatform.management.jmx.impl.ExoMBeanInfoBuilder in project kernel by exoplatform.

the class AbstractExoMBeanTest method assertNotBuildable.

protected void assertNotBuildable(Class clazz) {
    try {
        new ExoMBeanInfoBuilder(clazz).build();
        fail();
    } catch (Exception ignore) {
    }
}
Also used : ExoMBeanInfoBuilder(org.exoplatform.management.jmx.impl.ExoMBeanInfoBuilder)

Aggregations

ExoMBeanInfoBuilder (org.exoplatform.management.jmx.impl.ExoMBeanInfoBuilder)2 ObjectName (javax.management.ObjectName)1 ModelMBeanInfo (javax.management.modelmbean.ModelMBeanInfo)1 RequiredModelMBean (javax.management.modelmbean.RequiredModelMBean)1