How to access 'this' [message #585336] |
Mon, 20 December 2004 14:22 |
Eclipse User |
|
|
|
Originally posted by: sekar.gopinathan.fhlbny.com
Hi
I am trying to create an aspect for auditing within our application.
Usually our application has a service object and the service object passes
itself to the auditing service object. So in effect our service object
code would look like
serviceA{
....
execute(...){
//Do the task
auditService.execute(this)
}
Now I want to put the 'auditService.execute(this) into an aspect.
Inside my aspect can I write something like?
public aspect DoAudit {
pointcut doAudit():execution(* AbstractBusinessService.execute);
after():doAudit(){
auditStep.execute(thisJoinPoint.getThis());
}
}
When I was reading the API spec, I read that for perfomance reasons
getThis should not be used. Is my understanding correct? Or is there
any other way to do the same task. I am not sure if I missed something
from the manual. I appreciate if someone can point me in the right
direction.
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.08811 seconds