Java Code Examples for org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotation#getAnnotationType()

The following examples show how to use org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory.AspectJAnnotation#getAnnotationType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InstantiationModelAwarePointcutAdvisorImpl.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Duplicates some logic from getAdvice, but importantly does not force
 * creation of the advice.
 */
private void determineAdviceType() {
	AspectJAnnotation<?> aspectJAnnotation =
			AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(this.aspectJAdviceMethod);
	if (aspectJAnnotation == null) {
		this.isBeforeAdvice = false;
		this.isAfterAdvice = false;
	}
	else {
		switch (aspectJAnnotation.getAnnotationType()) {
			case AtPointcut:
			case AtAround:
				this.isBeforeAdvice = false;
				this.isAfterAdvice = false;
				break;
			case AtBefore:
				this.isBeforeAdvice = true;
				this.isAfterAdvice = false;
				break;
			case AtAfter:
			case AtAfterReturning:
			case AtAfterThrowing:
				this.isBeforeAdvice = false;
				this.isAfterAdvice = true;
				break;
		}
	}
}
 
Example 2
Source File: InstantiationModelAwarePointcutAdvisorImpl.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Duplicates some logic from getAdvice, but importantly does not force
 * creation of the advice.
 */
private void determineAdviceType() {
	AspectJAnnotation<?> aspectJAnnotation =
			AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(this.aspectJAdviceMethod);
	if (aspectJAnnotation == null) {
		this.isBeforeAdvice = false;
		this.isAfterAdvice = false;
	}
	else {
		switch (aspectJAnnotation.getAnnotationType()) {
			case AtPointcut:
			case AtAround:
				this.isBeforeAdvice = false;
				this.isAfterAdvice = false;
				break;
			case AtBefore:
				this.isBeforeAdvice = true;
				this.isAfterAdvice = false;
				break;
			case AtAfter:
			case AtAfterReturning:
			case AtAfterThrowing:
				this.isBeforeAdvice = false;
				this.isAfterAdvice = true;
				break;
		}
	}
}
 
Example 3
Source File: InstantiationModelAwarePointcutAdvisorImpl.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Duplicates some logic from getAdvice, but importantly does not force
 * creation of the advice.
 */
private void determineAdviceType() {
	AspectJAnnotation<?> aspectJAnnotation =
			AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(this.aspectJAdviceMethod);
	if (aspectJAnnotation == null) {
		this.isBeforeAdvice = false;
		this.isAfterAdvice = false;
	}
	else {
		switch (aspectJAnnotation.getAnnotationType()) {
			case AtAfter:
			case AtAfterReturning:
			case AtAfterThrowing:
				this.isAfterAdvice = true;
				this.isBeforeAdvice = false;
				break;
			case AtAround:
			case AtPointcut:
				this.isAfterAdvice = false;
				this.isBeforeAdvice = false;
				break;
			case AtBefore:
				this.isAfterAdvice = false;
				this.isBeforeAdvice = true;
		}
	}
}
 
Example 4
Source File: InstantiationModelAwarePointcutAdvisorImpl.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Duplicates some logic from getAdvice, but importantly does not force
 * creation of the advice.
 */
private void determineAdviceType() {
	AspectJAnnotation<?> aspectJAnnotation =
			AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(this.method);
	if (aspectJAnnotation == null) {
		this.isBeforeAdvice = false;
		this.isAfterAdvice = false;
	}
	else {
		switch (aspectJAnnotation.getAnnotationType()) {
			case AtAfter:
			case AtAfterReturning:
			case AtAfterThrowing:
				this.isAfterAdvice = true;
				this.isBeforeAdvice = false;
				break;
			case AtAround:
			case AtPointcut:
				this.isAfterAdvice = false;
				this.isBeforeAdvice = false;
				break;
			case AtBefore:
				this.isAfterAdvice = false;
				this.isBeforeAdvice = true;
		}
	}
}