Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Load-time weaving with applets?

Hi,

I'm no expert on applets unfortunately, but this kind of thing has come up before. This old thread talks a little about it:

Another link:

It seems these people are using the wrapper applet approach. Do those help at all?

cheers,
Andy



On 20 February 2013 00:43, José Miguel Horcas Aguilera <horcas@xxxxxxxxxx> wrote:
I am trying to do load-time weaving in a Java Applet. Is it possible in any way? 
I do not know how to configure the AspectJ weaver in order to run aspects, in particular, I do not know how to specify the AspectJ weaver as javaagent. 

I have tried (1) using aop.xml files and specifing the -javaagent:pathto/aspectjweaver.jar option to the JVM in the server (TomCat), including the aspectjrt.jar library in the applet tag; (2) using the Java Web Start and specifying the aspectjrt.jar in the .jnlp file, but how must the aspectjweaver.jar be specified?; and (3) with another applet that wrappers the original applet and uses the WeavingURLClassLoader class.

In the last case, I get the following applet wrapping the original applet:

URL[] cpath = getClasspath("FactorialApplet.jar", "FactorialTrace.jar");
URL[] apath = getClasspath("FactorialTrace.jar");

            WeavingURLClassLoader wucl = new WeavingURLClassLoader(cpath, apath, Thread.currentThread().getContextClassLoader());
            
            Class mainApplet = wucl.loadClass("AppletFactorial");
            Object applet = mainApplet.newInstance();
           
            if (mainApplet != null) {
                Class[] args = null;
                Method init = mainApplet.getMethod("init", args);
                init.invoke(applet, (Object[])null);
                this.add((Component)applet);

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



Back to the top