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
23 public class DynamicActionExecutor
: IExecutableAction
25 private readonly IDynamicAction action
;
28 /// Initializes a new instance of the <see cref="DynamicActionExecutor"/> class.
30 /// <param name="action">The action.</param>
31 public DynamicActionExecutor(IDynamicAction action
)
37 /// Gets a value indicating whether no filter should run before execute the action.
39 /// <value><c>true</c> if they should be skipped; otherwise, <c>false</c>.</value>
40 public bool ShouldSkipAllFilters
46 /// Indicates that no rescues whatsoever should be applied to this action.
49 /// <returns></returns>
50 public bool ShouldSkipRescues
56 /// Gets a rescue descriptor for the exception type.
58 /// <param name="exceptionType">Type of the exception.</param>
59 /// <returns></returns>
60 public RescueDescriptor
GetRescueFor(Type exceptionType
)
66 /// Gets the layout override.
68 /// <value>The layout override.</value>
69 public string[] LayoutOverride
77 /// <param name="filterType">Type of the filter.</param>
78 /// <returns></returns>
79 public bool ShouldSkipFilter(Type filterType
)
85 /// Gets the http method that the action requires before being executed.
87 /// <value>The accessible through verb.</value>
88 public Verb AccessibleThroughVerb
90 get { return Verb.Undefined; }
94 /// Gets the i18n related resource descriptors.
96 /// <value>The resources.</value>
97 public ResourceDescriptor
[] Resources
99 get { return new ResourceDescriptor[0]; }
103 /// Gets the cache policy configurer.
105 /// <value>The cache policy configurer.</value>
106 public ICachePolicyConfigurer CachePolicyConfigurer
112 /// Executes the action this instance represents.
114 /// <param name="engineContext">The engine context.</param>
115 /// <param name="controller">The controller.</param>
116 /// <param name="context">The context.</param>
117 public object Execute(IEngineContext engineContext
, Controller controller
, IControllerContext context
)
119 return action
.Execute(engineContext
, controller
, context
);