类 AbstractMethodInvocation

java.lang.Object
infra.core.AttributeAccessorSupport
infra.aop.framework.AbstractMethodInvocation
所有已实现的接口:
ProxyMethodInvocation, TargetClassAware, infra.core.AttributeAccessor, Cloneable, Invocation, Joinpoint, MethodInvocation
直接已知子类:
DefaultMethodInvocation

public abstract class AbstractMethodInvocation extends infra.core.AttributeAccessorSupport implements MethodInvocation, Cloneable, ProxyMethodInvocation
Implemented basic proceed() logic

Runtime MethodInterceptor will automatically match current MethodInvocation

从以下版本开始:
3.0 2021/2/14 21:43
作者:
Harry Yang
另请参阅:
  • 构造器详细资料

    • AbstractMethodInvocation

      public AbstractMethodInvocation()
  • 方法详细资料

    • getProxy

      public abstract Object getProxy()
      Return the proxy that this method invocation was made through.
      指定者:
      getProxy 在接口中 ProxyMethodInvocation
      返回:
      the original proxy object
    • proceed

      public Object proceed() throws Throwable
      Basic logic. Proceeds to the next interceptor in the chain.

      Subclasses can override this method to handle Exception

      指定者:
      proceed 在接口中 Joinpoint
      返回:
      see the children interfaces' proceed definition.
      抛出:
      Throwable - if the join-point throws an exception.
      另请参阅:
    • invokeJoinPoint

      protected abstract Object invokeJoinPoint() throws Throwable
      Invoke jon-point
      返回:
      the result of the call to Joinpoint.proceed(), might be intercepted by the interceptor.
      抛出:
      Throwable
    • hasInterceptor

      protected abstract boolean hasInterceptor()
      Determine whether there is an interceptor
    • executeInterceptor

      protected abstract Object executeInterceptor() throws Throwable
      Invoke current MethodInterceptor

      hasInterceptor() must returnstrue

      抛出:
      Throwable - if the interceptors or the target-object throws an exception.
      另请参阅:
    • invocableClone

      public MethodInvocation invocableClone()
      This implementation returns a shallow copy of this invocation object, including an independent copy of the original arguments array.

      We want a shallow copy in this case: We want to use the same interceptor chain and other object references, but we want an independent value for the current interceptor index.

      指定者:
      invocableClone 在接口中 ProxyMethodInvocation
      返回:
      an invocable clone of this invocation. proceed() can be called once per clone.
      另请参阅:
    • invocableClone

      public MethodInvocation invocableClone(Object... arguments)
      This implementation returns a shallow copy of this invocation object, using the given arguments array for the clone.

      We want a shallow copy in this case: We want to use the same interceptor chain and other object references, but we want an independent value for the current interceptor index.

      指定者:
      invocableClone 在接口中 ProxyMethodInvocation
      参数:
      arguments - the arguments that the cloned invocation is supposed to use, overriding the original arguments
      返回:
      an invocable clone of this invocation. proceed() can be called once per clone.
      另请参阅:
    • setArguments

      public abstract void setArguments(Object[] arguments)
      从接口复制的说明: ProxyMethodInvocation
      Set the arguments to be used on subsequent invocations in the any advice in this chain.
      指定者:
      setArguments 在接口中 ProxyMethodInvocation
      参数:
      arguments - the argument array