[2128] in java-interest

home help back first fref pref prev next nref lref last post

Re: class loaders

daemon@ATHENA.MIT.EDU (Chuck McManis)
Mon Sep 25 22:48:37 1995

Date: Mon, 25 Sep 1995 17:05:12 -0700
From: cmcmanis@scndprsn.Eng.Sun.COM (Chuck McManis)
To: java-interest@java.Eng.Sun.COM, jpayne@starwave.com

>Can I define my own class loader which loads classes from the file
>system?

Yes.

>    ...  If I do, will I be subject to the security measures which are
>in place for WWWClassLoader, which loads classes from the network?

In alpha3 yes.

>								...  Or
>are the security measures dependent on that particular class loader
>subclass?

In Beta the security measures are implemented by a "SecurityManager".
There is a subclass of SecurityManager called AppletSecurity that defines
the policies for applets.

If you are an applet, the AppletClassloader will not let you instantiate
a new class loader. If you are simply a Java program you have the option
to call the security manager in your loadClass method if you so choose.

>Also, if my class loader periodically checks the file system for an
>update to that class, and reloads that class, will the system actually
>successfully start using the new definition of the class.  Something
>tells me that it will actually continue to use the original
>definition, because the class is actually stored internally in the
>interpreter.

Your latter statement is the more correct one. It is of course possible
to define a native method in your class loader that does a manual substitution
on the internal class list however that is probably a fairly dangerous
operation, especially if you make an incompatible class change.

--Chuck
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post