Dowloading classes to an applet
I need to download new classes into my applet to be dynamically loaded at runtime.
Issue is of course that the URLClassLoader and the sandbox prohibit this for obvious reasons.
However, since the code to be downloaded would and does NOT violate any default policies provided on a standard java installation, is there a way to do this?
NOTE: In fact the code to be downloaded is the same code that currently runs in the applet and is pulled with the applet jars and dynamically loaded from them with the default class loader.The difference is which component is involved in the download and instantiation of the code.
The reason I want to do this is so the client can be updated at runtime without the user having to shut down and restart the browser with each release. This approch works well with current applications and needs to be extended to work in an applet.
In addition we do not want to use a signed applet due to the myriad of issues associated with that approach, do not want our users to have to edit their policy files and do not want the applet to become an application to skirt this issue either. It is important for us and our users that they know and can trust that we do not violate the sandbox.
I guess a secondary issue would be:
Why does URLClassLoader alone restrict this sort of action and not rely on higher level security checks as the code runs? In other words, I think it should be acceptable to download new code to an applet, but let the SecurityManager (sandbox) do checks when there are policy decisions to be made. Such as an attempt at file I/O, native calls, etc. If the code does not violate the policies in place then it should be allowed to operate freely.
If any one has any suggested work arounds or solutions, please let me know.
Thanks!

