Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Are static initializers of an aspect guaranteed to be called?

I read (for example in AspectJ in Action) it emphasized that while an
aspect is in many ways like a class, an aspect is *not* a class. What
I would like to do is to write a static initializer block for my aspect:

public aspect MyAspect {
 private static SomeClass myObject;
 static {
   myObject = new SomeClass (...);
 }
}

Here is my question: is my static initializer guaranteed to be called
when the aspect is loaded? For that matter, are aspects loaded via
normal ClassLoaders? Thanks.


Back to the top