Java源码示例:org.aspectj.weaver.tools.JoinPointMatch

示例1
@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;
	ProceedingJoinPoint pjp = lazyGetProceedingJoinPoint(pmi);
	JoinPointMatch jpm = getJoinPointMatch(pmi);
	return invokeAdviceMethod(pjp, jpm, null, null);
}
 
示例2
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(resolveExpression(), jpm);
}
 
示例3
@Override
public JoinPointMatch matchesJoinPoint(Object thisObject, Object targetObject, Object[] args) {
	try {
		return this.primary.matchesJoinPoint(thisObject, targetObject, args);
	}
	catch (ReflectionWorldException ex) {
		return this.other.matchesJoinPoint(thisObject, targetObject, args);
	}
}
 
示例4
/**
 * Get the current join point match at the join point we are being dispatched on.
 */
@Nullable
protected JoinPointMatch getJoinPointMatch() {
	MethodInvocation mi = ExposeInvocationInterceptor.currentInvocation();
	if (!(mi instanceof ProxyMethodInvocation)) {
		throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
	}
	return getJoinPointMatch((ProxyMethodInvocation) mi);
}
 
示例5
@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;
	ProceedingJoinPoint pjp = lazyGetProceedingJoinPoint(pmi);
	JoinPointMatch jpm = getJoinPointMatch(pmi);
	return invokeAdviceMethod(pjp, jpm, null, null);
}
 
示例6
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(resolveExpression(), jpm);
}
 
示例7
@Override
public JoinPointMatch matchesJoinPoint(Object thisObject, Object targetObject, Object[] args) {
	try {
		return this.primary.matchesJoinPoint(thisObject, targetObject, args);
	}
	catch (ReflectionWorldException ex) {
		return this.other.matchesJoinPoint(thisObject, targetObject, args);
	}
}
 
示例8
/**
 * Get the current join point match at the join point we are being dispatched on.
 */
@Nullable
protected JoinPointMatch getJoinPointMatch() {
	MethodInvocation mi = ExposeInvocationInterceptor.currentInvocation();
	if (!(mi instanceof ProxyMethodInvocation)) {
		throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
	}
	return getJoinPointMatch((ProxyMethodInvocation) mi);
}
 
示例9
@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;
	ProceedingJoinPoint pjp = lazyGetProceedingJoinPoint(pmi);
	JoinPointMatch jpm = getJoinPointMatch(pmi);
	return invokeAdviceMethod(pjp, jpm, null, null);
}
 
示例10
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);
}
 
示例11
@Override
public JoinPointMatch matchesJoinPoint(Object thisObject, Object targetObject, Object[] args) {
	try {
		return this.primary.matchesJoinPoint(thisObject, targetObject, args);
	}
	catch (ReflectionWorldException ex) {
		return this.other.matchesJoinPoint(thisObject, targetObject, args);
	}
}
 
示例12
/**
 * Get the current join point match at the join point we are being dispatched on.
 */
protected JoinPointMatch getJoinPointMatch() {
	MethodInvocation mi = ExposeInvocationInterceptor.currentInvocation();
	if (!(mi instanceof ProxyMethodInvocation)) {
		throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
	}
	return getJoinPointMatch((ProxyMethodInvocation) mi);
}
 
示例13
@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;
	ProceedingJoinPoint pjp = lazyGetProceedingJoinPoint(pmi);
	JoinPointMatch jpm = getJoinPointMatch(pmi);
	return invokeAdviceMethod(pjp, jpm, null, null);
}
 
示例14
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);
}
 
示例15
@Override
public JoinPointMatch matchesJoinPoint(Object thisObject, Object targetObject, Object[] args) {
	try {
		return this.primary.matchesJoinPoint(thisObject, targetObject, args);
	}
	catch (ReflectionWorldException ex) {
		return this.other.matchesJoinPoint(thisObject, targetObject, args);
	}
}
 
示例16
/**
 * Get the current join point match at the join point we are being dispatched on.
 */
protected JoinPointMatch getJoinPointMatch() {
	MethodInvocation mi = ExposeInvocationInterceptor.currentInvocation();
	if (!(mi instanceof ProxyMethodInvocation)) {
		throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
	}
	return getJoinPointMatch((ProxyMethodInvocation) mi);
}
 
示例17
protected Object invokeAdviceMethod(JoinPoint jp, @Nullable JoinPointMatch jpMatch,
		@Nullable Object returnValue, @Nullable Throwable t) throws Throwable {

	return invokeAdviceMethodWithGivenArgs(argBinding(jp, jpMatch, returnValue, t));
}
 
示例18
@Nullable
protected JoinPointMatch getJoinPointMatch(ProxyMethodInvocation pmi) {
	String expression = this.pointcut.getExpression();
	return (expression != null ? (JoinPointMatch) pmi.getUserAttribute(expression) : null);
}
 
示例19
protected Object invokeAdviceMethod(JoinPoint jp, @Nullable JoinPointMatch jpMatch,
		@Nullable Object returnValue, @Nullable Throwable t) throws Throwable {

	return invokeAdviceMethodWithGivenArgs(argBinding(jp, jpMatch, returnValue, t));
}
 
示例20
@Nullable
protected JoinPointMatch getJoinPointMatch(ProxyMethodInvocation pmi) {
	String expression = this.pointcut.getExpression();
	return (expression != null ? (JoinPointMatch) pmi.getUserAttribute(expression) : null);
}
 
示例21
protected Object invokeAdviceMethod(JoinPoint jp, JoinPointMatch jpMatch, Object returnValue, Throwable t)
		throws Throwable {

	return invokeAdviceMethodWithGivenArgs(argBinding(jp, jpMatch, returnValue, t));
}
 
示例22
protected JoinPointMatch getJoinPointMatch(ProxyMethodInvocation pmi) {
	return (JoinPointMatch) pmi.getUserAttribute(this.pointcut.getExpression());
}
 
示例23
protected Object invokeAdviceMethod(JoinPoint jp, JoinPointMatch jpMatch, Object returnValue, Throwable t)
		throws Throwable {

	return invokeAdviceMethodWithGivenArgs(argBinding(jp, jpMatch, returnValue, t));
}
 
示例24
protected JoinPointMatch getJoinPointMatch(ProxyMethodInvocation pmi) {
	return (JoinPointMatch) pmi.getUserAttribute(this.pointcut.getExpression());
}
 
示例25
/**
 * Invoke the advice method.
 * @param jpMatch the JoinPointMatch that matched this execution join point
 * @param returnValue the return value from the method execution (may be null)
 * @param ex the exception thrown by the method execution (may be null)
 * @return the invocation result
 * @throws Throwable in case of invocation failure
 */
protected Object invokeAdviceMethod(
		@Nullable JoinPointMatch jpMatch, @Nullable Object returnValue, @Nullable Throwable ex)
		throws Throwable {

	return invokeAdviceMethodWithGivenArgs(argBinding(getJoinPoint(), jpMatch, returnValue, ex));
}
 
示例26
/**
 * Invoke the advice method.
 * @param jpMatch the JoinPointMatch that matched this execution join point
 * @param returnValue the return value from the method execution (may be null)
 * @param ex the exception thrown by the method execution (may be null)
 * @return the invocation result
 * @throws Throwable in case of invocation failure
 */
protected Object invokeAdviceMethod(
		@Nullable JoinPointMatch jpMatch, @Nullable Object returnValue, @Nullable Throwable ex)
		throws Throwable {

	return invokeAdviceMethodWithGivenArgs(argBinding(getJoinPoint(), jpMatch, returnValue, ex));
}
 
示例27
/**
 * Invoke the advice method.
 * @param jpMatch the JoinPointMatch that matched this execution join point
 * @param returnValue the return value from the method execution (may be null)
 * @param ex the exception thrown by the method execution (may be null)
 * @return the invocation result
 * @throws Throwable in case of invocation failure
 */
protected Object invokeAdviceMethod(JoinPointMatch jpMatch, Object returnValue, Throwable ex) throws Throwable {
	return invokeAdviceMethodWithGivenArgs(argBinding(getJoinPoint(), jpMatch, returnValue, ex));
}
 
示例28
/**
 * Invoke the advice method.
 * @param jpMatch the JoinPointMatch that matched this execution join point
 * @param returnValue the return value from the method execution (may be null)
 * @param ex the exception thrown by the method execution (may be null)
 * @return the invocation result
 * @throws Throwable in case of invocation failure
 */
protected Object invokeAdviceMethod(JoinPointMatch jpMatch, Object returnValue, Throwable ex) throws Throwable {
	return invokeAdviceMethodWithGivenArgs(argBinding(getJoinPoint(), jpMatch, returnValue, ex));
}