Added non-generic registration interface to IKernel and IWindsor to accommodate dynam...
[castle.git] / MonoRail / Castle.MonoRail.Framework / Services / DefaultEngineContextFactory.cs
blob1de410354601027735f246b33cf88f42a7d728ca
1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.MonoRail.Framework.Services
17 using System.Collections;
18 using System.Web;
19 using System.Web.SessionState;
20 using Castle.MonoRail.Framework.Adapters;
21 using Castle.MonoRail.Framework.Container;
23 /// <summary>
24 /// Pendent
25 /// </summary>
26 public class DefaultEngineContextFactory : IEngineContextFactory
28 /// <summary>
29 /// Pendent.
30 /// </summary>
31 /// <param name="container"></param>
32 /// <param name="urlInfo"></param>
33 /// <param name="context"></param>
34 /// <returns></returns>
35 public IEngineContext Create(IMonoRailContainer container, UrlInfo urlInfo, HttpContext context)
37 IDictionary session = ResolveRequestSession(container, urlInfo, context);
39 IUrlBuilder urlBuilder = container.UrlBuilder;
41 return new DefaultEngineContext(container, urlInfo, context,
42 new ServerUtilityAdapter(context.Server),
43 new RequestAdapter(context.Request),
44 new ResponseAdapter(context.Response, urlInfo, urlBuilder),
45 new TraceAdapter(context.Trace), session);
48 /// <summary>
49 /// Resolves the request session.
50 /// </summary>
51 protected virtual IDictionary ResolveRequestSession(IMonoRailContainer container, UrlInfo urlInfo, HttpContext context)
53 return null;