Module jEdit

Class ClassManagerImpl

java.lang.Object
org.gjt.sp.jedit.bsh.BshClassManager
org.gjt.sp.jedit.bsh.classpath.ClassManagerImpl

public class ClassManagerImpl extends BshClassManager
        Manage all classloading in BeanShell.
        Allows classpath extension and class file reloading.

        This class holds the implementation of the BshClassManager so that it
        can be separated from the core package.

        This class currently relies on 1.2 for BshClassLoader and weak references.
        Is there a workaround for weak refs?  If so we could make this work
        with 1.1 by supplying our own classloader code...

        See "http://www.beanshell.org/manual/classloading.html" for details
        on the bsh classloader architecture.

        Bsh has a multi-tiered class loading architecture.  No class loader is
        created unless/until a class is generated, the classpath is modified, 
        or a class is reloaded.

        Note: we may need some synchronization in here

        Note on jdk1.2 dependency:

        We are forced to use weak references here to accomodate all of the 
        fleeting namespace listeners.  (NameSpaces must be informed if the class 
        space changes so that they can un-cache names).  I had the interesting 
        thought that a way around this would be to implement BeanShell's own 
        garbage collector...  Then I came to my senses and said - screw it, 
        class re-loading will require 1.2.

        ---------------------

        Classloading precedence:

        in-script evaluated class (scripted class)
        in-script added / modified classpath

        optionally, external classloader
        optionally, thread context classloader

        plain Class.forName()
        source class (.java file in classpath)