Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] LTW weaving with foreign code

Hi

On 28 March 2012 11:49, trhouse <trhouse@xxxxxxxxx> wrote:
>  Thanks for replying. I am stilla  little confused. Are you telling me not
> to bother with the VM option:
> -Djava.system.class.loader=org.aspectj.weaver.loadtime.WeavingURLClassLoader
> but instead just use
>
> -javaagent:pathto/aspectjweaver.jar as a VM option?

Yep, don't use the system property, just the javaagent.

> "The weaver will discover its configuration from the CLASSPATH"
> Actually, I am not sure what this means. Do I need to specify something in
> the classpath so that the weaver will later find it and configure itself
> appropriately?

You need to have the aspects and a relevant META-INF/aop.xml file on
the classpath so that the weaver can find them.


> I think I understand this. I am to create a META_INF folder into which an
> aop-xml file is to be written which specifies the names of the aspects I
> want applied.

Yep

> <weaver options="-debug"/>
> Hmmm I am not sure what this means .. this is a part of the XML file which
> makes the aspect execution verbose in some way?

Yep, if you want the weaver to give you debug information, just modify
the aop.xml to something like this:


 <aspectj>
 <aspects>
  <aspect name="SomeAspect"/>
 </aspects>
  <weaver options="-debug"/>
 </aspectj>


cheers
Andy

>
>
> On 28 March 2012 11:16, trhouse<trhouse@xxxxxxxxx>  wrote:
>
>>> Hi all,
>>>
>>> I am attempting to set up some LTW with a foreign (.class files only)
>>> code
>>> base.
>>>
>>> After having read the documentation I am not sure what is required.
>>> Specifically
>>>
>>>
>>> If I provide
>>>
>>> -Djava.system.class.loader=org.aspectj.weaver.loadtime.WeavingURLClassLoader
>>> as a VM option, is this sufficient or do I also need to
>>>
>>> 1) have to set ASPECTPATH as a system variable or is this just for
>>> developing aspects?
>>> 2 have to set the ASPECTJ_HOME as a system variable or is this just for
>>> developing aspects when I compile with AJC?
>>> 3) add aspectjrt.jar  to my CLASSPATH system variable or is this just for
>>> developing aspects when I compile with AJC?
>>> 4) somehow include lib/aspectjrt.jar  and aspectjweaver.jar to the
>>> runtime?
>>>
>>>
>>> So the idea is clear, I have foreign code. I have aspects already
>>> compiled.
>>> I just want to run the foreign code as usual, but have the LTW apply
>>> itself
>>> and execute the aspects as appropriate.
>>>
>>>
>>> Many thanks...
>>>
>>>
>>>
>>> _______________________________________________
>>> aspectj-users mailing list
>>> aspectj-users@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top