Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] using static fields in an advice

So I cannot use any static fields of the classes, unless they are officially in common like using ITD, is that right?

ITD would be theoretically fine, but  I already use the static logger field so I need probably care about the name, right?

Well just as question. Is it really necessary if AspectJ used for compile time weaving and not used any of the classes or methods within the advices, to have the aspectj-library within your program?

 

 

 

 

Von: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] Im Auftrag von Alexander Kriegisch
Gesendet: Dienstag, 12. Februar 2013 16:49
An: aspectj-users@xxxxxxxxxxx
Betreff: Re: [aspectj-users] using static fields in an advice

 

As Matthew said, you could use reflection, but the factory method Logger.getLogger is probably faster and will return the very same Logger instance as the one stored in your static field.

As for the AspectJ runtime, you need it at runtime, thus the name.


Alexander Kriegisch

 

all I would like to know if it is possible to user a calls field (static field in an advice and how does it look like.

Could be that I did not understand something. But I thought when using AspectJ to compile time the enriched program could be run without aspectj-library under certain circumstances.

But this is just another addon-question. Using a static field in an advice could be worthy in also not logging-circumstances, couldn’t it?

------------------------------------------------------------------------------------------------ Disclaimer: The contents of this electronic mail message are only binding upon Equens or its affiliates, if the contents of the message are accompanied by a lawfully recognised type of signature. The contents of this electronic mail message are privileged and confidential and are intended only for use by the addressee. If you have received this electronic mail message by error, please notify the sender and delete the message without taking notices of its content, reproducing it and using it in any way. ------------------------------------------------------------------------------------------------

Back to the top