com.softwareag.ino.sxs
Class SXSClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by com.softwareag.ino.sxs.SXSClassLoader

public class SXSClassLoader
extends java.lang.ClassLoader

The extension class loader allows particular extensions of the class path for each extension. Creating a new instance of this class forces reloading of extension classes after reinstallation.


Constructor Summary
SXSClassLoader()
          Creates a new extension class loader with the system class path.
SXSClassLoader(java.lang.ClassLoader parent)
           
 
Method Summary
 java.net.URL findResource(java.lang.String name)
           
 java.util.Enumeration findResources(java.lang.String name)
           
 java.lang.String getClasspath()
          Gets the class path in one string.
 java.net.URL getResource(java.lang.String name)
          Get the URL of the specified resource.
 java.io.InputStream getResourceAsStream(java.lang.String name)
           
 java.lang.Class loadClass(java.lang.String name)
          Loads the specified class.
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SXSClassLoader

public SXSClassLoader()
Creates a new extension class loader with the system class path.


SXSClassLoader

public SXSClassLoader(java.lang.ClassLoader parent)
Method Detail

getClasspath

public java.lang.String getClasspath()
Gets the class path in one string.

Returns:
all components of the class path in a string separated by path separators

loadClass

public java.lang.Class loadClass(java.lang.String name)
                          throws java.lang.ClassNotFoundException
Loads the specified class.

This method is redefined here to call findClass immediately in order to force loading the class with this class loader. ClassLoader.loadClass() first invokes the parent class loader instead.

Overrides:
loadClass in class java.lang.ClassLoader
Parameters:
name - the name of the class
Returns:
the resulting Class object
Throws:
java.lang.ClassNotFoundException - if the class could not be found

findResource

public java.net.URL findResource(java.lang.String name)
Overrides:
findResource in class java.lang.ClassLoader

findResources

public java.util.Enumeration findResources(java.lang.String name)
                                    throws java.io.IOException
Overrides:
findResources in class java.lang.ClassLoader
Throws:
java.io.IOException

getResourceAsStream

public java.io.InputStream getResourceAsStream(java.lang.String name)
Overrides:
getResourceAsStream in class java.lang.ClassLoader

getResource

public java.net.URL getResource(java.lang.String name)
Get the URL of the specified resource. Can this classloader find the specified resource in the classpath?

Overrides:
getResource in class java.lang.ClassLoader
Parameters:
name - resource to look for
Returns:
URL of resource or null