public static void Main() { Console.WriteLine(); Console.WriteLine(">>> Lifecycle example started."); // Create new configuration. var lifecycleExampleBean = new LifecycleExampleBean(); var cfg = new IgniteConfiguration { SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", LifecycleBeans = new List <ILifecycleBean> { lifecycleExampleBean } }; // Provide lifecycle bean to configuration. using (Ignition.Start(cfg)) { // Make sure that lifecycle bean was notified about Ignite startup. Console.WriteLine(); Console.WriteLine(">>> Started (should be true): " + lifecycleExampleBean.Started); } // Make sure that lifecycle bean was notified about Ignite stop. Console.WriteLine(); Console.WriteLine(">>> Started (should be false): " + lifecycleExampleBean.Started); Console.WriteLine(); Console.WriteLine(">>> Example finished, press any key to exit ..."); Console.ReadKey(); }
public static void Main() { Console.WriteLine(); Console.WriteLine(">>> Lifecycle example started."); // Create new configuration. var lifecycleExampleBean = new LifecycleExampleBean(); var cfg = new IgniteConfiguration { SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", LifecycleBeans = new List<ILifecycleBean> { lifecycleExampleBean } }; // Provide lifecycle bean to configuration. using (Ignition.Start(cfg)) { // Make sure that lifecycle bean was notified about Ignite startup. Console.WriteLine(); Console.WriteLine(">>> Started (should be true): " + lifecycleExampleBean.Started); } // Make sure that lifecycle bean was notified about Ignite stop. Console.WriteLine(); Console.WriteLine(">>> Started (should be false): " + lifecycleExampleBean.Started); Console.WriteLine(); Console.WriteLine(">>> Example finished, press any key to exit ..."); Console.ReadKey(); }
public static void Main() { Console.WriteLine(); Console.WriteLine(">>> Lifecycle example started."); // Create new configuration. var lifecycleExampleBean = new LifecycleExampleBean(); var cfg = new IgniteConfiguration { DiscoverySpi = new TcpDiscoverySpi { IpFinder = new TcpDiscoveryStaticIpFinder { Endpoints = new[] { "127.0.0.1:47500" } } }, LifecycleBeans = new List <ILifecycleBean> { lifecycleExampleBean } }; // Provide lifecycle bean to configuration. using (Ignition.Start(cfg)) { // Make sure that lifecycle bean was notified about Ignite startup. Console.WriteLine(); Console.WriteLine(">>> Started (should be true): " + lifecycleExampleBean.Started); } // Make sure that lifecycle bean was notified about Ignite stop. Console.WriteLine(); Console.WriteLine(">>> Started (should be false): " + lifecycleExampleBean.Started); Console.WriteLine(); Console.WriteLine(">>> Example finished, press any key to exit ..."); Console.ReadKey(); }
public static void Main() { Console.WriteLine(); Console.WriteLine(">>> Lifecycle example started."); // Create new configuration. var lifecycleExampleBean = new LifecycleExampleBean(); var cfg = new IgniteConfiguration { DiscoverySpi = new TcpDiscoverySpi { IpFinder = new TcpDiscoveryStaticIpFinder { Endpoints = new[] {"127.0.0.1:47500"} } }, LifecycleBeans = new List<ILifecycleBean> {lifecycleExampleBean} }; // Provide lifecycle bean to configuration. using (Ignition.Start(cfg)) { // Make sure that lifecycle bean was notified about Ignite startup. Console.WriteLine(); Console.WriteLine(">>> Started (should be true): " + lifecycleExampleBean.Started); } // Make sure that lifecycle bean was notified about Ignite stop. Console.WriteLine(); Console.WriteLine(">>> Started (should be false): " + lifecycleExampleBean.Started); Console.WriteLine(); Console.WriteLine(">>> Example finished, press any key to exit ..."); Console.ReadKey(); }