Hi
AOP is something new for me, but i udenrstand most of it. However I have problem with @args. I dont know how to use it.
I know how to use @annotation, and i thought that it could be similar. I have my annotation like @giveInfo and i use it like this:
and have advice@giveInfo
public void dummyMtehod() { }
and it work fine.@Before("@annotation(package.annotation.giveInfo)" )
public void annotationAdvice(JoinPoint jp) {
System.out.println("Advice @Before " + jp.getSignature());
}
So using this i thought to use @args. Class will be like this:
and advice like this:public void dummyMethod2(@giveINfo int number) {}
it dont make any error at eclipse, but its dont give me any results, so in my opinion its not work good.@Before("@args(package.annotation.giveInfo)")
public void annotationAdvice2(JoinPoint jp) {
System.out.println("Advice @Before " + jp.getSignature());
}
some suggestion?
maybe simple example of using this?
i hope knowing how to do @args other (@target, @within) wont be a problem.


Reply With Quote
