Search in sources :

Example 6 with LifecycleBean

use of org.apache.ignite.lifecycle.LifecycleBean in project ignite by apache.

the class SpringTransactionManagerContextInjectionTest method testBeanInjectionUsingConfigPath.

/**
     * @throws Exception If failed.
     */
public void testBeanInjectionUsingConfigPath() throws Exception {
    BeanFactory factory = new AnnotationConfigApplicationContext(TestPathConfiguration.class);
    Ignite grid = IgnitionEx.grid("springInjectionTest");
    IgniteConfiguration cfg = grid.configuration();
    LifecycleBean[] beans = cfg.getLifecycleBeans();
    assertEquals(2, beans.length);
    TestInjectionLifecycleBean bean1 = (TestInjectionLifecycleBean) beans[0];
    TestInjectionLifecycleBean bean2 = (TestInjectionLifecycleBean) beans[1];
    bean1.checkState();
    bean2.checkState();
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BeanFactory(org.springframework.beans.factory.BeanFactory) LifecycleBean(org.apache.ignite.lifecycle.LifecycleBean) TestInjectionLifecycleBean(org.apache.ignite.TestInjectionLifecycleBean) Ignite(org.apache.ignite.Ignite) TestInjectionLifecycleBean(org.apache.ignite.TestInjectionLifecycleBean)

Aggregations

LifecycleBean (org.apache.ignite.lifecycle.LifecycleBean)6 Ignite (org.apache.ignite.Ignite)4 IgniteCache (org.apache.ignite.IgniteCache)2 TestInjectionLifecycleBean (org.apache.ignite.TestInjectionLifecycleBean)2 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)2 RuntimeMXBean (java.lang.management.RuntimeMXBean)1 DecimalFormat (java.text.DecimalFormat)1 ArrayList (java.util.ArrayList)1 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteClientDisconnectedException (org.apache.ignite.IgniteClientDisconnectedException)1 IgniteException (org.apache.ignite.IgniteException)1 ClusterMetrics (org.apache.ignite.cluster.ClusterMetrics)1 ClusterNode (org.apache.ignite.cluster.ClusterNode)1 GridManager (org.apache.ignite.internal.managers.GridManager)1 GridCheckpointManager (org.apache.ignite.internal.managers.checkpoint.GridCheckpointManager)1 GridCollisionManager (org.apache.ignite.internal.managers.collision.GridCollisionManager)1 GridIoManager (org.apache.ignite.internal.managers.communication.GridIoManager)1 GridDeploymentManager (org.apache.ignite.internal.managers.deployment.GridDeploymentManager)1 GridDiscoveryManager (org.apache.ignite.internal.managers.discovery.GridDiscoveryManager)1