contextprovider/aspectj/src/main/java/io/tracee/contextlogger/contextprovider/aspectj/util/WatchdogUtils.java
public static Watchdog getWatchdogAnnotation(final ProceedingJoinPoint proceedingJoinPoint) {

        // get watchdog annotation from method
        MethodSignature methodSignature = (MethodSignature)proceedingJoinPoint.getSignature();
        Watchdog methodAnnotation = methodSignature.getMethod().getAnnotation(Watchdog.class);

        if (methodAnnotation != null) {
            return methodAnnotation;
        }

        // get watchdog annotation at class
        return (Watchdog)proceedingJoinPoint.getSignature().getDeclaringType().getAnnotation(Watchdog.class);

    }
public static Watchdog getWatchdogAnnotation(final ProceedingJoinPoint proceedingJoinPoint) {

        // get watchdog annotation from method
        MethodSignature methodSignature = (MethodSignature)proceedingJoinPoint.getSignature();
        Watchdog methodAnnotation = methodSignature.getMethod().getAnnotation(Watchdog.class);

        if (methodAnnotation != null) {
            return methodAnnotation;
        }

        // get watchdog annotation at class
        return (Watchdog)proceedingJoinPoint.getSignature().getDeclaringType().getAnnotation(Watchdog.class);

    }
Tries to get the watchdog annotation for the called method or the methods class.

@param proceedingJoinPoint The aspectj join point
@return The watchdog annotation of the method, the class or null if neither the method or class aren't annotated with the watchdog annotation