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


Java ProxyMethodInvocation.setUserAttribute方法代码示例

本文整理汇总了Java中org.springframework.aop.ProxyMethodInvocation.setUserAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java ProxyMethodInvocation.setUserAttribute方法的具体用法?Java ProxyMethodInvocation.setUserAttribute怎么用?Java ProxyMethodInvocation.setUserAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.aop.ProxyMethodInvocation的用法示例。


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

示例1: bindParameters

import org.springframework.aop.ProxyMethodInvocation; //导入方法依赖的package包/类
private void bindParameters(ProxyMethodInvocation invocation, JoinPointMatch jpm) {
	// Note: Can't use JoinPointMatch.getClass().getName() as the key, since
	// Spring AOP does all the matching at a join point, and then all the invocations
	// under this scenario, if we just use JoinPointMatch as the key, then
	// 'last man wins' which is not what we want at all.
	// Using the expression is guaranteed to be safe, since 2 identical expressions
	// are guaranteed to bind in exactly the same way.
	invocation.setUserAttribute(getExpression(), jpm);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:AspectJExpressionPointcut.java

示例2: currentJoinPoint

import org.springframework.aop.ProxyMethodInvocation; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:AbstractAspectJAdvice.java

示例3: invoke

import org.springframework.aop.ProxyMethodInvocation; //导入方法依赖的package包/类
@Override
public Object invoke(MethodInvocation mi) throws Throwable {
	if (!(mi instanceof ProxyMethodInvocation)) {
		throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
	}
	ProxyMethodInvocation pmi = (ProxyMethodInvocation) mi;
	pmi.setUserAttribute(BEAN_NAME_ATTRIBUTE, this.beanName);
	return mi.proceed();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:ExposeBeanNameAdvisors.java

示例4: invoke

import org.springframework.aop.ProxyMethodInvocation; //导入方法依赖的package包/类
public Object invoke(MethodInvocation mi) throws Throwable {
	if (!(mi instanceof ProxyMethodInvocation)) {
		throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
	}
	ProxyMethodInvocation pmi = (ProxyMethodInvocation) mi;
	pmi.setUserAttribute(BEAN_NAME_ATTRIBUTE, this.beanName);
	return mi.proceed();
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:9,代码来源:ExposeBeanNameAdvisors.java


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