public RemoteEventController(IEventRegistry eventRegistry, ServerStateService serverStateService, EventProviderService providerService)
 {
     _eventRegistry = eventRegistry;
     _serverStateService = serverStateService;
     _providerService = providerService;
     TranslateGuidToName();
 }
Ejemplo n.º 2
0
 public RemoteEventController(IEventRegistry eventRegistry, ServerStateService serverStateService, EventProviderService providerService)
 {
     _eventRegistry      = eventRegistry;
     _serverStateService = serverStateService;
     _providerService    = providerService;
     TranslateGuidToName();
 }
Ejemplo n.º 3
0
        protected override void OnStart(string[] args)
        {
            log.Info("Starting...");
            try
            {
                //Set current directory to assembly folder
                System.Environment.CurrentDirectory =
                    System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);

                ServerStateService svcState = new ServerStateService();
                RemotingServices.Marshal(svcState, "rServerStateService");
                svcState.AfterPropertiesSet();

                // Force Spring to load configuration
                ContextRegistry.GetContext();

                // Define channel security
                IEnumerator channelEnum = ChannelServices.RegisteredChannels.GetEnumerator();
                while (channelEnum.MoveNext())
                {
                    BasicChannelWithSecurity channel = channelEnum.Current as BasicChannelWithSecurity;
                    if (channel != null)
                    {
                        channel.ITransportContext.IKeyStore.SetKey("/BAUMAX/SES",
                                                                   new KeyProvider_SelfEstablishingSymmetric());
                    }
                }

                Baumax.AppServer.Environment.ServerEnvironment.Configure();

                Scheduler.Scheduler sch = new Scheduler.Scheduler();
                sch.AfterPropertiesSet();

                svcState.ServerReady = true;

                log.Info("Server listening...");
            }
            catch (Exception e)
            {
                log.Fatal(e);
                // how to (should we) inform starter about failure during startup?
                // currently starting from service explorer causes just message
                // that service was started and then ended right after that
                throw;
            }
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            log.Info("Starting...");
            try
            {
                ServerStateService svcState = new ServerStateService();
                RemotingServices.Marshal(svcState, "rServerStateService");
                svcState.AfterPropertiesSet();

                // Force Spring to load configuration
                IApplicationContext ctx = ContextRegistry.GetContext();

                // Define channel security
                IEnumerator channelEnum = ChannelServices.RegisteredChannels.GetEnumerator();
                while (channelEnum.MoveNext())
                {
                    BasicChannelWithSecurity channel = channelEnum.Current as BasicChannelWithSecurity;
                    if (channel != null)
                    {
                        channel.ITransportContext.IKeyStore.SetKey("/BAUMAX/SES", new KeyProvider_SelfEstablishingSymmetric());
                    }
                }

                Baumax.AppServer.Environment.ServerEnvironment.Configure();

                Scheduler.Scheduler sch = new Scheduler.Scheduler();
                sch.AfterPropertiesSet();

                svcState.ServerReady = true;

                log.Info("Server listening...");
            }
            catch (Exception e)
            {
                log.Fatal(e);
            }
            finally
            {
                System.Console.Out.WriteLine("--- Press <return> to quit ---");
                System.Console.ReadLine();
            }
        }
Ejemplo n.º 5
0
 public SaveServerStateJob(IDbContext context)
 {
     _hostingEnvironment = GlobalContext.HostingEnvironment;
     _server             = new ServerStateService(context);
 }