internal HttpServer.HttpServer GetCore() { if(core == null) { // create my dispatcher module var testModule = new DispatcherModule(GetClassList()); // create session handling var customComponents = new ComponentProvider(); var sessionStore = new MemorySessionStore(); sessionStore.ExpireTime = 5; customComponents.AddInstance<IHttpSessionStore>(sessionStore); core = new HttpServer.HttpServer(customComponents); core.Add(new HttpModuleWrapper(testModule)); } return core; }
/// <summary> /// Initializes a new instance of the <see cref="HttpServer"/> class. /// </summary> /// <param name="decoderProvider">Form decoders are used to convert different types of posted data to the <see cref="HttpInput"/> object types.</param> /// <param name="sessionStore">A session store is used to save and retrieve sessions</param> /// <param name="logWriter">The log writer.</param> /// <seealso cref="IFormDecoder"/> /// <seealso cref="FormDecoderProviders"/> /// <seealso cref="LogWriter"/> /// <seealso cref="IHttpSessionStore"/> public HttpServer(FormDecoderProvider decoderProvider, IHttpSessionStore sessionStore, ILogWriter logWriter) { Check.Require(decoderProvider, "decoderProvider"); Check.Require(sessionStore, "sessionStore"); _components = new ComponentProvider(); _components.AddInstance<FormDecoderProvider>(sessionStore); _components.AddInstance<IHttpSessionStore>(sessionStore); if (logWriter != null) _components.AddInstance<ILogWriter>(logWriter); _requestQueue = new RequestQueue(ProcessRequestWrapper); }
/// <summary> /// Initializes a new instance of the <see cref="HttpServer"/> class. /// </summary> /// <param name="decoderProvider">Form decoders are used to convert different types of posted data to the <see cref="HttpInput"/> object types.</param> /// <param name="logWriter">The log writer.</param> /// <seealso cref="IFormDecoder"/> /// <seealso cref="FormDecoderProviders"/> /// <seealso cref="LogWriter"/> public HttpServer(FormDecoderProvider decoderProvider, ILogWriter logWriter) { Check.Require(decoderProvider, "decoderProvider"); Check.Require(logWriter, "logWriter"); _components = new ComponentProvider(); _components.AddInstance<FormDecoderProvider>(decoderProvider); _requestQueue = new RequestQueue(ProcessRequestWrapper); }
/// <summary> /// Initializes a new instance of the <see cref="HttpServer"/> class. /// </summary> /// <param name="sessionStore">A session store is used to save and retrieve sessions</param> /// <seealso cref="IHttpSessionStore"/> public HttpServer(IHttpSessionStore sessionStore) { Check.Require(sessionStore, "sessionStore"); _components = new ComponentProvider(); _components.AddInstance<IHttpSessionStore>(sessionStore); _requestQueue = new RequestQueue(ProcessRequestWrapper); }