1

My Interface:

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface LogMethod {
    boolean isEnabled() default false;
}

My Aspect:

@Aspect
@Component
public class LogMethodAspect {

    @Pointcut("@within(com.middleware.internal.aspect.LogMethod) || @annotation(com.middleware.internal.aspect.LogMethod)")
    public void loggingPointcut() {
    }

    @Before("loggingPointcut()")
    public Object logBefore(final JoinPoint joinPoint) throws Throwable {
        //...
        return null;
    }
}

Are there any way to read value of inEnabled inside logBefore method?

Eren
  • 632
  • 1
  • 8
  • 16

0 Answers0