コード例 #1
0
ファイル: ServerManager.cs プロジェクト: jrgcubano/zetbox
        public void Start(ZetboxConfig config)
        {
            if (container != null) { throw new InvalidOperationException("already started"); }

            Logging.Configure();
            AssemblyLoader.Bootstrap(AppDomain.CurrentDomain, config);

            container = Program.CreateMasterContainer(config);

            wcfServer = container.Resolve<IZetboxAppDomain>();
            wcfServer.Start(config);
        }
コード例 #2
0
        public void Start(ZetboxConfig config)
        {
            if (container != null)
            {
                throw new InvalidOperationException("already started");
            }

            Logging.Configure();
            AssemblyLoader.Bootstrap(AppDomain.CurrentDomain, config);

            container = Program.CreateMasterContainer(config);

            wcfServer = container.Resolve <IZetboxAppDomain>();
            wcfServer.Start(config);
        }
コード例 #3
0
        protected override void SetUp(IContainer container)
        {
            base.SetUp(container);
            ResetDatabase(container);

            AutofacServiceHostFactory.Container = container;

            var config = container.Resolve <ZetboxConfig>();

            using (Log.InfoTraceMethodCall("Starting server domain"))
            {
                manager = container.Resolve <IZetboxAppDomain>();
                manager.Start(config);
            }
        }
コード例 #4
0
ファイル: ServerDomainManager.cs プロジェクト: daszat/zetbox
        public void Start(ZetboxConfig config)
        {
            if (config == null) { throw new ArgumentNullException("config"); }

            using (Logging.Log.DebugTraceMethodCall("Start", "Starting AppDomain for Server"))
            {
                var serverConfig = new ZetboxConfig()
                {
                    ConfigFilePath = config.ConfigFilePath,
                    ConfigName = config.ConfigName,
                    EnableShadowCopy = config.EnableShadowCopy,
                    HostType = HostType.Server,
                    IsFallback = false,
                    Server = config.Server,
                };

                serverDomain = AppDomain.CreateDomain("ServerAppDomain",
                    AppDomain.CurrentDomain.Evidence,
                    AppDomain.CurrentDomain.SetupInformation);

                AssemblyLoader.Bootstrap(serverDomain, serverConfig);

                serverManager = (IZetboxAppDomain)serverDomain.CreateInstanceAndUnwrap(
                    "Zetbox.Server.Service",
                    "Zetbox.Server.Service.ServerManager");
                serverManager.Start(serverConfig);

                if (clientSponsor == null)
                {
                    clientSponsor = new ClientSponsor();
                    clientSponsor.RenewalTime = TimeSpan.FromMinutes(2);
                }

                clientSponsor.Register(serverManager as MarshalByRefObject);
            }
        }
コード例 #5
0
        public void Start(ZetboxConfig config)
        {
            using (Logging.Log.DebugTraceMethodCall("Start", "Starting AppDomain for Server"))
            {
                serverDomain = AppDomain.CreateDomain("ServerAppDomain",
                                                      AppDomain.CurrentDomain.Evidence,
                                                      AppDomain.CurrentDomain.SetupInformation);

                AssemblyLoader.Bootstrap(serverDomain, config);

                serverManager = (IZetboxAppDomain)serverDomain.CreateInstanceAndUnwrap(
                    "Zetbox.Server.Service",
                    "Zetbox.Server.Service.ServerManager");
                serverManager.Start(config);

                if (clientSponsor == null)
                {
                    clientSponsor             = new ClientSponsor();
                    clientSponsor.RenewalTime = TimeSpan.FromMinutes(2);
                }

                clientSponsor.Register(serverManager as MarshalByRefObject);
            }
        }
コード例 #6
0
        public void Start(ZetboxConfig config)
        {
            using (Logging.Log.DebugTraceMethodCall("Start", "Starting AppDomain for Server"))
            {
                serverDomain = AppDomain.CreateDomain("ServerAppDomain",
                    AppDomain.CurrentDomain.Evidence,
                    AppDomain.CurrentDomain.SetupInformation);

                AssemblyLoader.Bootstrap(serverDomain, config);

                serverManager = (IZetboxAppDomain)serverDomain.CreateInstanceAndUnwrap(
                    "Zetbox.Server.Service",
                    "Zetbox.Server.Service.ServerManager");
                serverManager.Start(config);

                if (clientSponsor == null)
                {
                    clientSponsor = new ClientSponsor();
                    clientSponsor.RenewalTime = TimeSpan.FromMinutes(2);
                }

                clientSponsor.Register(serverManager as MarshalByRefObject);
            }
        }
コード例 #7
0
ファイル: SetUpFixture.cs プロジェクト: jrgcubano/zetbox
        protected override void SetUp(IContainer container)
        {
            base.SetUp(container);
            ResetDatabase(container);

            AutofacServiceHostFactory.Container = container;

            var config = container.Resolve<ZetboxConfig>();

            using (Log.InfoTraceMethodCall("Starting server domain"))
            {
                manager = container.Resolve<IZetboxAppDomain>();
                manager.Start(config);
            }
        }