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
.DynamicProxy
20 /// Abstracts the implementation of proxy constructions
22 public interface IProxyBuilder
25 /// Gets the module scope used by this builder for generating code.
27 /// <value>The module scope used by this builder.</value>
28 ModuleScope ModuleScope { get; }
31 /// Implementors should return a proxy for the specified type.
33 /// <param name="theClass">The proxy base class.</param>
34 /// <param name="options">The proxy generation options.</param>
35 /// <returns>The generated proxy type.</returns>
36 Type
CreateClassProxy(Type theClass
, ProxyGenerationOptions options
);
39 /// Implementors should return a proxy for the specified
40 /// type and interfaces. The interfaces must be only "mark" interfaces
42 /// <param name="theClass"></param>
43 /// <param name="interfaces"></param>
44 /// <param name="options"></param>
45 /// <returns></returns>
46 Type
CreateClassProxy(Type theClass
, Type
[] interfaces
, ProxyGenerationOptions options
);
49 /// Implementors should return a proxy for the specified
50 /// interface that 'proceeds' executions to the
53 /// <param name="theInterface"></param>
54 /// <param name="interfaces"></param>
55 /// <param name="targetType"></param>
56 /// <param name="options"></param>
57 /// <returns></returns>
58 Type
CreateInterfaceProxyTypeWithTarget(Type theInterface
, Type
[] interfaces
, Type targetType
,
59 ProxyGenerationOptions options
);
62 /// Implementors should return a proxy for the specified
63 /// interface that delegate all executions to the
64 /// specified interceptor(s).
66 /// <param name="theInterface"></param>
67 /// <param name="interfaces"></param>
68 /// <param name="options"></param>
69 /// <returns></returns>
70 Type
CreateInterfaceProxyTypeWithoutTarget(Type theInterface
, Type
[] interfaces
, ProxyGenerationOptions options
);
73 /// Implementors should return a proxy for the specified
74 /// interface that delegate all executions to the
75 /// specified interceptor(s) and uses an instance of the interface
76 /// as their targets, rather than a class. All IInvocation's
77 /// should then implement IChangeProxyTarget.
79 /// <param name="theInterface"></param>
80 /// <param name="options"></param>
81 /// <returns></returns>
82 Type
CreateInterfaceProxyTypeWithTargetInterface(Type theInterface
, ProxyGenerationOptions options
);