Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HttpServer" /> class.
        /// </summary>
        /// <param name="applicationHost">The application host.</param>
        /// <param name="logManager">The log manager.</param>
        /// <param name="serverName">Name of the server.</param>
        /// <param name="defaultRedirectpath">The default redirectpath.</param>
        /// <exception cref="System.ArgumentNullException">urlPrefix</exception>
        public HttpServer(IApplicationHost applicationHost, ILogManager logManager, string serverName, string defaultRedirectpath)
            : base()
        {
            if (logManager == null)
            {
                throw new ArgumentNullException("logManager");
            }
            if (applicationHost == null)
            {
                throw new ArgumentNullException("applicationHost");
            }
            if (string.IsNullOrEmpty(serverName))
            {
                throw new ArgumentNullException("serverName");
            }
            if (string.IsNullOrEmpty(defaultRedirectpath))
            {
                throw new ArgumentNullException("defaultRedirectpath");
            }

            ServerName          = serverName;
            DefaultRedirectPath = defaultRedirectpath;
            _logger             = logManager.GetLogger("HttpServer");

            LogManager.LogFactory = new ServerLogFactory(logManager);

            EndpointHostConfig.Instance.ServiceStackHandlerFactoryPath = null;
            EndpointHostConfig.Instance.MetadataRedirectPath           = "metadata";

            _containerAdapter = new ContainerAdapter(applicationHost);
        }
Esempio n. 2
0
        public HttpListenerHost(IApplicationHost applicationHost, ILogManager logManager, string serviceName, string handlerPath, string defaultRedirectPath, params Assembly[] assembliesWithServices)
            : base(serviceName, assembliesWithServices)
        {
            DefaultRedirectPath = defaultRedirectPath;
            HandlerPath         = handlerPath;

            _logger = logManager.GetLogger("HttpServer");

            _containerAdapter = new ContainerAdapter(applicationHost);
        }
Esempio n. 3
0
        public HttpListenerHost(IApplicationHost applicationHost,
                                ILogManager logManager,
                                IServerConfigurationManager config,
                                string serviceName,
                                string defaultRedirectPath, INetworkManager networkManager, params Assembly[] assembliesWithServices)
            : base(serviceName, assembliesWithServices)
        {
            DefaultRedirectPath = defaultRedirectPath;
            _networkManager     = networkManager;
            _config             = config;

            _logger = logManager.GetLogger("HttpServer");

            _containerAdapter = new ContainerAdapter(applicationHost);
        }
Esempio n. 4
0
        public HttpListenerHost(IApplicationHost applicationHost, ILogManager logManager, string serviceName, string handlerPath, string defaultRedirectPath, params Assembly[] assembliesWithServices)
            : base(serviceName, assembliesWithServices)
        {
            DefaultRedirectPath = defaultRedirectPath;
            ServerName          = serviceName;
            HandlerPath         = handlerPath;

            _logger = logManager.GetLogger("HttpServer");

            _containerAdapter = new ContainerAdapter(applicationHost);

            for (var i = 0; i < 1; i++)
            {
                _autoResetEvents.Add(new AutoResetEvent(false));
            }
        }