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

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?


Back to the top