Пример #1
0
        private static void Main(string[] args)
        {
            try
            {
                BootstrapLogger();

                _log.Info("Starting up ");

                if (args.Length > 1)
                {
                    string line = GetUnparsedCommandLine();

                    ProcessLine(line);
                }
                else
                {
                    RunInteractiveConsole();
                }
            }
            finally
            {
                Console.WriteLine("Shutting down...");

                TransportCache.Clear();
            }
        }
Пример #2
0
		static void Main()
		{
			BootstrapLogger();

			_pending = new List<IPendingCommand>();

			try
			{
				Transports = new TransportCache();
				Transports.AddTransportFactory(new LoopbackTransportFactory());
				Transports.AddTransportFactory(new MsmqTransportFactory());
				Transports.AddTransportFactory(new RabbitMqTransportFactory());

				string line = CommandLine.GetUnparsedCommandLine();
				if (line.IsNotEmpty())
				{
					ProcessLine(line);
				}
				else
				{
					_appender.Threshold = Level.All;
					RunInteractiveConsole();
				}
			}
			finally
			{
				WaitForPendingCommands();

				if (_bus != null)
				{
					_log.Debug("Disposing of service bus instance");
					_bus.Dispose();
					_bus = null;
				}

				Transports.Dispose();
				Transports = null;

				_log.Debug("End of Line.");
			}
		}
Пример #3
0
		static void Main()
		{
			BootstrapLogger();

			_pending = new List<IPendingCommand>();

			try
			{
				Transports = new TransportCache();
				Transports.AddTransportFactory(new LoopbackTransportFactory());
				Transports.AddTransportFactory(new MsmqTransportFactory());
				Transports.AddTransportFactory(new RabbitMqTransportFactory());

				string line = CommandLine.GetUnparsedCommandLine().Trim();
				if (line.IsNotEmpty())
				{
					ProcessLine(line);
				}
				else
				{
					_appender.Threshold = Level.All;
					RunInteractiveConsole();
				}
			}
			finally
			{
				WaitForPendingCommands();

			    foreach (var bus in _buses)
			    {
			        _log.DebugFormat("Disposing of service bus instance: {0}", bus.Endpoint.Address.Uri);
			        bus.Dispose();
			    }
			    _buses.Clear();

				Transports.Dispose();
				Transports = null;

				_log.Debug("End of Line.");
			}
		}
Пример #4
0
        static void Main()
        {
            BootstrapLogger();

            _pending = new List <IPendingCommand>();

            try
            {
                Transports = new TransportCache();
                Transports.AddTransportFactory(new LoopbackTransportFactory());
                Transports.AddTransportFactory(new MsmqTransportFactory());
                Transports.AddTransportFactory(new RabbitMqTransportFactory());

                string line = CommandLine.GetUnparsedCommandLine().Trim();
                if (line.IsNotEmpty())
                {
                    ProcessLine(line);
                }
                else
                {
                    _appender.Threshold = Level.All;
                    RunInteractiveConsole();
                }
            }
            finally
            {
                WaitForPendingCommands();

                if (_bus != null)
                {
                    _log.Debug("Disposing of service bus instance");
                    _bus.Dispose();
                    _bus = null;
                }

                Transports.Dispose();
                Transports = null;

                _log.Debug("End of Line.");
            }
        }
Пример #5
0
        static void Main()
        {
            BootstrapLogger();

            _pending = new List <IPendingCommand>();

            try
            {
                Transports = new TransportCache();
                Transports.AddTransportFactory(new LoopbackTransportFactory());
                Transports.AddTransportFactory(new RabbitTransportFactory());

                string line = CommandLine.GetUnparsedCommandLine().Trim();
                if (line.IsNotEmpty())
                {
                    ProcessLine(line);
                }
                else
                {
                    _appender.Threshold = Level.All;
                    RunInteractiveConsole();
                }
            }
            finally
            {
                WaitForPendingCommands();

                foreach (var bus in _buses)
                {
                    _log.DebugFormat("Disposing of service bus instance: {0}", bus.Endpoint.Address.Uri);
                    bus.Dispose();
                }
                _buses.Clear();

                Transports.Dispose();
                Transports = null;

                _log.Debug("End of Line.");
            }
        }