com.cyc.tool.subl.util
Class IsolatedClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by com.cyc.tool.subl.util.IsolatedClassLoader

public class IsolatedClassLoader
extends java.net.URLClassLoader


Field Summary
static boolean ALLOW_DYNAMIC_LOADING_OF_CODE
           
static boolean ALLOW_LOADING_OF_DIRS_FROM_INTERPRETER
           
 
Constructor Summary
IsolatedClassLoader()
           
 
Method Summary
 java.lang.Class addClassFile(java.io.File jfile)
           
 void addCode(java.lang.String stringTyped)
           
 void addDirectory(java.io.File jfile)
           
 void addJar(java.io.File jfile)
           
 void addJarClass(java.io.File jfile, java.lang.String className)
           
 void addURL(java.net.URL url)
           
static void addURLToClassPath(java.net.URL u)
           
 java.lang.Class<?> findClass(java.lang.String name)
          Finds and loads the class with the specified name from the URL search path.
 boolean isDefinedHere(java.lang.String s)
           
 java.lang.Class loadClass(java.lang.String className)
           
static java.lang.String slashify(java.lang.String path, boolean isDirectory)
           
 
Methods inherited from class java.net.URLClassLoader
findResource, findResources, getURLs, newInstance, newInstance
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOW_DYNAMIC_LOADING_OF_CODE

public static final boolean ALLOW_DYNAMIC_LOADING_OF_CODE
See Also:
Constant Field Values

ALLOW_LOADING_OF_DIRS_FROM_INTERPRETER

public static final boolean ALLOW_LOADING_OF_DIRS_FROM_INTERPRETER
See Also:
Constant Field Values
Constructor Detail

IsolatedClassLoader

public IsolatedClassLoader()
Method Detail

addURLToClassPath

public static void addURLToClassPath(java.net.URL u)
                              throws java.io.IOException
Throws:
java.io.IOException

isDefinedHere

public boolean isDefinedHere(java.lang.String s)

addURL

public void addURL(java.net.URL url)
Overrides:
addURL in class java.net.URLClassLoader

loadClass

public java.lang.Class loadClass(java.lang.String className)
                          throws java.lang.ClassNotFoundException
Overrides:
loadClass in class java.lang.ClassLoader
Throws:
java.lang.ClassNotFoundException

slashify

public static java.lang.String slashify(java.lang.String path,
                                        boolean isDirectory)

findClass

public java.lang.Class<?> findClass(java.lang.String name)
                             throws java.lang.ClassNotFoundException
Finds and loads the class with the specified name from the URL search path. Any URLs referring to JAR files are loaded and opened as needed until the class is found.

Overrides:
findClass in class java.net.URLClassLoader
Parameters:
name - the name of the class
Returns:
the resulting class
Throws:
java.lang.ClassNotFoundException - if the class could not be found

addJar

public void addJar(java.io.File jfile)
            throws java.io.IOException
Parameters:
jfile -
Throws:
java.net.MalformedURLException
java.io.IOException

addClassFile

public java.lang.Class addClassFile(java.io.File jfile)
                             throws java.io.IOException,
                                    java.lang.ClassNotFoundException
Parameters:
jfile -
Throws:
java.lang.ClassNotFoundException
java.io.IOException

addDirectory

public void addDirectory(java.io.File jfile)
                  throws java.io.IOException
Parameters:
jfile -
Throws:
java.io.IOException

addJarClass

public void addJarClass(java.io.File jfile,
                        java.lang.String className)
                 throws java.io.IOException
Parameters:
jfile -
className -
Throws:
java.io.IOException

addCode

public void addCode(java.lang.String stringTyped)
Parameters:
stringTyped -