[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Lazy weaving vs eager weaving?

Hi,

There is no direct control for this.  You kind of have two options:

(1) touch the aspect yourself much earlier, to cause it to be loaded
up.  Just refer to something in it from one of your earlier loaded
classes that will cause it to be loaded.
(2) Use it to 'harmlessly' weave something that is loaded much
earlier, which kind of causes (1) to happen.

cheers
Andy

On 22 February 2011 08:57, Grey, Lee <Lee.Grey@xxxxxxx> wrote:
> Is there any way to control when an aspect gets loaded and initialized?
>
> Thanks,
> Lee
> ________________________________
> From: aspectj-users-bounces@xxxxxxxxxxx
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Grey, Lee
> Sent: Monday, February 21, 2011 12:58 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] Lazy weaving vs eager weaving?
>
> I'm still working on the weaving of Sonic ESB container services, and it's
> working perfectly with one exception.
>
> I'm instantiating a thread object in a static block of my aspect.
> Unfortunately, the static block doesn't execute until the first time a
> message is received, even though the container JVM had started long ago.
> Aside from the fact that the thread doesn't start when it should, there is
> also a very long hit for all the class loading and weaving on receipt of
> that first message.
>
> Is there any way to have the weaving occur immediately, which I'm assuming
> would be the way to have the static block execute prior to receiving a
> message?
>
> Thanks,
> Lee Grey
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>