Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » exclude instance initialization method and interface initialization method
exclude instance initialization method and interface initialization method [message #675727] Wed, 01 June 2011 10:16 Go to next message
moha  is currently offline moha Friend
Messages: 43
Registered: March 2011
Member
Hi,

I want to know how can i exclude instance initialization method and interface
initialization method in aspectj pointcut ???


thanks in advance .
Re: exclude instance initialization method and interface initialization method [message #675849 is a reply to message #675727] Wed, 01 June 2011 17:33 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
Do you mean constructors? All object initializers are pushed into one or more constructors as the class is being compiled. Interfaces are not allowed to have object initializers.
Re: exclude instance initialization method and interface initialization method [message #676000 is a reply to message #675849] Thu, 02 June 2011 10:44 Go to previous messageGo to next message
moha  is currently offline moha Friend
Messages: 43
Registered: March 2011
Member
Hi Andrew,

Thanks for your answer .I mean the methods wich have <init> and <clinit> in bytecode java .

you can look at this link :

http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html#12174

paragraph : 3.9 Specially Named Initialization Methods

in order to have an idea about wath i mean by instance initialization method and

interface initialization method .

thanks.
Re: exclude instance initialization method and interface initialization method [message #676191 is a reply to message #676000] Fri, 03 June 2011 06:51 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
OK. See here:
http://eclipse.org/aspectj/doc/released/progguide/quick.html#quick-pointcuts

You are interested in the initialization, staticinitialization, and potentialy the preinitialization pointcuts.
Re: exclude instance initialization method and interface initialization method [message #676225 is a reply to message #676191] Fri, 03 June 2011 09:25 Go to previous messageGo to next message
moha  is currently offline moha Friend
Messages: 43
Registered: March 2011
Member
Hi Andrew ,


Thanks for your informations , it's wath i need .

Now i put in my pointcut only execution(* test.test..*.*()) and i want to know if

staticinitialization,initialization and preinitialization are automatically excluded or no ?

thanks.
Re: exclude instance initialization method and interface initialization method [message #676633 is a reply to message #676225] Sun, 05 June 2011 19:51 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
You would need to do:


staticinitialization(test.test..*)

or

initialization(* test.test..*.new(..))

or

preinitialization(* test.test..*.new(..))

note that staticinitialzation uses a type signature whereas (pre)initialization uses a constructor signature.
Re: exclude instance initialization method and interface initialization method [message #677438 is a reply to message #676633] Wed, 08 June 2011 14:30 Go to previous messageGo to next message
moha  is currently offline moha Friend
Messages: 43
Registered: March 2011
Member
Hi Andrew,

thanks for your answer .what i want is to exclude

staticinitialization,initialization and preinitialization methods ,in other word

want to execute my advice when the executed method isn't a staticinitialization(test.test..*) or in initialization(* test.test..*.new(..)) or in preinitialization(* test.test..*.new(..))

what i want to now is : if i use execution(* test.test..*.*()) i can get

staticinitialization or preinitialization or initialization methods in my joinpoint or

no.

otherwise if i do something like execution(* test.test..*.*()) && !preinitialization(* test.test..*.new(..)) && !staticinitialization(test.test..*) && ! initialization(* test.test..*.new(..))

it's equivalent (or not) to execution(* test.test..*.*()) ???


thanks in advance ;



Re: exclude instance initialization method and interface initialization method [message #677538 is a reply to message #677438] Wed, 08 June 2011 18:49 Go to previous message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
Yes. It is equivalent.
Previous Topic:Problem installing updates 3.6
Next Topic:Per VM singleton aspect
Goto Forum:
  


Current Time: Thu Apr 25 08:31:52 GMT 2024

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

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

Back to the top