示例#1
0
        public static IDisposable Run(string[] args)
        {
            var configuration = ConreignSiloConfiguration.Load(
                ApplicationPath.CurrentDirectory,
                args
                );
            var silo   = ConreignSilo.Create(configuration);
            var logger = silo.Logger;
            var orleansConfiguration = silo.CreateOrleansConfiguration();
            var siloHost             = new SiloHost(Environment.MachineName, orleansConfiguration);

            try
            {
                siloHost.DeploymentId = configuration.ClusterId;
                siloHost.InitializeOrleansSilo();
                siloHost.StartOrleansSilo(false);
                logger.Information("Silo is started.");
                return(siloHost);
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Failed to start silo.");
                siloHost.Dispose();
                throw;
            }
        }
            public void Dispose()
            {
                host.StopOrleansSilo();
                host.Dispose();

                AppDomain.Unload(domain);
            }
示例#3
0
 private static void ShutdownSilo()
 {
     if (siloHost != null)
     {
         siloHost.Dispose();
         siloHost = null;
     }
 }
示例#4
0
 static void ShutdownSilo()
 {
     if (siloHost != null)
     {
         siloHost.Dispose();
         GC.SuppressFinalize(siloHost);
         siloHost = null;
     }
 }
示例#5
0
 protected void Application_End(object sender, EventArgs e)
 {
     if (siloHost != null)
     {
         siloHost.Dispose();
         GC.SuppressFinalize(siloHost);
         siloHost = null;
     }
 }
示例#6
0
 private static void ShutdownSilo()
 {
     if (null == _host)
     {
         return;
     }
     _host.StopOrleansSilo();
     _host.Dispose();
     _host = null;
 }
示例#7
0
        private static void ShutdownSilo()
        {
            if (_siloHost == null)
            {
                return;
            }

            _siloHost.Dispose();
            GC.SuppressFinalize(_siloHost);
            _siloHost = null;
        }
示例#8
0
        public override void Dispose()
        {
            if (host == null)
            {
                return;
            }

            host.StopOrleansSilo();
            host.UnInitializeOrleansSilo();
            host.Dispose();
            host = null;

            configurator.Dispose();
        }
        public static void GrainTestsClassCleanUp()
        {
            hostDomain.DoCallBack(() => {
                siloHost.Dispose();
                siloHost = null;
                AppDomain.Unload(hostDomain);
            });
            var startInfo = new ProcessStartInfo {
                FileName        = "taskkill",
                Arguments       = "/F /IM vstest.executionengine.x86.exe",
                UseShellExecute = false,
                WindowStyle     = ProcessWindowStyle.Hidden,
            };

            Process.Start(startInfo);
        }
示例#10
0
 public int Stop()
 {
     if (siloHost != null)
     {
         try
         {
             siloHost.StopOrleansSilo();
             siloHost.Dispose();
             Console.WriteLine($"Orleans silo '{siloHost.Name}' shutdown.");
         }
         catch (Exception exc)
         {
             siloHost.ReportStartupError(exc);
             Console.Error.WriteLine(exc);
             return(1);
         }
     }
     return(0);
 }
示例#11
0
        public bool Stop()
        {
            Console.WriteLine("Stopping SiloHost...");

            try
            {
                _siloHost.StopOrleansSilo();
                _siloHost.Dispose();
                GC.SuppressFinalize(_siloHost);
                Console.WriteLine($"Orleans silo '{_siloHost.Name}' shutdown.");
                return(true);
            }
            catch (Exception exc)
            {
                _siloHost.ReportStartupError(exc);
                var msg = $"{exc.GetType().FullName}:\n{exc.Message}\n{exc.StackTrace}";
                Console.WriteLine(msg);
                return(false);
            }
        }
示例#12
0
        /// <summary>
        /// Stop and dispose of running SiloHost
        /// </summary>
        /// <returns></returns>
        public int Stop()
        {
            if (_siloHost == null)
            {
                throw new OrleansException("There is no silo server running to stop");
            }

            try
            {
                _siloHost.ShutdownOrleansSilo();
                _siloHost.Dispose();

                Console.WriteLine($"Successfully stopped silo server {_siloHost.Name}");
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex);
                return(1);
            }

            return(0);
        }
示例#13
0
 protected virtual void Dispose(bool dispose)
 {
     siloHost.Dispose();
     siloHost = null;
 }