[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-users] Load Time Weaving
|
- From: Andy Clement <andrew.clement@xxxxxxxxx>
- Date: Sat, 26 May 2012 15:50:28 -0700
- Delivered-to: aspectj-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ifXJYdNAOkYmG8yMMLogB8GoNzdRWkHj9wYNE/GLA+M=; b=gFYQhNAIFGg2dDkLpNwzshwqJ0YkSh5X0GTdI1MeLuYcw+hRyvH0Zx6T+zreHLlSBF pqU5kEE7kOcpZbBjoCi17hnGousD953KW2xrULO+lJmO/UsRhz7vBEPQ6PerxcCMBMK/ svOCCGw8TTn1uW5s5RJPHDrP7C2Wf6v7K02vwRqVr4nqJk2RSCVNHYkXXn6YcNU0pWk/ MgclreTYDU9W8DgHcaSJpyjyZ4jjpJyrsNNmnw+xFntj9DlZ4ptYOIVT2LN868wXWc1n 7y26ZkCbn5GVmeitj59StXFvjdfjZH9Qx3ibwpmP3GyAZnAp71bJMagIBtGYJkUqs3qz ru5w==
On 25 May 2012 14:43, trhouse <trhouse@xxxxxxxxx> wrote:
> Newbie here. I just need a sanity check here on LTW. Here is what I think
> ought to happen
>
> Given a properly constructed aspect and a properly configured and placed
> aop.xml, I can run any java program which has been compiled by regular old
> javac and have LTW apply aspects against it at runtime.
Yep.
> To achieve the above I have to do the all and only the following (aside from
> compiling the aspect with ajc and writing aop.xml):
>
> make certain that the classpath for regular old java program includes:
>
> jar://<path to aspectJ>aspectj1.6/lib/aspectjrt.jar!/
> <path to compiled aspects>
> <path to aop.xml containing META-INF folder>
>
> and for VM options include:
> -Djava.system.class.loader=org.aspectj.weaver.loadtime.WeavingURLClassLoader
I wouldn't do it that way. I'd use the agent:
java -javaagent:pathto/aspectjweaver.jar MyPlainJavaProgram
You should just need the java code and aspect code (and META-INF
folder) on the classpath.
cheers,
Andy