org.springframework.aop.framework
Class ReflectiveMethodInvocation

java.lang.Object
  extended byorg.springframework.aop.framework.ReflectiveMethodInvocation
All Implemented Interfaces:
org.aopalliance.intercept.Invocation, org.aopalliance.intercept.Joinpoint, org.aopalliance.intercept.MethodInvocation

public class ReflectiveMethodInvocation
extends java.lang.Object
implements org.aopalliance.intercept.MethodInvocation

Spring implementation of AOP Alliance MethodInvocation interface. Invokes target using reflection. Subclasses can override the invokeJoinpoint() method to change this behaviour, so this is a useful base class for MethodInvocation implementations.

Version:
$Id: ReflectiveMethodInvocation.java,v 1.4 2004/03/19 16:54:41 johnsonr Exp $
Author:
Rod Johnson

Field Summary
protected  java.lang.Object[] arguments
           
protected  java.util.List interceptorsAndDynamicMethodMatchers
          List of Methodnterceptor and InterceptorAndDynamicMethodMatcher that need dynamic checks.
protected  java.lang.reflect.Method method
           
protected  java.lang.Object proxy
           
protected  java.lang.Object target
           
 
Constructor Summary
ReflectiveMethodInvocation(java.lang.Object proxy, java.lang.Object target, java.lang.reflect.Method m, java.lang.Object[] arguments, java.lang.Class targetClass, java.util.List interceptorsAndDynamicMethodMatchers)
          Construct a new MethodInvocation with given arguments
 
Method Summary
 java.lang.Object[] getArguments()
          Private optimization method
 java.lang.reflect.Method getMethod()
          Return the method invoked on the proxied interface.
 java.lang.Object getProxy()
          Return the proxy that this interception was made through
 java.lang.reflect.AccessibleObject getStaticPart()
           
 java.lang.Object getThis()
           
protected  java.lang.Object invokeJoinpoint()
          Invoke the joinpoint using reflection.
 java.lang.Object proceed()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

method

protected java.lang.reflect.Method method

arguments

protected java.lang.Object[] arguments

target

protected java.lang.Object target

proxy

protected java.lang.Object proxy

interceptorsAndDynamicMethodMatchers

protected java.util.List interceptorsAndDynamicMethodMatchers
List of Methodnterceptor and InterceptorAndDynamicMethodMatcher that need dynamic checks.

Constructor Detail

ReflectiveMethodInvocation

public ReflectiveMethodInvocation(java.lang.Object proxy,
                                  java.lang.Object target,
                                  java.lang.reflect.Method m,
                                  java.lang.Object[] arguments,
                                  java.lang.Class targetClass,
                                  java.util.List interceptorsAndDynamicMethodMatchers)
Construct a new MethodInvocation with given arguments

Parameters:
interceptorsAndDynamicMethodMatchers - interceptors that should be applied, along with any InterceptorAndDynamicMethodMatchers that need evaluation at runtime. MethodMatchers included in this struct must already have been found to have matched as far as was possibly statically. Passing an array might be about 10% faster, but would complicate the code. And it would work only for static pointcuts.
Method Detail

getMethod

public final java.lang.reflect.Method getMethod()
Return the method invoked on the proxied interface. May or may not correspond with a method invoked on an underlying implementation of that interface.

Specified by:
getMethod in interface org.aopalliance.intercept.MethodInvocation
Returns:
Method

getStaticPart

public final java.lang.reflect.AccessibleObject getStaticPart()
Specified by:
getStaticPart in interface org.aopalliance.intercept.Joinpoint

getProxy

public final java.lang.Object getProxy()
Return the proxy that this interception was made through

Returns:
Object

getArguments

public final java.lang.Object[] getArguments()
Private optimization method

Specified by:
getArguments in interface org.aopalliance.intercept.Invocation
Returns:
Object[]

proceed

public java.lang.Object proceed()
                         throws java.lang.Throwable
Specified by:
proceed in interface org.aopalliance.intercept.Joinpoint
Throws:
java.lang.Throwable
See Also:
Joinpoint.proceed()

invokeJoinpoint

protected java.lang.Object invokeJoinpoint()
                                    throws java.lang.Throwable
Invoke the joinpoint using reflection. Subclasses can override this to use custom invocation.

Returns:
the return value of the joinpoint
Throws:
java.lang.Throwable - if invoking the joinpoint resulted in an exception

getThis

public final java.lang.Object getThis()
Specified by:
getThis in interface org.aopalliance.intercept.Joinpoint
See Also:
Joinpoint.getThis()

toString

public java.lang.String toString()


Copyright (C) 2003-2004 The Spring Framework Project.