com.objectwave.customClassLoader
Class FileClassLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--com.objectwave.customClassLoader.MultiClassLoader
              |
              +--com.objectwave.customClassLoader.FileClassLoader

public class FileClassLoader
extends MultiClassLoader

Loads class bytes from a file.

Version:
$Id: FileClassLoader.java,v 2.0 2001/06/11 15:54:25 dave_hoag Exp $
Author:
Jack Harich - 8/30/97

Field Summary
 
Fields inherited from class com.objectwave.customClassLoader.MultiClassLoader
loadLocalClasses, monitorOn, sourceMonitorOn
 
Constructor Summary
FileClassLoader(java.lang.String filePrefix)
          Attempts to load from a local file using the relative "filePrefix", ie starting at the current directory.
 
Method Summary
 void addClassToSkip(java.lang.String className)
          Add the name of a class that should not be loaded by this class loader.
 java.lang.Class forceLoadClass(java.lang.String className)
           
protected  java.net.URL formatURL(java.net.URL url)
           
 java.lang.Object getContent(java.net.URL url)
          Gets the Content attribute of the FileClassLoader object
 java.io.InputStream getInputStream(java.net.URL url)
          Gets the InputStream attribute of the FileClassLoader object
protected  byte[] loadClassBytes(java.lang.String className)
          Must be implmented by subclass.
 void setLoadLocalClasses(boolean b)
           
protected  boolean useLocalLoader(java.lang.String className)
           
 
Methods inherited from class com.objectwave.customClassLoader.MultiClassLoader
findClass, formatClassName, getResource, getResourceAsStream, initPathInformation, loadClass, loadClass, loadLocalClassBytes, locateClass, lookForPreviousDefinitions, main, monitor, print, setClassNameReplacementChar
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileClassLoader

public FileClassLoader(java.lang.String filePrefix)
Attempts to load from a local file using the relative "filePrefix", ie starting at the current directory. For example

Parameters:
filePrefix - could be "webSiteClasses\\site1\\".
Method Detail

setLoadLocalClasses

public void setLoadLocalClasses(boolean b)
Parameters:
b - The new LoadLocalClasses value

getContent

public java.lang.Object getContent(java.net.URL url)
                            throws java.io.IOException
Gets the Content attribute of the FileClassLoader object

Specified by:
getContent in class MultiClassLoader
Parameters:
url -
Returns:
The Content value
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream(java.net.URL url)
                                   throws java.io.IOException
Gets the InputStream attribute of the FileClassLoader object

Specified by:
getInputStream in class MultiClassLoader
Parameters:
url -
Returns:
The InputStream value
Throws:
java.io.IOException

addClassToSkip

public void addClassToSkip(java.lang.String className)
Add the name of a class that should not be loaded by this class loader. Usefull for sharing classes.

Parameters:
className - The feature to be added to the ClassToSkip attribute

forceLoadClass

public java.lang.Class forceLoadClass(java.lang.String className)
                               throws java.lang.ClassNotFoundException
Parameters:
className -
Returns:
Throws:
java.lang.ClassNotFoundException

useLocalLoader

protected boolean useLocalLoader(java.lang.String className)
Overrides:
useLocalLoader in class MultiClassLoader
Parameters:
className -
Returns:

formatURL

protected java.net.URL formatURL(java.net.URL url)
                          throws java.io.IOException
Parameters:
url -
Returns:
Throws:
java.io.IOException

loadClassBytes

protected byte[] loadClassBytes(java.lang.String className)
Description copied from class: MultiClassLoader
Must be implmented by subclass. Use whatever means necesssary to return a byte[]. This is the only method needs to be implemented in most cases.

Specified by:
loadClassBytes in class MultiClassLoader
Parameters:
className -
Returns: