How to add aop for non-w760>, jersey leisure services

Hi can anyone please tell me how to add aop to a regular jersey service or any web application without spring.

I tried it with help but it didn't work. In this case, I have added aop.xml to META-INF. But still it doesn't detect the class I added with @Aspect annotation. Please someone can help me.

I am working with InteliJ IDE and my sample code as follows.

 @Aspect
public class MySimpleLoggerAspect {

    @Around("execution(* com.koderzlab.lawman.services.*.*(..))")
    public Object myTrace(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("myTrace:before call "
                + joinPoint.getTarget().getClass().getName()
                + "." + joinPoint.getSignature().getName());

        Object retVal = "it is an aspectJ sample";
        return retVal;
    }

}

      

And my aop.xml looks like this

<aspectj>
<aspects>
    <aspect name="com.koderzlab.lawman.aop.MySimpleLoggerAspect"/>
</aspects>

      

I added aop.xml to the artifact like this: WEB-INF / META-INF / aop.xml but the aspect class is not executed before going to service

+3


source to share





All Articles