Search in sources :

Example 1 with ManagedComponentRequestLifeCycle

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

the class TestRootContainerManagedIntegration method testRootManagedRequestLifeCycle.

public void testRootManagedRequestLifeCycle() throws Exception {
    RootContainer container = createRootContainer("configuration5.xml");
    ManagedComponentRequestLifeCycle component = (ManagedComponentRequestLifeCycle) container.getComponentInstanceOfType(ManagedComponentRequestLifeCycle.class);
    assertNotNull(component);
    MBeanServer server = container.getMBeanServer();
    server.invoke(new ObjectName("exo:object=ManagedComponentRequestLifeCycle"), "foo", new Object[0], new String[0]);
    assertEquals(1, component.startCount);
    assertEquals(1, component.fooCount);
    assertEquals(1, component.endCount);
    assertSame(container, component.startContainer);
    assertSame(container, component.endContainer);
}
Also used : ManagedComponentRequestLifeCycle(org.exoplatform.container.jmx.support.ManagedComponentRequestLifeCycle) RootContainer(org.exoplatform.container.RootContainer) MBeanServer(javax.management.MBeanServer) ObjectName(javax.management.ObjectName)

Aggregations

MBeanServer (javax.management.MBeanServer)1 ObjectName (javax.management.ObjectName)1 RootContainer (org.exoplatform.container.RootContainer)1 ManagedComponentRequestLifeCycle (org.exoplatform.container.jmx.support.ManagedComponentRequestLifeCycle)1