Search in sources :

Example 1 with ManagedByManager

use of org.exoplatform.container.jmx.support.ManagedByManager in project kernel by exoplatform.

the class TestManagedBy method testFoo.

public void testFoo() throws Exception {
    RootContainer root = createRootContainer("managedby-configuration.xml");
    MBeanServer server = root.getMBeanServer();
    ManagedByManager mbm = (ManagedByManager) root.getComponentInstance("ManagedByManager");
    assertNotNull(mbm);
    ObjectInstance instance = server.getObjectInstance(new ObjectName("exo:object=ManagedByManager"));
    Manager manager = (Manager) server.getAttribute(instance.getObjectName(), "Reference");
    assertNotNull(manager);
}
Also used : ObjectInstance(javax.management.ObjectInstance) ManagedByManager(org.exoplatform.container.jmx.support.ManagedByManager) Manager(org.exoplatform.container.jmx.support.Manager) ManagedByManager(org.exoplatform.container.jmx.support.ManagedByManager) RootContainer(org.exoplatform.container.RootContainer) MBeanServer(javax.management.MBeanServer) ObjectName(javax.management.ObjectName)

Aggregations

MBeanServer (javax.management.MBeanServer)1 ObjectInstance (javax.management.ObjectInstance)1 ObjectName (javax.management.ObjectName)1 RootContainer (org.exoplatform.container.RootContainer)1 ManagedByManager (org.exoplatform.container.jmx.support.ManagedByManager)1 Manager (org.exoplatform.container.jmx.support.Manager)1