Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.aop.framework;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.aop.ProxyMethodInvocation;
import org.springframework.aop.support.AopUtils;
import org.springframework.core.BridgeMethodResolver;
import org.springframework.lang.Nullable;
/**
* Spring's implementation of the AOP Alliance
* {@link org.aopalliance.intercept.MethodInvocation} interface,
* implementing the extended
* {@link org.springframework.aop.ProxyMethodInvocation} interface.
*
*
Invokes the target object using reflection. Subclasses can override the
* {@link #invokeJoinpoint()} method to change this behavior, so this is also
* a useful base class for more specialized MethodInvocation implementations.
*
*
It is possible to clone an invocation, to invoke {@link #proceed()}
* repeatedly (once per clone), using the {@link #invocableClone()} method.
* It is also possible to attach custom attributes to the invocation,
* using the {@link #setUserAttribute} / {@link #getUserAttribute} methods.
*
*
NOTE: This class is considered internal and should not be
* directly accessed. The sole reason for it being public is compatibility
* with existing framework integrations (e.g. Pitchfork). For any other
* purposes, use the {@link ProxyMethodInvocation} interface instead.
*
* @author Rod Johnson
* @author Juergen Hoeller
* @author Adrian Colyer
* @see #invokeJoinpoint
* @see #proceed
* @see #invocableClone
* @see #setUserAttribute
* @see #getUserAttribute
*/
public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Cloneable {
protected final Object proxy;
@Nullable
protected final Object target;
protected final Method method;
protected Object[] arguments;
@Nullable
private final Class targetClass;
/**
* Lazily initialized map of user-specific attributes for this invocation.
*/
@Nullable
private Map userAttributes;
/**
* List of MethodInterceptor and InterceptorAndDynamicMethodMatcher
* that need dynamic checks.
*/
protected final List interceptorsAndDynamicMethodMatchers;
/**
* Index from 0 of the current interceptor we're invoking.
* -1 until we invoke: then the current interceptor.
*/
private int currentInterceptorIndex = -1;
/**
* Construct a new ReflectiveMethodInvocation with the given arguments.
* @param proxy the proxy object that the invocation was made on
* @param target the target object to invoke
* @param method the method to invoke
* @param arguments the arguments to invoke the method with
* @param targetClass the target class, for MethodMatcher invocations
* @param 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.
*/
protected ReflectiveMethodInvocation(
Object proxy, @Nullable Object target, Method method, @Nullable Object[] arguments,
@Nullable Class targetClass, List