Search in sources :

Example 16 with FileSystemXmlApplicationContext

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

FileSystemXmlApplicationContext (org.springframework.context.support.FileSystemXmlApplicationContext)16 ApplicationContext (org.springframework.context.ApplicationContext)10 File (java.io.File)8 Map (java.util.Map)8 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)7 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)5 BeansException (org.springframework.beans.BeansException)5 MalformedURLException (java.net.MalformedURLException)4 ArrayList (java.util.ArrayList)4 Appender (org.apache.log4j.Appender)4 NullAppender (org.apache.log4j.varia.NullAppender)4 CommandLine (org.apache.commons.cli.CommandLine)3 CommandLineParser (org.apache.commons.cli.CommandLineParser)3 GnuParser (org.apache.commons.cli.GnuParser)3 Options (org.apache.commons.cli.Options)3 ParseException (org.apache.commons.cli.ParseException)3 URL (java.net.URL)2 Collection (java.util.Collection)2 ConsoleAppender (org.apache.log4j.ConsoleAppender)2 RollingFileAppender (org.apache.log4j.RollingFileAppender)2