kfinkels
kfinkels

Reputation:

How can I make Loadtime-AspectJ to work in applet

Since AspectJ LoadTime-Weaving needs to load the JVM with an agent/it's own classloader - is there a way to load/make changes in the user's JVM from my applet? or maybe just before loading the applet (with a parent applet?)

Upvotes: 2

Views: 581

Answers (2)

Cojones
Cojones

Reputation: 1954

It might be possible to add a weaving agent after the JVM is started, see: How can I add a Javaagent to a JVM without stopping the JVM?

Upvotes: 2

Chris R
Chris R

Reputation: 17906

I'm afraid you'll be completely out of luck there. According to the Sun docs on applet classloaders, a "web browser uses only one class loader, which is established at start-up. Thereafter, the system class loader cannot be extended, overloaded, overridden or replaced. Applets cannot create or reference their own class loader" (emphasis mine).

You will probably have more success with compile-time weaving on this problem, unless there's some reason why you can't do that.

If the applet is signed, however, you might be able to work around this. AspectJ is not really clear on what its requirements are by way of Java Security. I'd get on the AspectJ mailing list and ask.

Upvotes: 1

Related Questions