Search in sources :

Example 1 with ComponentLifecycle

use of com.cloud.utils.component.ComponentLifecycle in project cloudstack by apache.

the class NetworkProviderTest method globalTearDown.

@AfterClass
public static void globalTearDown() throws Exception {
    s_lockMaster.cleanupForServer(s_msId);
    JmxUtil.unregisterMBean("Locks", "Locks");
    s_lockMaster = null;
    AbstractApplicationContext ctx = (AbstractApplicationContext) ComponentContext.getApplicationContext();
    Map<String, ComponentLifecycle> lifecycleComponents = ctx.getBeansOfType(ComponentLifecycle.class);
    for (ComponentLifecycle bean : lifecycleComponents.values()) {
        bean.stop();
    }
    ctx.close();
    s_logger.info("destroying mysql server instance running at port <" + s_mysqlSrverPort + ">");
    TestDbSetup.destroy(s_mysqlSrverPort, null);
}
Also used : AbstractApplicationContext(org.springframework.context.support.AbstractApplicationContext) ComponentLifecycle(com.cloud.utils.component.ComponentLifecycle) AfterClass(org.junit.AfterClass)

Example 2 with ComponentLifecycle

use of com.cloud.utils.component.ComponentLifecycle in project cloudstack by apache.

the class CloudStackExtendedLifeCycle method sortBeans.

private void sortBeans() {
    for (ComponentLifecycle lifecycle : getBeans(ComponentLifecycle.class)) {
        Set<ComponentLifecycle> set = sorted.get(lifecycle.getRunLevel());
        if (set == null) {
            set = new HashSet<ComponentLifecycle>();
            sorted.put(lifecycle.getRunLevel(), set);
        }
        set.add(lifecycle);
    }
}
Also used : ComponentLifecycle(com.cloud.utils.component.ComponentLifecycle)

Example 3 with ComponentLifecycle

use of com.cloud.utils.component.ComponentLifecycle in project cloudstack by apache.

the class PublicNetworkTest method globalTearDown.

@AfterClass
public static void globalTearDown() throws Exception {
    s_lockMaster.cleanupForServer(s_msId);
    JmxUtil.unregisterMBean("Locks", "Locks");
    s_lockMaster = null;
    AbstractApplicationContext ctx = (AbstractApplicationContext) ComponentContext.getApplicationContext();
    Map<String, ComponentLifecycle> lifecycleComponents = ctx.getBeansOfType(ComponentLifecycle.class);
    for (ComponentLifecycle bean : lifecycleComponents.values()) {
        bean.stop();
    }
    ctx.close();
    s_logger.info("destroying mysql server instance running at port <" + s_mysqlServerPort + ">");
    TestDbSetup.destroy(s_mysqlServerPort, null);
}
Also used : AbstractApplicationContext(org.springframework.context.support.AbstractApplicationContext) ComponentLifecycle(com.cloud.utils.component.ComponentLifecycle) AfterClass(org.junit.AfterClass)

Aggregations

ComponentLifecycle (com.cloud.utils.component.ComponentLifecycle)3 AfterClass (org.junit.AfterClass)2 AbstractApplicationContext (org.springframework.context.support.AbstractApplicationContext)2