Added RedirectUsingNamedRoute
[castle.git] / InversionOfControl / Castle.MicroKernel / Proxy / IProxyFactory.cs
blob15ee3372a0e930e92cd7dae88426df8c5931b53c
1 // Copyright 2004-2008 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.MicroKernel
17 using Castle.Core;
19 /// <summary>
20 /// Defines the contract used by the kernel
21 /// to obtain proxies for components. The implementor
22 /// must return a proxied instance that dispatch
23 /// the invocation to the registered interceptors in the model
24 /// </summary>
25 public interface IProxyFactory
27 /// <summary>
28 /// Implementors must create a proxy based on
29 /// the information exposed by ComponentModel
30 /// </summary>
31 /// <param name="kernel">The kernel instance</param>
32 /// <param name="model">The component model</param>
33 /// <param name="instance">The component instance to be proxy (only required in some cases)</param>
34 /// <param name="constructorArguments">array of parameters to the constructor (if any)</param>
35 /// <returns>proxy instance</returns>
36 object Create(IKernel kernel, object instance, ComponentModel model, params object[] constructorArguments);
38 /// <summary>
39 /// Implementor should check the component model
40 /// and determine if the caller must pass on the component
41 /// instance to the proxy
42 /// </summary>
43 /// <param name="kernel">The kernel instance</param>
44 /// <param name="model">The component model</param>
45 /// <returns><c>true</c> if an instance must be passed to <see cref="Create"/></returns>
46 bool RequiresTargetInstance(IKernel kernel, ComponentModel model);