[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [aspectj-users] Catch-all pointcut
- From: Frank Pavageau <frank.pavageau@xxxxxxxxx>
- Date: Mon, 11 Apr 2011 13:16:07 +0200
- 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; bh=qzKtMbXwtquIo3qYfaSsk8Pmhs4s+NaynluHPiE0wbs=; b=WVPvB6YdiTdBROm6c+ZlZO7fWPC7f02+kqTudrYUadqidLCnFhtvyTk+b8nA4dkQQW hRO3VmQJNsXtcGBU4mWFsOC/4sKlzhWVBpLSm2fXvFvUjGd90HxLRHNi7QJzvc12o1rn vBWf1Dv7JCRAaGi9AlfmU44KUMIihMeFFAzLA=
- 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; b=DhovTpZpIB2EETVYNNmKXSVJKTaf4w58eTYavVE2N+ucU+gzVn94FYwU7dmEtSnn93 0ljPwn0xm/WowwtTKP3EYMCjHL4seg7DyFpXc/v38CLvaB4jvGbucTLezRL1SJcpY70R TOOF6bTx3tXmMOMFMQKpzcc76yXIbnTqZwzc8=
On Mon, Apr 11, 2011 at 11:23 AM, Tiago Espinha <tiago@xxxxxxxxxx> wrote:
> Assume I have two jars:
> - RunnableFile.jar
> - Library.jar
> The RunnableFile.jar is a runnable jar, contains a main method in one of its
> classes but it depends on Library.jar . This means that whenever I run the
> RunnableFile, I need to include Library.jar in the classpath, otherwise it
> won't work.
> Let's also assume that I absolutely cannot touch Library.jar, but I want to
> be able to catch method calls of any method contained in Library.jar. Is
> there any way of instrumenting RunnableFile.jar so that any method calls of
> any library that it loads are also captured?
> I've done a * *.* pointcut that I wove into RunnableFile.jar but since only
> this JAR is instrumented, only the methods of classes within this JAR
> actually get advised. Is there any way of going around this by instrumenting
> just the "main" JAR?
Correct me if I'm wrong : you want to advise all method calls, even
those done by the classes in Library.jar themselves? You could use
load-time weaving instead of compile time-time weaving. Otherwise, you
can't advise methods of classes you can't modify.