Пример #1
0
        public void Init()
        {
            if (Instance != null)
            {
                throw new InvalidDataException("HttpListenerBase.Instance has already been set");
            }

            Instance = this;

            var serviceManager = EndpointHost.Config.ServiceManager;

            if (serviceManager != null)
            {
                serviceManager.Init();
                Configure(EndpointHost.Config.ServiceManager.Container);
            }
            else
            {
                Configure(null);
            }

            EndpointHost.AfterInit();
            SetAppDomainData();

            var elapsed = DateTime.UtcNow - this.startTime;

            Log.InfoFormat("Initializing Application took {0}ms", elapsed.TotalMilliseconds);
        }
Пример #2
0
        protected virtual void OnConfigure()
        {
            if (HasConfigured)
            {
                return;
            }

            HasConfigured = true;
            Configure(Container);
            EndpointHost.AfterInit();
        }
Пример #3
0
        public void Init()
        {
            if (Instance != null)
            {
                throw new InvalidDataException("HttpListenerBase.Instance has already been set");
            }

            Instance = this;

            var serviceManager = EndpointHost.Config.ServiceManager;

            if (serviceManager != null)
            {
                serviceManager.Init();
                Configure(EndpointHost.Config.ServiceManager.Container);
            }
            else
            {
                Configure(null);
            }
            if (serviceManager != null)
            {
                //Required for adhoc services added in Configure()
                serviceManager.ReloadServiceOperations();
                EndpointHost.SetOperationTypes(
                    serviceManager.ServiceOperations,
                    serviceManager.AllServiceOperations
                    );
            }

            EndpointHost.AfterInit();

            var elapsed = DateTime.Now - this.startTime;

            Log.InfoFormat("Initializing Application took {0}ms", elapsed.TotalMilliseconds);
        }