当前位置: 首页>>代码示例>>Java>>正文


Java ShadowMatch类代码示例

本文整理汇总了Java中org.aspectj.weaver.tools.ShadowMatch的典型用法代码示例。如果您正苦于以下问题:Java ShadowMatch类的具体用法?Java ShadowMatch怎么用?Java ShadowMatch使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ShadowMatch类属于org.aspectj.weaver.tools包,在下文中一共展示了ShadowMatch类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: matchers

import org.aspectj.weaver.tools.ShadowMatch; //导入依赖的package包/类
/**
 * 使用 AspectJ Expression 匹配方法
 * @param method
 * @param targetClass
 * @return 成功匹配返回 true,否则返回 false
 */
@Override
public Boolean matchers(Method method, Class targetClass) {
    checkReadyToMatche();
    ShadowMatch shadowMatch = pointcutExpression.matchesMethodExecution(method);

    // Special handling for this, target, @this, @target, @annotation
    // in Spring - we can optimize since we know we have exactly this class,
    // and there will never be matching subclass at runtime.
    // https://github.com/spring-projects/spring-framework/blob/master/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java
    if (shadowMatch.alwaysMatches()) {
        return true;
    }
    else if (shadowMatch.neverMatches()) {
        return false;
    }

    return false;
}
 
开发者ID:code4wt,项目名称:toy-spring,代码行数:25,代码来源:AspectJExpressionPointcut.java

示例2: matches

import org.aspectj.weaver.tools.ShadowMatch; //导入依赖的package包/类
@Override
public boolean matches(Method method, Class<?> targetClass, boolean beanHasIntroductions) {
	checkReadyToMatch();
	Method targetMethod = AopUtils.getMostSpecificMethod(method, targetClass);
	ShadowMatch shadowMatch = getShadowMatch(targetMethod, method);

	// Special handling for this, target, @this, @target, @annotation
	// in Spring - we can optimize since we know we have exactly this class,
	// and there will never be matching subclass at runtime.
	if (shadowMatch.alwaysMatches()) {
		return true;
	}
	else if (shadowMatch.neverMatches()) {
		return false;
	}
	else {
		// the maybe case
		if (beanHasIntroductions) {
			return true;
		}
		// A match test returned maybe - if there are any subtype sensitive variables
		// involved in the test (this, target, at_this, at_target, at_annotation) then
		// we say this is not a match as in Spring there will never be a different
		// runtime subtype.
		RuntimeTestWalker walker = getRuntimeTestWalker(shadowMatch);
		return (!walker.testsSubtypeSensitiveVars() || walker.testTargetInstanceOfResidue(targetClass));
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:AspectJExpressionPointcut.java

示例3: readObject

import org.aspectj.weaver.tools.ShadowMatch; //导入依赖的package包/类
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
	// Rely on default serialization, just initialize state after deserialization.
	ois.defaultReadObject();

	// Initialize transient fields.
	// pointcutExpression will be initialized lazily by checkReadyToMatch()
	this.shadowMatchCache = new ConcurrentHashMap<Method, ShadowMatch>(32);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:AspectJExpressionPointcut.java

示例4: RuntimeTestWalker

import org.aspectj.weaver.tools.ShadowMatch; //导入依赖的package包/类
public RuntimeTestWalker(ShadowMatch shadowMatch) {
	try {
		ReflectionUtils.makeAccessible(residualTestField);
		this.runtimeTest = (Test) residualTestField.get(shadowMatch);
	}
	catch (IllegalAccessException ex) {
		throw new IllegalStateException(ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:RuntimeTestWalker.java

示例5: matches

import org.aspectj.weaver.tools.ShadowMatch; //导入依赖的package包/类
@Override
public boolean matches(Method method, Class targetClass) {
	checkReadyToMatch();
	ShadowMatch shadowMatch = pointcutExpression.matchesMethodExecution(method);
	if (shadowMatch.alwaysMatches()) {
		return true;
	} else if (shadowMatch.neverMatches()) {
		return false;
	}
	// TODO:其他情况不判断了!见org.springframework.aop.aspectj.RuntimeTestWalker
	return false;
}
 
开发者ID:greyireland,项目名称:tiny-spring,代码行数:13,代码来源:AspectJExpressionPointcut.java

示例6: matches

import org.aspectj.weaver.tools.ShadowMatch; //导入依赖的package包/类
public boolean matches(Method method, Class<?> targetClass, boolean beanHasIntroductions) {
	checkReadyToMatch();
	Method targetMethod = AopUtils.getMostSpecificMethod(method, targetClass);
	ShadowMatch shadowMatch = getShadowMatch(targetMethod, method);

	// Special handling for this, target, @this, @target, @annotation
	// in Spring - we can optimize since we know we have exactly this class,
	// and there will never be matching subclass at runtime.
	if (shadowMatch.alwaysMatches()) {
		return true;
	}
	else if (shadowMatch.neverMatches()) {
		return false;
	}
	else {
		// the maybe case
		if (beanHasIntroductions) {
			return true;
		}
		// A match test returned maybe - if there are any subtype sensitive variables
		// involved in the test (this, target, at_this, at_target, at_annotation) then
		// we say this is not a match as in Spring there will never be a different
		// runtime subtype.
		RuntimeTestWalker walker = getRuntimeTestWalker(shadowMatch);
		return (!walker.testsSubtypeSensitiveVars() || walker.testTargetInstanceOfResidue(targetClass));
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:28,代码来源:AspectJExpressionPointcut.java

示例7: getRuntimeTestWalker

import org.aspectj.weaver.tools.ShadowMatch; //导入依赖的package包/类
private RuntimeTestWalker getRuntimeTestWalker(ShadowMatch shadowMatch) {
	if (shadowMatch instanceof DefensiveShadowMatch) {
		return new RuntimeTestWalker(((DefensiveShadowMatch) shadowMatch).primary);
	}
	return new RuntimeTestWalker(shadowMatch);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:AspectJExpressionPointcut.java

示例8: DefensiveShadowMatch

import org.aspectj.weaver.tools.ShadowMatch; //导入依赖的package包/类
public DefensiveShadowMatch(ShadowMatch primary, ShadowMatch other) {
	this.primary = primary;
	this.other = other;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:AspectJExpressionPointcut.java


注:本文中的org.aspectj.weaver.tools.ShadowMatch类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。