类 ReflectiveMethodInvocation

    • 构造器详细资料

      • ReflectiveMethodInvocation

        protected ReflectiveMethodInvocation​(Object proxy,
                                             Object target,
                                             Method method,
                                             Object[] arguments,
                                             Class<?> targetClass,
                                             List<Object> interceptorsAndDynamicMethodMatchers)
        Construct a new ReflectiveMethodInvocation with the given arguments.
        参数:
        proxy - the proxy object that the invocation was made on
        target - the target object to invoke
        method - the method to invoke
        arguments - the arguments to invoke the method with
        targetClass - the target class, for MethodMatcher invocations
        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.
    • 方法详细资料

      • getThis

        public final Object getThis()
        从接口复制的说明: Joinpoint
        Return the object that holds the current joinpoint's static part.

        For instance, the target object for an invocation.

        指定者:
        getThis 在接口中 Joinpoint
        返回:
        the object (can be null if the accessible object is static)
      • getMethod

        public final 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.
        指定者:
        getMethod 在接口中 MethodInvocation
        返回:
        the method being called
      • getArguments

        public final Object[] getArguments()
        从接口复制的说明: Invocation
        Get the arguments as an array object. It is possible to change element values within this array to change the arguments.
        指定者:
        getArguments 在接口中 Invocation
        返回:
        the argument of the invocation
      • proceed

        public Object proceed()
                       throws Throwable
        从接口复制的说明: Joinpoint
        Proceed to the next interceptor in the chain.

        The implementation and the semantics of this method depends on the actual joinpoint type (see the children interfaces).

        指定者:
        proceed 在接口中 Joinpoint
        返回:
        see the children interfaces' proceed definition
        抛出:
        Throwable - if the joinpoint throws an exception
      • invokeJoinpoint

        protected Object invokeJoinpoint()
                                  throws Throwable
        Invoke the joinpoint using reflection. Subclasses can override this to use custom invocation.
        返回:
        the return value of the joinpoint
        抛出:
        Throwable - if invoking the joinpoint resulted in 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.
        另请参阅:
        Object.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.
        另请参阅:
        Object.clone()
      • setUserAttribute

        public void setUserAttribute​(String key,
                                     Object value)
        从接口复制的说明: ProxyMethodInvocation
        Add the specified user attribute with the given value to this invocation.

        Such attributes are not used within the AOP framework itself. They are just kept as part of the invocation object, for use in special interceptors.

        指定者:
        setUserAttribute 在接口中 ProxyMethodInvocation
        参数:
        key - the name of the attribute
        value - the value of the attribute, or null to reset it
      • getUserAttributes

        public Map<String,​ObjectgetUserAttributes()
        Return user attributes associated with this invocation. This method provides an invocation-bound alternative to a ThreadLocal.

        This map is initialized lazily and is not used in the AOP framework itself.

        返回:
        any user attributes associated with this invocation (never null)