private Monitor resolveAnnotation(final ProceedingJoinPoint pjp) {
		final Signature signature = pjp.getSignature();
		final Class<?> type = signature.getDeclaringType();
		final Method method = (signature instanceof MethodSignature) ? MethodSignature.class.cast(signature).getMethod() :
				null;
		final Monitor methodMonitorAnn = method != null ? findAnnotation(method, Monitor.class) : null;
		if (methodMonitorAnn != null)
			return methodMonitorAnn;
		return findTypeAnnotation(type, Monitor.class);
	}
private Monitor resolveAnnotation ( final ProceedingJoinPoint pjp ) { final Signature signature = pjp . getSignature ( ) ; final Class < ? > type = signature . getDeclaringType ( ) ; final Method method = ( signature instanceof MethodSignature ) ? MethodSignature . class . cast ( signature ) . getMethod ( ) : null ; final Monitor methodMonitorAnn = method != null ? findAnnotation ( method , Monitor . class ) : null ; if ( methodMonitorAnn != null ) return methodMonitorAnn ; return findTypeAnnotation ( type , Monitor . class ) ; }
Trying to resolve {@link Monitor} annotation first in method annotations scope, then in class scope. Note - method will also check
if {@link Monitor} is Placed to some other annotation as meta!
Search order :
- 1 method;
- 2 type.

@param pjp
{@link ProceedingJoinPoint}
@return {@link Monitor} or {@code null}