Search in sources :

Example 26 with AbstractApplicationContext

use of org.springframework.context.support.AbstractApplicationContext 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)

Example 27 with AbstractApplicationContext

use of org.springframework.context.support.AbstractApplicationContext in project ignite by apache.

the class GridServiceInjectionSpringResourceTest method startNodes.

/**
     *
     * @throws Exception If failed.
     */
private void startNodes() throws Exception {
    AbstractApplicationContext ctxSpring = new FileSystemXmlApplicationContext(springCfgFileOutTmplName + 0);
    // We have to deploy Services for service is available at the bean creation time for other nodes.
    Ignite ignite = (Ignite) ctxSpring.getBean("testIgnite");
    ignite.services().deployMultiple(SERVICE_NAME, new DummyServiceImpl(), NODES, 1);
    // Add other nodes.
    for (int i = 1; i < NODES; ++i) new FileSystemXmlApplicationContext(springCfgFileOutTmplName + i);
    assertEquals(NODES, G.allGrids().size());
    assertEquals(NODES, ignite.cluster().nodes().size());
}
Also used : FileSystemXmlApplicationContext(org.springframework.context.support.FileSystemXmlApplicationContext) AbstractApplicationContext(org.springframework.context.support.AbstractApplicationContext) Ignite(org.apache.ignite.Ignite)

Aggregations

AbstractApplicationContext (org.springframework.context.support.AbstractApplicationContext)27 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)13 Test (org.junit.Test)6 ApplicationContext (org.springframework.context.ApplicationContext)6 CamelContext (org.apache.camel.CamelContext)4 ProducerTemplate (org.apache.camel.ProducerTemplate)3 ComponentLifecycle (com.cloud.utils.component.ComponentLifecycle)2 GlobalSettings (com.openmeap.model.dto.GlobalSettings)2 Method (java.lang.reflect.Method)2 AfterClass (org.junit.AfterClass)2 FileSystemXmlApplicationContext (org.springframework.context.support.FileSystemXmlApplicationContext)2 StopWatch (org.springframework.util.StopWatch)2 AuthorizerImpl (com.openmeap.AuthorizerImpl)1 InvalidPropertiesException (com.openmeap.model.InvalidPropertiesException)1 ModelManager (com.openmeap.model.ModelManager)1 ModelServiceImpl (com.openmeap.model.ModelServiceImpl)1 ClusterNode (com.openmeap.model.dto.ClusterNode)1 MapPayloadEvent (com.openmeap.model.event.MapPayloadEvent)1 Result (com.openmeap.services.dto.Result)1 JSONObject (com.openmeap.thirdparty.org.json.me.JSONObject)1