org.apache.jdo.impl.enhancer
Class EnhancerClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.apache.jdo.impl.enhancer.EnhancerClassLoader

public class EnhancerClassLoader
extends java.net.URLClassLoader

Implements a ClassLoader which automatically enchances the .class files according to the EnhancerMetaData information in the jar archive.

Author:
Yury Kamen, Martin Zaun

Field Summary
static java.lang.String DO_TIMING_STATISTICS
           
static java.lang.String VERBOSE_LEVEL
           
static java.lang.String VERBOSE_LEVEL_DEBUG
           
static java.lang.String VERBOSE_LEVEL_QUIET
           
static java.lang.String VERBOSE_LEVEL_VERBOSE
           
static java.lang.String VERBOSE_LEVEL_WARN
           
 
Constructor Summary
  EnhancerClassLoader(java.lang.String classpath, EnhancerMetaData metaData, java.util.Properties settings, java.io.PrintWriter out)
          Creates a new EnhancerClassLoader for the specified url.
  EnhancerClassLoader(java.lang.String classpath, java.util.Properties settings, java.io.PrintWriter out)
          Creates a new EnhancerClassLoader for the specified url.
protected EnhancerClassLoader(java.net.URL[] urls)
          Creates a new EnhancerClassLoader for the specified url.
protected EnhancerClassLoader(java.net.URL[] urls, java.lang.ClassLoader loader)
          Creates a new EnhancerClassLoader for the specified url.
  EnhancerClassLoader(java.net.URL[] urls, EnhancerMetaData metaData, java.util.Properties settings, java.io.PrintWriter out)
          Creates a new EnhancerClassLoader for the specified url.
  EnhancerClassLoader(java.net.URL[] urls, java.util.Properties settings, java.io.PrintWriter out)
          Creates a new EnhancerClassLoader for the specified url.
 
Method Summary
protected  void addURL(java.net.URL url)
          Appends the specified URL to the list of URLs to search for classes and resources.
 java.lang.Class loadClass(java.lang.String name, boolean resolve)
           
static java.net.URL[] pathToURLs(java.lang.String classpath)
           
 
Methods inherited from class java.net.URLClassLoader
definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DO_TIMING_STATISTICS

public static final java.lang.String DO_TIMING_STATISTICS
See Also:
Constant Field Values

VERBOSE_LEVEL

public static final java.lang.String VERBOSE_LEVEL
See Also:
Constant Field Values

VERBOSE_LEVEL_QUIET

public static final java.lang.String VERBOSE_LEVEL_QUIET
See Also:
Constant Field Values

VERBOSE_LEVEL_WARN

public static final java.lang.String VERBOSE_LEVEL_WARN
See Also:
Constant Field Values

VERBOSE_LEVEL_VERBOSE

public static final java.lang.String VERBOSE_LEVEL_VERBOSE
See Also:
Constant Field Values

VERBOSE_LEVEL_DEBUG

public static final java.lang.String VERBOSE_LEVEL_DEBUG
See Also:
Constant Field Values
Constructor Detail

EnhancerClassLoader

protected EnhancerClassLoader(java.net.URL[] urls)
Creates a new EnhancerClassLoader for the specified url.

Parameters:
urls - the classpath to search

EnhancerClassLoader

protected EnhancerClassLoader(java.net.URL[] urls,
                              java.lang.ClassLoader loader)
Creates a new EnhancerClassLoader for the specified url.

Parameters:
urls - the classpath to search

EnhancerClassLoader

public EnhancerClassLoader(java.lang.String classpath,
                           java.util.Properties settings,
                           java.io.PrintWriter out)
Creates a new EnhancerClassLoader for the specified url.

Parameters:
classpath - the classpath to search

EnhancerClassLoader

public EnhancerClassLoader(java.net.URL[] urls,
                           java.util.Properties settings,
                           java.io.PrintWriter out)
Creates a new EnhancerClassLoader for the specified url.

Parameters:
urls - the classpath to search

EnhancerClassLoader

public EnhancerClassLoader(java.lang.String classpath,
                           EnhancerMetaData metaData,
                           java.util.Properties settings,
                           java.io.PrintWriter out)
Creates a new EnhancerClassLoader for the specified url.

Parameters:
classpath - the classpath to search

EnhancerClassLoader

public EnhancerClassLoader(java.net.URL[] urls,
                           EnhancerMetaData metaData,
                           java.util.Properties settings,
                           java.io.PrintWriter out)
Creates a new EnhancerClassLoader for the specified url.

Parameters:
urls - the classpath to search
Method Detail

pathToURLs

public static java.net.URL[] pathToURLs(java.lang.String classpath)

addURL

protected void addURL(java.net.URL url)
Appends the specified URL to the list of URLs to search for classes and resources.

Overrides:
addURL in class java.net.URLClassLoader
Parameters:
url - the URL to be added to the search path of URLs

loadClass

public java.lang.Class loadClass(java.lang.String name,
                                 boolean resolve)
                          throws java.lang.ClassNotFoundException
Overrides:
loadClass in class java.lang.ClassLoader
Throws:
java.lang.ClassNotFoundException


Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.