In this regard, aspects behave just like classes. When an aspect type is
referenced for the first time, its static initializer will be called just as
for a class.

-Ramnivas

On Tue, Feb 16, 2010 at 10:33 AM, Gary Bisaga <[email protected]> wrote:

> 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.
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to