com.objectwave.tools
Class TraceClassLoader

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

public class TraceClassLoader
extends MultiClassLoader

Loads class bytes from a file.

Author:
Dave Hoag

Field Summary
 
Fields inherited from class com.objectwave.customClassLoader.MultiClassLoader
loadLocalClasses, monitorOn, sourceMonitorOn
 
Constructor Summary
TraceClassLoader()
           
 
Method Summary
 java.lang.Object getContent(java.net.URL url)
          Every custom class loader will need to be able to get the content from a modified URL.
 java.io.InputStream getInputStream(java.net.URL url)
          Every custom class loader will need to be able to get the input stream from a modified URL.
protected  byte[] loadClassBytes(java.lang.String className)
          Must be implmented by subclass.
protected  byte[] loadLocalClassBytes(java.lang.String fullClassName)
          Similar to findSystemClass but the newly defined class will have this as the ClassLoader.
 
Methods inherited from class com.objectwave.customClassLoader.MultiClassLoader
findClass, formatClassName, getResource, getResourceAsStream, initPathInformation, loadClass, loadClass, locateClass, lookForPreviousDefinitions, main, monitor, print, setClassNameReplacementChar, useLocalLoader
 
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

TraceClassLoader

public TraceClassLoader()
Method Detail

getContent

public java.lang.Object getContent(java.net.URL url)
                            throws java.io.IOException
Description copied from class: MultiClassLoader
Every custom class loader will need to be able to get the content from a modified URL. This URL will have the protocol of CCLP

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
Description copied from class: MultiClassLoader
Every custom class loader will need to be able to get the input stream from a modified URL. This URL will have the protocol of CCLP

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

loadLocalClassBytes

protected byte[] loadLocalClassBytes(java.lang.String fullClassName)
Description copied from class: MultiClassLoader
Similar to findSystemClass but the newly defined class will have this as the ClassLoader. This is important if we have cached some classes on the local machine. These classes may not be 'public' and would not be accessible to a class in the same package but loaded via a different class loader.

Overrides:
loadLocalClassBytes in class MultiClassLoader
Parameters:
fullClassName -
Returns:

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: