Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] lauching applications from another one with load-time weaving


Fabio,

That looks fine. It's the way the AspectJ LTW test harness works (roughly). I am puzzled that you need to included the TesteAspects directory as well as the aspects.jar though.

Cheers

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/



Fabio Fagundes Silveira <ffs@xxxxxx>
Sent by: aspectj-users-bounces@xxxxxxxxxxx

30/10/2006 16:46

Please respond to
aspectj-users@xxxxxxxxxxx

To
aspectj-users@xxxxxxxxxxx
cc
Subject
Re: [aspectj-users] lauching applications from another one        with        load-time weaving





Hello,

  I've just got this working ... I decided to post here this solution
just in case anyone needs ...

try {
URL urlList[] = {
                new File("/home/ffs/workspace/TesteAspects").toURL(),
                new File("/home/ffs/workspace/TesteAspects/aspects.jar")
                                 .toURL() };

ClassLoader loader = new URLClassLoader(urlList);
                                 
Test2 t = new Test2();
Class cls1 = Class.forName("Test1", true, loader );
String s[] = new String[] {};
Object arguments[] = new Object[] { s };
Method mainMethod = cls1.getMethod("main", new Class[] { s
                .getClass() });
Object result = mainMethod.invoke(null, arguments);

System.out.println(cls1.getClassLoader());
System.out.println(t.getClass().getClassLoader());
} catch...


Regards,
Fabio
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top