Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » How to access 'this'
How to access 'this' [message #585336] Mon, 20 December 2004 19:22
Eclipse UserFriend
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
Previous Topic:HelloWorld with a twist
Next Topic:How to access 'this'
Goto Forum:
  


Current Time: Tue Apr 16 22:08:08 GMT 2024

Powered by FUDForum. Page generated in 3.82846 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top