Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop/Framework
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv16301/Aop/Framework
Modified Files:
DynamicMethodInvocation.cs ReflectiveMethodInvocation.cs
Log Message:
Added Inheritance-based aop proxy.
Index: ReflectiveMethodInvocation.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop/Framework/ReflectiveMethodInvocation.cs,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** ReflectiveMethodInvocation.cs 2 Aug 2007 16:28:30 -0000 1.17
--- ReflectiveMethodInvocation.cs 6 Feb 2008 18:28:52 -0000 1.18
***************
*** 43,46 ****
--- 43,51 ----
public class ReflectiveMethodInvocation : AbstractMethodInvocation
{
+ /// <summary>
+ /// The method invocation that is to be invoked on the proxy.
+ /// </summary>
+ protected MethodInfo proxyMethod;
+
/// <summary>
/// Creates a new instance of the
***************
*** 50,53 ****
--- 55,59 ----
/// <param name="target">The target object.</param>
/// <param name="method">The target method proxied.</param>
+ /// <param name="proxyMethod">The method to invoke on proxy.</param>
/// <param name="arguments">The target method's arguments.</param>
/// <param name="targetType">
***************
*** 62,69 ****
/// </exception>
public ReflectiveMethodInvocation(
! object proxy, object target, MethodInfo method,
object[] arguments, Type targetType, IList interceptors)
: base(proxy, target, method, arguments, targetType, interceptors)
! {}
/// <summary>
--- 68,77 ----
/// </exception>
public ReflectiveMethodInvocation(
! object proxy, object target, MethodInfo method, MethodInfo proxyMethod,
object[] arguments, Type targetType, IList interceptors)
: base(proxy, target, method, arguments, targetType, interceptors)
! {
! this.proxyMethod = proxyMethod;
! }
/// <summary>
***************
*** 86,90 ****
try
{
! return method.Invoke(target, arguments);
}
catch (TargetInvocationException ex)
--- 94,105 ----
try
{
! if (proxyMethod == null)
! {
! return method.Invoke(target, arguments);
! }
! else
! {
! return proxyMethod.Invoke(target, arguments);
! }
}
catch (TargetInvocationException ex)
***************
*** 108,112 ****
{
ReflectiveMethodInvocation rmi = new ReflectiveMethodInvocation(
! this.proxy, this.target, this.method, this.arguments, this.targetType, this.interceptors);
rmi.currentInterceptorIndex = this.currentInterceptorIndex + 1;
--- 123,127 ----
{
ReflectiveMethodInvocation rmi = new ReflectiveMethodInvocation(
! this.proxy, this.target, this.method, this.proxyMethod, this.arguments, this.targetType, this.interceptors);
rmi.currentInterceptorIndex = this.currentInterceptorIndex + 1;
Index: DynamicMethodInvocation.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop/Framework/DynamicMethodInvocation.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DynamicMethodInvocation.cs 8 Aug 2007 03:58:14 -0000 1.2
--- DynamicMethodInvocation.cs 6 Feb 2008 18:28:52 -0000 1.3
***************
*** 43,46 ****
--- 43,51 ----
public class DynamicMethodInvocation : AbstractMethodInvocation
{
+ /// <summary>
+ /// The method invocation that is to be invoked on the proxy.
+ /// </summary>
+ protected MethodInfo proxyMethod;
+
/// <summary>
/// Creates a new instance of the
***************
*** 50,53 ****
--- 55,59 ----
/// <param name="target">The target object.</param>
/// <param name="method">The target method proxied.</param>
+ /// <param name="proxyMethod">The method to invoke on proxy.</param>
/// <param name="arguments">The target method's arguments.</param>
/// <param name="targetType">
***************
*** 62,69 ****
/// </exception>
public DynamicMethodInvocation(
! object proxy, object target, MethodInfo method,
object[] arguments, Type targetType, IList interceptors)
: base(proxy, target, method, arguments, targetType, interceptors)
! {}
/// <summary>
--- 68,77 ----
/// </exception>
public DynamicMethodInvocation(
! object proxy, object target, MethodInfo method, MethodInfo proxyMethod,
object[] arguments, Type targetType, IList interceptors)
: base(proxy, target, method, arguments, targetType, interceptors)
! {
! this.proxyMethod = proxyMethod;
! }
/// <summary>
***************
*** 84,88 ****
protected override object InvokeJoinpoint()
{
! IDynamicMethod targetMethod = new SafeMethod(method);
try
{
--- 92,96 ----
protected override object InvokeJoinpoint()
{
! IDynamicMethod targetMethod = (this.proxyMethod == null) ? new SafeMethod(method) : new SafeMethod(proxyMethod);
try
{
***************
*** 110,114 ****
{
DynamicMethodInvocation rmi = new DynamicMethodInvocation(
! this.proxy, this.target, this.method, this.arguments, this.targetType, this.interceptors);
rmi.currentInterceptorIndex = this.currentInterceptorIndex + 1;
--- 118,122 ----
{
DynamicMethodInvocation rmi = new DynamicMethodInvocation(
! this.proxy, this.target, this.method, this.proxyMethod, this.arguments, this.targetType, this.interceptors);
rmi.currentInterceptorIndex = this.currentInterceptorIndex + 1;
|