3 namespace AopAlliance
.Intercept
6 /// <p>Intercepts the construction of a new object.</p>
9 /// <p>The user should implement the <c>Construct(IConstructorInvocation)</c> method to modify the original behavior.
10 /// E.g. the following class implements a singleton interceptor (allows only one unique instance for the intercepted class): </p>
12 /// class DebuggingInterceptor : IConstructorInterceptor
14 /// object instance = null;
16 /// object Construct(IConstructorInvocation i)
18 /// if (instance == null)
20 /// return instance = i.Proceed();
24 /// throw new Exception("singleton does not allow multiple instance");
30 public interface IConstructorInterceptor
: IInterceptor
33 /// <p>Implement this method to perform extra treatments before and after the consrution of a new object.
34 /// Polite implementations would certainly like to invoke IJoinpoint.Proceed(). </p>
36 /// <param name="invocation">The construction joinpoint </param>
37 /// <returns>The newly created object, which is also the result of the call to IJoinpoint.Proceed(), might be replaced by the interceptor.</returns>
38 /// <exception cref="System.Exception">if the interceptors or the target-object throws an exception.</exception>
39 object Construct(IConstructorInvocation invocation
);