亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? abstractaspectjadvice.java

?? spring framework 2.5.4源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * Copyright 2002-2007 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
 *
 *      http://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.aspectj;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

import org.aopalliance.aop.Advice;
import org.aopalliance.intercept.MethodInvocation;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.weaver.tools.JoinPointMatch;
import org.aspectj.weaver.tools.PointcutParameter;

import org.springframework.aop.AopInvocationException;
import org.springframework.aop.MethodMatcher;
import org.springframework.aop.Pointcut;
import org.springframework.aop.ProxyMethodInvocation;
import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
import org.springframework.aop.support.ComposablePointcut;
import org.springframework.aop.support.MethodMatchers;
import org.springframework.aop.support.StaticMethodMatcher;
import org.springframework.core.JdkVersion;
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
import org.springframework.core.ParameterNameDiscoverer;
import org.springframework.core.PrioritizedParameterNameDiscoverer;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;

/**
 * Base class for AOP Alliance {@link org.aopalliance.aop.Advice} classes
 * wrapping an AspectJ aspect or an AspectJ-annotated advice method.
 *
 * @author Rod Johnson
 * @author Adrian Colyer
 * @author Juergen Hoeller
 * @author Ramnivas Laddad
 * @since 2.0
 */
public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedenceInformation {

	/**
	 * Key used in ReflectiveMethodInvocation userAtributes map for the current joinpoint.
	 */
	protected static final String JOIN_POINT_KEY = JoinPoint.class.getName();


	/**
	 * Lazily instantiate joinpoint for the current invocation.
	 * Requires MethodInvocation to be bound with ExposeInvocationInterceptor.
	 * <p>Do not use if access is available to the current ReflectiveMethodInvocation
	 * (in an around advice).
	 * @return current AspectJ joinpoint, or through an exception if we're not in a
	 * Spring AOP invocation.
	 */
	public static JoinPoint currentJoinPoint() {
		MethodInvocation mi = ExposeInvocationInterceptor.currentInvocation();
		if (!(mi instanceof ProxyMethodInvocation)) {
			throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
		}
		ProxyMethodInvocation pmi = (ProxyMethodInvocation) mi;
		JoinPoint jp = (JoinPoint) pmi.getUserAttribute(JOIN_POINT_KEY);
		if (jp == null) {
			jp = new MethodInvocationProceedingJoinPoint(pmi);
			pmi.setUserAttribute(JOIN_POINT_KEY, jp);
		}
		return jp;
	}


	protected final Method aspectJAdviceMethod;

	/** The total number of arguments we have to populate on advice dispatch */
	private final int adviceInvocationArgumentCount;

	private final AspectJExpressionPointcut pointcut;

	private final AspectInstanceFactory aspectInstanceFactory;

	/**
	 * The name of the aspect (ref bean) in which this advice was defined (used
	 * when determining advice precedence so that we can determine
	 * whether two pieces of advice come from the same aspect).
	 */
	private String aspectName;

	/**
	 * The order of declaration of this advice within the aspect.
	 */
	private int declarationOrder;

	/**
	 * This will be non-null if the creator of this advice object knows the argument names
	 * and sets them explicitly
	 */
	private String[] argumentNames = null;

	/** Non-null if after throwing advice binds the thrown value */
	private String throwingName = null;

	/** Non-null if after returning advice binds the return value */
	private String returningName = null;

	private Class discoveredReturningType = Object.class;

	private Class discoveredThrowingType = Object.class;

	/**
	 * Index for thisJoinPoint argument (currently only
	 * supported at index 0 if present at all)
	 */
	private int joinPointArgumentIndex = -1;

	/**
	 * Index for thisJoinPointStaticPart argument (currently only
	 * supported at index 0 if present at all)
	 */
	private int joinPointStaticPartArgumentIndex = -1;

	private Map argumentBindings = null;

	private boolean argumentsIntrospected = false;

	// The actual type is java.lang.reflect.Type,
	// but for JDK 1.4 compatibility we use Object as the static type.
	private Object discoveredReturningGenericType;
	// Note: Unlike return type, no such generic information is needed for the throwing type,
	// since Java doesn't allow exception types to be parameterized.


	/**
	 * Create a new AbstractAspectJAdvice for the given advice method.
	 * @param aspectJAdviceMethod the AspectJ-style advice method
	 * @param pointcut the AspectJ expression pointcut
	 * @param aspectInstanceFactory the factory for aspect instances
	 */
	public AbstractAspectJAdvice(
			Method aspectJAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aspectInstanceFactory) {

		Assert.notNull(aspectJAdviceMethod, "Advice method must not be null");
		this.aspectJAdviceMethod = aspectJAdviceMethod;
		this.adviceInvocationArgumentCount = this.aspectJAdviceMethod.getParameterTypes().length;
		this.pointcut = pointcut;
		this.aspectInstanceFactory = aspectInstanceFactory;
	}


	/**
	 * Return the AspectJ-style advice method.
	 */
	public final Method getAspectJAdviceMethod() {
		return this.aspectJAdviceMethod;
	}

	/**
	 * Return the AspectJ expression pointcut.
	 */
	public final AspectJExpressionPointcut getPointcut() {
		calculateArgumentBindings();
		return this.pointcut;
	}

	/**
	 * Build a 'safe' pointcut that excludes the AspectJ advice method itself.
	 * @return a composable pointcut that builds on the original AspectJ expression pointcut
	 * @see #getPointcut()
	 */
	public final Pointcut buildSafePointcut() {
		Pointcut pc = getPointcut();
		MethodMatcher safeMethodMatcher = MethodMatchers.intersection(
				new AdviceExcludingMethodMatcher(this.aspectJAdviceMethod), pc.getMethodMatcher());
		return new ComposablePointcut(pc.getClassFilter(), safeMethodMatcher);
	}

	/**
	 * Return the factory for aspect instances.
	 */
	public final AspectInstanceFactory getAspectInstanceFactory() {
		return this.aspectInstanceFactory;
	}

	/**
	 * Return the ClassLoader for aspect instances.
	 */
	public final ClassLoader getAspectClassLoader() {
		return this.aspectInstanceFactory.getAspectClassLoader();
	}

	public int getOrder() {
		return this.aspectInstanceFactory.getOrder();
	}


	public void setAspectName(String name) {
		this.aspectName = name;
	}
	
	public String getAspectName() {
		return this.aspectName;
	}

	/**
	 * Sets the <b>declaration order</b> of this advice within the aspect
	 */
	public void setDeclarationOrder(int order) {
		this.declarationOrder = order;
	}

	public int getDeclarationOrder() {
		return this.declarationOrder;
	}

	/**
	 * Set by creator of this advice object if the argument names are known.
	 * <p>This could be for example because they have been explicitly specified in XML,
	 * or in an advice annotation.
	 * @param argNames comma delimited list of arg names
	 */
	public void setArgumentNames(String argNames) {
		String[] tokens = StringUtils.commaDelimitedListToStringArray(argNames);
		setArgumentNamesFromStringArray(tokens);
	}

	public void setArgumentNamesFromStringArray(String[] args) {
		this.argumentNames = new String[args.length];
		for (int i = 0; i < args.length; i++) {
			this.argumentNames[i] = StringUtils.trimWhitespace(args[i]);
			if (!isVariableName(this.argumentNames[i])) {
				throw new IllegalArgumentException(
						"'argumentNames' property of AbstractAspectJAdvice contains an argument name '" +
						this.argumentNames[i] + "' that is not a valid Java identifier");
			}
		}
		if (argumentNames != null) {
			if (aspectJAdviceMethod.getParameterTypes().length == argumentNames.length + 1) {
				// May need to add implicit join point arg name...
				Class firstArgType = aspectJAdviceMethod.getParameterTypes()[0];
				if (firstArgType == JoinPoint.class ||
						firstArgType == ProceedingJoinPoint.class ||
						firstArgType == JoinPoint.StaticPart.class) {
					String[] oldNames = argumentNames;
					argumentNames = new String[oldNames.length + 1];
					argumentNames[0] = "THIS_JOIN_POINT";
					System.arraycopy(oldNames, 0, argumentNames, 1, oldNames.length);
				}
			}
		}
	}

	public void setReturningName(String name) {
		throw new UnsupportedOperationException("Only afterReturning advice can be used to bind a return value");
	}

	/** 
	 * We need to hold the returning name at this level for argument binding calculations,
	 * this method allows the afterReturning advice subclass to set the name.
	 */
	protected void setReturningNameNoCheck(String name) {
		// name could be a variable or a type...
		if (isVariableName(name)) {
			this.returningName = name;
		}
		else {
			// assume a type
			try {
				this.discoveredReturningType = ClassUtils.forName(name, getAspectClassLoader());
			}
			catch (Throwable ex) {
				throw new IllegalArgumentException("Returning name '" + name  +
						"' is neither a valid argument name nor the fully-qualified name of a Java type on the classpath. " +
						"Root cause: " + ex);
			}
		}
	}

	protected Class getDiscoveredReturningType() {
		return this.discoveredReturningType;
	}

	protected Object getDiscoveredReturningGenericType() {
		return this.discoveredReturningGenericType;
	}

	public void setThrowingName(String name) {
		throw new UnsupportedOperationException("Only afterThrowing advice can be used to bind a thrown exception");
	}

	/** 
	 * We need to hold the throwing name at this level for argument binding calculations,
	 * this method allows the afterThrowing advice subclass to set the name.
	 */
	protected void setThrowingNameNoCheck(String name) {
		// name could be a variable or a type...
		if (isVariableName(name)) {
			this.throwingName = name;
		}
		else {
			// assume a type
			try {
				this.discoveredThrowingType = ClassUtils.forName(name, getAspectClassLoader());
			}
			catch (Throwable ex) {
				throw new IllegalArgumentException("Throwing name '" + name  +
						"' is neither a valid argument name nor the fully-qualified name of a Java type on the classpath. " +
						"Root cause: " + ex);
			}
		}
	}

	protected Class getDiscoveredThrowingType() {
		return this.discoveredThrowingType;
	}

	private boolean isVariableName(String name) {
		char[] chars = name.toCharArray();
		if (!Character.isJavaIdentifierStart(chars[0])) {
			return false;
		}
		for (int i = 1; i < chars.length; i++) {
			if (!Character.isJavaIdentifierPart(chars[i])) {
				return false;
			}
		}
		return true;
	}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产123区| 在线观看区一区二| 欧美日韩国产经典色站一区二区三区| 精品国产免费人成电影在线观看四季| 亚洲最色的网站| 欧美三日本三级三级在线播放| 亚洲综合色在线| 成人综合激情网| 成人免费一区二区三区在线观看| 麻豆精品在线看| 欧洲一区在线观看| 天天操天天干天天综合网| 欧美日韩美少妇| 日韩国产精品91| 久久五月婷婷丁香社区| 成人免费看黄yyy456| 1000部国产精品成人观看| 久久色在线观看| 成人国产精品免费观看| 国产精品久久久久久久久免费桃花| 激情图片小说一区| 亚洲综合免费观看高清在线观看| 欧美一区二区在线不卡| 亚洲精选视频在线| 经典三级在线一区| 精品99一区二区三区| 亚洲国产精品尤物yw在线观看| 国产在线不卡一区| 精品久久久久av影院| 高清不卡一二三区| 欧美日韩中文字幕一区二区| 国产欧美1区2区3区| 美腿丝袜在线亚洲一区| 在线看一区二区| 欧美一区二区三区免费| 色老汉av一区二区三区| 亚洲曰韩产成在线| 欧美性猛交xxxxxx富婆| 亚洲在线视频一区| 99在线精品视频| 亚洲第一会所有码转帖| 欧美www视频| 国产成人在线免费| 国产精品久久久久影院色老大| 欧美少妇性性性| 国产大陆a不卡| 午夜久久电影网| 久久精品欧美一区二区三区不卡 | 国产九色精品成人porny| 2022国产精品视频| 欧美精品久久一区二区三区| 一本大道久久精品懂色aⅴ| 成人网男人的天堂| 国产精品影音先锋| 国产精品影视网| 懂色一区二区三区免费观看| 国产一二三精品| 国产福利精品一区| 国产v综合v亚洲欧| 欧美视频一二三区| 精品国产一区二区精华 | 午夜精品久久久久久久久久久| 亚洲欧美日韩在线播放| 亚洲综合在线电影| 日韩av一区二区在线影视| 九九久久精品视频| 精品一区二区成人精品| 国产91在线|亚洲| 欧美伊人久久久久久久久影院| 欧美高清dvd| 国产欧美精品一区二区色综合朱莉 | 91久久精品网| 日韩欧美另类在线| 国产精品网站在线播放| 亚洲大型综合色站| 国产成人久久精品77777最新版本| 99久久精品免费看国产| 日韩欧美一区二区在线视频| 亚洲精品在线观看网站| 国产精品国模大尺度视频| 日韩激情中文字幕| 99久久精品免费看| 国产欧美视频一区二区| 丝袜诱惑亚洲看片| 色婷婷综合久久久| 国产精品毛片久久久久久| 久久精品噜噜噜成人av农村| 欧洲精品一区二区三区在线观看| 亚洲精品一区二区三区蜜桃下载| 亚洲一区二区免费视频| 成人午夜激情影院| 2020日本不卡一区二区视频| 日韩精品一二三区| 欧美日本一区二区三区四区| 一区二区三区四区中文字幕| 国产精品一二三在| 久久精品亚洲乱码伦伦中文| 久99久精品视频免费观看| 欧美丰满一区二区免费视频 | 国产精品初高中害羞小美女文| 久久精品国产第一区二区三区| 欧美精品1区2区| 五月开心婷婷久久| 欧美一级理论性理论a| 天天操天天干天天综合网| 91精品国产色综合久久ai换脸 | 日韩精品欧美精品| 91精品国产综合久久久久久久久久| 亚洲国产色一区| 7777精品伊人久久久大香线蕉 | 日韩欧美的一区| 国产成人免费高清| 一区二区三区.www| 欧美一级欧美三级| 福利电影一区二区| 亚洲欧洲精品成人久久奇米网| 91在线视频18| 蜜臀va亚洲va欧美va天堂| 久久香蕉国产线看观看99| 91亚洲精品久久久蜜桃网站| 一级日本不卡的影视| 欧美精品一区二区三区蜜桃| www.亚洲在线| 精品一区二区成人精品| 中文久久乱码一区二区| 欧美日韩五月天| 成人精品亚洲人成在线| 天堂蜜桃91精品| 欧美激情一区二区三区不卡| 欧美视频第二页| 91一区二区三区在线播放| 久久99精品久久久久| 亚洲va欧美va天堂v国产综合| 国产欧美日韩在线观看| 精品久久人人做人人爰| 欧美自拍偷拍午夜视频| 成人精品国产一区二区4080| 久久国产三级精品| 麻豆精品视频在线观看免费| 一区二区三区精品久久久| 国产精品电影一区二区| 久久亚洲一区二区三区明星换脸| 欧美中文字幕一区| 在线观看中文字幕不卡| 99久久精品久久久久久清纯| 国产99精品在线观看| 国产精品一区二区久久不卡| 韩国成人福利片在线播放| 久久精品999| 99这里只有久久精品视频| 国产成人无遮挡在线视频| 狠狠色2019综合网| 国模娜娜一区二区三区| 国产成人在线视频网站| 成人av在线资源网| 色综合 综合色| 在线视频亚洲一区| 日韩欧美一区二区不卡| 欧美成人vr18sexvr| 亚洲精品在线观| 国产精品素人一区二区| 一区免费观看视频| 亚洲狠狠丁香婷婷综合久久久| 亚洲愉拍自拍另类高清精品| 亚洲成人av在线电影| 国产一区二区三区最好精华液 | 玉足女爽爽91| 美女任你摸久久| 粉嫩av一区二区三区在线播放| av亚洲精华国产精华精华 | 色琪琪一区二区三区亚洲区| 欧美性xxxxxx少妇| 国产精品午夜久久| 蓝色福利精品导航| av一区二区三区四区| 日韩一区二区免费在线观看| 国产欧美一区二区三区网站 | 欧美在线视频全部完| 2021国产精品久久精品| 日韩中文欧美在线| 欧美麻豆精品久久久久久| 中文字幕字幕中文在线中不卡视频| 男女视频一区二区| 91精品久久久久久久99蜜桃| 亚洲综合男人的天堂| av福利精品导航| 成人欧美一区二区三区小说| 国产一区二区三区在线观看免费| 在线播放91灌醉迷j高跟美女 | 国产精品素人视频| 国内偷窥港台综合视频在线播放| 欧美一区二区免费视频| 三级不卡在线观看| 5858s免费视频成人| 图片区小说区区亚洲影院| 欧美日韩不卡在线| 麻豆精品国产传媒mv男同| 在线电影一区二区三区| 日本中文字幕一区| 欧美不卡一区二区三区四区|