I want to use aspect method depending on specific annotation. In my scenario when I mark up my business class with @Service
annotation it is not working, but when I change it to component it starts to work.
Here is sample:
My Aspect class...
@Aspect
@Component
public class MyAspect
{
....
@Around(value="@annotation(com.myannoation.annotation.MyAnnotate)")
public Object MyMethod(ProceedingJoinPoint proceedingJoinPoint) throws Exception {
return ......
}
.......
@Component-->it is work
@Service -->it is not working
@Path("api/myapisample")
public class myapicontroller {
@POST
@Produces(MediaType.APPLICATION_JSON)
public Response confirm(MyRequest request)
{
.....