[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?
|
- From: Gary Bisaga <gbisaga@xxxxxxxxx>
- Date: Tue, 16 Feb 2010 13:33:52 -0500
- Delivered-to: aspectj-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=aOiqI6SRG/j5OqOLZPb0Ox1lv3dZD3mn72BbHRi4k/A=; b=p1nBQ3ot3Ctv/SNfDgA09LofUFlqNpj71vuA1VbHqFEz1UMpPprzOIwvmfXGfMnWKD d41Q9P7sld9AvLZJ0BwmVBC3UWrZwoHTqKLgE1t7L4JW5c3H8vO2aAfy5LdYAsVJyx/u J6VKRl4hRMP3c4tRfPEMUCMceiA/EidDEeHFI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=syovvdQ4OrnGB10s1fVUtuXYWqf1SUm/+icFFW+OOG1lvUK5dsF3K8vMaJfgmjfsdP HSzn1d5myeEpK/39EGCN6vA7e0WxCdxvjn6M6/hDMfjdmopKkmfTTBd7+B0WAcFPmTQv gvK728S704FAPZim3mMp4ivcQWj1wObX9yCa8=
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.