private IApplicationHost CreateAppHost(Type appHostType, object appHostConfig, WebAppConfig appConfig, IListenerTransport listenerTransport, Type appHostTransportType, object appHostTransportConfig) { Logger.Write(LogLevel.Debug, "SimpleApplicationServer.CreateAppHost vhost={0}, vport={1}", appConfig.VHost, appConfig.VPort); try { IApplicationHost host = hostFactory.CreateApplicationHost(appHostType, appConfig.VHost, appConfig.VPort, appConfig.VPath, appConfig.RealPath); host.Configure(appHostConfig, appConfig, this, listenerTransport, appHostTransportType, appHostTransportConfig); //subscribe to Unload event only after run host.Configure //because apphost transport must unregister himself first host.HostUnload += OnHostUnload; lock (hosts) { hosts.Add(new HostInfo() { Host = host, AppHostType = appHostType, AppHostConfig = appHostConfig, AppConfig = appConfig, ListenerTransport = listenerTransport, AppHostTransportType = appHostTransportType, AppHostTransportConfig = appHostTransportConfig }); } return(host); } catch (Exception ex) { Logger.Write(LogLevel.Error, "Can't create host {0}", ex); return(null); } }
public void Configure(object conf, IApplicationServer server, Type listenerTransport, object listenerTransportConfig, Type appHostTransport, object appHostTransportConfig) { this.server = server; this.config = conf as ListenerConfig; transport = (IListenerTransport)Activator.CreateInstance (listenerTransport); transport.Configure (this, listenerTransportConfig); appHostTransportType = appHostTransport; }
public void Configure(object conf, IApplicationServer server, Type listenerTransport, object listenerTransportConfig, Type appHostTransport, object appHostTransportConfig) { this.server = server; this.config = conf as ListenerConfig; transport = (IListenerTransport)Activator.CreateInstance(listenerTransport); transport.Configure(this, listenerTransportConfig); appHostTransportType = appHostTransport; }
public IApplicationHost CreateApplicationHost(Type appHostType, object appHostConfig, object webAppConfig, IListenerTransport listenerTransport, Type appHostTransportType, object appHostTransportConfig) { WebAppConfig appConfig = webAppConfig as WebAppConfig; if (appConfig == null) { Logger.Write(LogLevel.Error, "Web application is not specified"); return(null); } return(CreateAppHost(appHostType, appHostConfig, appConfig, listenerTransport, appHostTransportType, appHostTransportConfig)); }
public override void Configure (object appHostConfig, object webAppConfig, IApplicationServer server, IListenerTransport listenerTransport, Type appHostTransportType, object transportConfig) { AspNetHostConfig config = appHostConfig as AspNetHostConfig; if (config != null) { LogLevel = config.Log.Level; LogToConsole = config.Log.WriteToConsole; AddTrailingSlash = config.AddTrailingSlash; } base.Configure (appHostConfig, webAppConfig, server, listenerTransport, appHostTransportType, transportConfig); }
public override void Configure(object appHostConfig, object webAppConfig, IApplicationServer server, IListenerTransport listenerTransport, Type appHostTransportType, object transportConfig) { AspNetHostConfig config = appHostConfig as AspNetHostConfig; if (config != null) { LogLevel = config.Log.Level; LogToConsole = config.Log.WriteToConsole; AddTrailingSlash = config.AddTrailingSlash; } base.Configure(appHostConfig, webAppConfig, server, listenerTransport, appHostTransportType, transportConfig); }
public virtual void Configure (object appHostConfig, object webAppConfig, IApplicationServer server, IListenerTransport listenerTransport, Type appHostTransportType, object transportConfig) { WebAppConfig appConfig = webAppConfig as WebAppConfig; if (appConfig != null) { vport = appConfig.VPort; vhost = appConfig.VHost; vpath = appConfig.VPath; path = appConfig.RealPath; } appServer = server; this.listenerTransport = listenerTransport; appHostTransport = (IApplicationHostTransport) Activator.CreateInstance (appHostTransportType); appHostTransport.Configure (this, transportConfig); }
public virtual void Configure (object appHostConfig, object webAppConfig, IApplicationServer server, IListenerTransport listenerTransport, Type appHostTransportType, object transportConfig) { WebAppConfig appConfig = webAppConfig as WebAppConfig; if (appConfig != null) { vport = appConfig.VPort; vhost = appConfig.VHost; vpath = appConfig.VPath; path = appConfig.RealPath; } appServer = server; physicalRoot = server.PhysicalRoot; this.listenerTransport = listenerTransport; appHostTransport = (IApplicationHostTransport) Activator.CreateInstance (appHostTransportType); appHostTransport.Configure (this, transportConfig); Logger.Write (LogLevel.Debug, "Configured host in domain {0}, id={1}", AppDomain.CurrentDomain.FriendlyName, AppDomain.CurrentDomain.Id); }
public virtual void Configure(object appHostConfig, object webAppConfig, IApplicationServer server, IListenerTransport listenerTransport, Type appHostTransportType, object transportConfig) { WebAppConfig appConfig = webAppConfig as WebAppConfig; if (appConfig != null) { vport = appConfig.VPort; vhost = appConfig.VHost; vpath = appConfig.VPath; path = appConfig.RealPath; } appServer = server; this.listenerTransport = listenerTransport; appHostTransport = (IApplicationHostTransport)Activator.CreateInstance(appHostTransportType); appHostTransport.Configure(this, transportConfig); }
public override void Configure (object appHostConfig, object webAppConfig, IApplicationServer server, IListenerTransport listenerTransport, Type appHostTransportType, object transportConfig) { RawHostConfig config = appHostConfig as RawHostConfig; if (config != null) { Logger.Level = config.Log.Level; Logger.WriteToConsole = config.Log.WriteToConsole; requestType = Type.GetType(config.RequestType); if (requestType == null) { Logger.Write(LogLevel.Error, "Couldn't find type '{0}'", config.RequestType); throw new ArgumentException ("appHostConfig.Type"); } CreateRequestInstance = CreateDynamicMethod (requestType); } base.Configure (appHostConfig, webAppConfig, server, listenerTransport, appHostTransportType, transportConfig); }
public virtual void Configure(object appHostConfig, object webAppConfig, IApplicationServer server, IListenerTransport listenerTransport, Type appHostTransportType, object transportConfig) { WebAppConfig appConfig = webAppConfig as WebAppConfig; if (appConfig != null) { vport = appConfig.VPort; vhost = appConfig.VHost; vpath = appConfig.VPath; path = appConfig.RealPath; } appServer = server; physicalRoot = server.PhysicalRoot; this.listenerTransport = listenerTransport; appHostTransport = (IApplicationHostTransport)Activator.CreateInstance(appHostTransportType); appHostTransport.Configure(this, transportConfig); Logger.Write(LogLevel.Debug, "Configured host in domain {0}, id={1}", AppDomain.CurrentDomain.FriendlyName, AppDomain.CurrentDomain.Id); }
public override void Configure(object appHostConfig, object webAppConfig, IApplicationServer server, IListenerTransport listenerTransport, Type appHostTransportType, object transportConfig) { RawHostConfig config = appHostConfig as RawHostConfig; if (config != null) { Logger.Level = config.Log.Level; Logger.WriteToConsole = config.Log.WriteToConsole; requestType = Type.GetType(config.RequestType); if (requestType == null) { Logger.Write(LogLevel.Error, "Couldn't find type '{0}'", config.RequestType); throw new ArgumentException("appHostConfig.Type"); } CreateRequestInstance = CreateDynamicMethod(requestType); } base.Configure(appHostConfig, webAppConfig, server, listenerTransport, appHostTransportType, transportConfig); }
private IApplicationHost CreateAppHost(Type appHostType, object appHostConfig, WebAppConfig appConfig, IListenerTransport listenerTransport, Type appHostTransportType, object appHostTransportConfig) { try { IApplicationHost host = hostFactory.CreateApplicationHost (appHostType, appConfig.VHost, appConfig.VPort, appConfig.VPath, appConfig.RealPath); host.Configure (appHostConfig, appConfig, this, listenerTransport, appHostTransportType, appHostTransportConfig); //subscribe to Unload event only after run host.Configure //because apphost transport must unregister himself first host.HostUnload += OnHostUnload; lock (hosts) { hosts.Add (new HostInfo () { Host = host, AppHostType = appHostType, AppHostConfig = appHostConfig, AppConfig = appConfig, ListenerTransport = listenerTransport, AppHostTransportType = appHostTransportType, AppHostTransportConfig = appHostTransportConfig }); } return host; } catch (Exception ex) { Logger.Write (LogLevel.Error, "Can't create host {0}", ex); return null; } }
public IApplicationHost CreateApplicationHost(Type appHostType, object appHostConfig, object webAppConfig, IListenerTransport listenerTransport, Type appHostTransportType, object appHostTransportConfig) { WebAppConfig appConfig = webAppConfig as WebAppConfig; if (appConfig == null) { Logger.Write (LogLevel.Error, "Web application is not specified"); return null; } return CreateAppHost (appHostType, appHostConfig, appConfig, listenerTransport, appHostTransportType, appHostTransportConfig); }