1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
18 using System
.ComponentModel
.Design
;
20 using System
.Security
.Principal
;
21 using System
.Collections
;
22 using System
.Collections
.Specialized
;
23 using Castle
.Components
.Binder
;
26 /// Represents an abstraction between the MonoRail API
27 /// and the ASP.Net API.
29 public interface IEngineContext
: IServiceContainer
32 /// Returns an <see cref="IServerUtility"/>.
34 IServerUtility Server { get; }
37 /// Gets the underlying context of the API being used.
39 HttpContext UnderlyingContext { get; }
42 /// Gets a reference to the MonoRail services.
44 /// <value>The services.</value>
45 IMonoRailServices Services { get; }
48 /// Access the session objects.
50 IDictionary Session { get; set; }
53 /// Gets the request object.
55 IRequest Request { get; }
58 /// Gets the response object.
60 IResponse Response { get; }
63 /// Gets the trace object.
68 /// Access a dictionary of volative items.
70 Flash Flash { get; set; }
73 // /// Transfer the execution to another resource.
75 // /// <param name="path"></param>
76 // /// <param name="preserveForm"></param>
77 // void Transfer( String path, bool preserveForm );
80 /// Gets or sets the current user.
82 IPrincipal CurrentUser { get; set; }
85 /// Gets the last exception raised during
86 /// the execution of an action.
88 Exception LastException { get; set; }
91 /// Returns the application path.
93 String ApplicationPath { get; }
96 // /// Returns the physical application path.
98 // String ApplicationPhysicalPath { get; }
101 /// Returns the <see cref="UrlInfo"/> of the the current request.
103 UrlInfo UrlInfo { get; }
106 /// Returns the Items collection from the current HttpContext.
108 IDictionary Items { get; }
111 /// Gets or sets the current controller.
113 /// <value>The current controller.</value>
114 IController CurrentController { get; set; }
117 /// Gets or sets the current controller context.
119 /// <value>The current controller context.</value>
120 IControllerContext CurrentControllerContext { get; set; }
124 // /// If a container is available for the app, this
125 // /// property exposes its instance.
127 // IServiceProvider Container { get; }
130 // /// Request a service from the engine context.
132 // /// <typeparam name="T">Service type</typeparam>
133 // /// <returns>Service instance</returns>
134 // T GetService<T>();