[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [aspectj-users] Lazy weaving vs eager weaving?
- From: Andy Clement <andrew.clement@xxxxxxxxx>
- Date: Tue, 22 Feb 2011 09:22:19 -0800
- Delivered-to: firstname.lastname@example.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=jWqX4ij4Oo3ZcsdC+N4O/rH/d82L7MW9nwzLZ3xEqwQ=; b=eyKlSzCHMBaNZ6nRvK5wZHaR1kTNhBg7HbO/OhE8x1XZHmJcRP3Avz1bG8U3zeo2ga yJTuAaajpr6XjCGed9j0Y/ylzw/yRnt6Xw3O+h6jmPIBcHGeSgkNjLukA5heMxgIwe1p iW4mL9Xqczvh0KO2lv9c5XpEEHKoL6Z7QrXuQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=aqmzqTGg/rn+lJRC2mLNdPS4gp+U+30G+zBaGn8UYb/d/luW4Lmg/x5+Afab7XQu6n uWq6w8S/2wF9k6Ff2lMKynGefvZ38X4CdKMeQ99C3rgRgyX7mTpdi3qjnMR2CJ1AXGLG DUGdQFxZ7RzhsBpJpusWL7/NukIrl7Hky7YXc=
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.
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?
> 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
> Lee Grey
> aspectj-users mailing list