com.sun.jdo.api.persistence.enhancer
Class EnhancerClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by com.sun.jdo.api.persistence.enhancer.EnhancerClassLoader

public class EnhancerClassLoader
extends URLClassLoader

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

Author:
Yury Kamen

Field Summary
static String DO_SIMPLE_TIMING
           
static String VERBOSE_LEVEL
           
static String VERBOSE_LEVEL_DEBUG
           
static String VERBOSE_LEVEL_QUIET
           
static String VERBOSE_LEVEL_VERBOSE
           
static String VERBOSE_LEVEL_WARN
           
 
Constructor Summary
  EnhancerClassLoader(String classpath, JDOMetaData metaData, Properties settings, PrintWriter out)
          Creates a new EnhancerClassLoader for the specified url.
  EnhancerClassLoader(String classpath, Properties settings, PrintWriter out)
          Creates a new EnhancerClassLoader for the specified url.
protected EnhancerClassLoader(URL[] urls)
          Creates a new EnhancerClassLoader for the specified url.
protected EnhancerClassLoader(URL[] urls, ClassLoader loader)
          Creates a new EnhancerClassLoader for the specified url.
  EnhancerClassLoader(URL[] urls, JDOMetaData metaData, Properties settings, PrintWriter out)
          Creates a new EnhancerClassLoader for the specified url.
  EnhancerClassLoader(URL[] urls, Properties settings, PrintWriter out)
          Creates a new EnhancerClassLoader for the specified url.
 
Method Summary
protected  void addURL(URL url)
          Appends the specified URL to the list of URLs to search for classes and resources.
 Class loadClass(String name, boolean resolve)
           
static URL[] pathToURLs(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_SIMPLE_TIMING

public static final String DO_SIMPLE_TIMING
See Also:
Constant Field Values

VERBOSE_LEVEL

public static final String VERBOSE_LEVEL
See Also:
Constant Field Values

VERBOSE_LEVEL_QUIET

public static final String VERBOSE_LEVEL_QUIET
See Also:
Constant Field Values

VERBOSE_LEVEL_WARN

public static final String VERBOSE_LEVEL_WARN
See Also:
Constant Field Values

VERBOSE_LEVEL_VERBOSE

public static final String VERBOSE_LEVEL_VERBOSE
See Also:
Constant Field Values

VERBOSE_LEVEL_DEBUG

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

EnhancerClassLoader

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

Parameters:
urls - the classpath to search

EnhancerClassLoader

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

Parameters:
urls - the classpath to search

EnhancerClassLoader

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

Parameters:
classpath - the classpath to search

EnhancerClassLoader

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

Parameters:
urls - the classpath to search

EnhancerClassLoader

public EnhancerClassLoader(String classpath,
                           JDOMetaData metaData,
                           Properties settings,
                           PrintWriter out)
Creates a new EnhancerClassLoader for the specified url.

Parameters:
classpath - the classpath to search

EnhancerClassLoader

public EnhancerClassLoader(URL[] urls,
                           JDOMetaData metaData,
                           Properties settings,
                           PrintWriter out)
Creates a new EnhancerClassLoader for the specified url.

Parameters:
urls - the classpath to search
Method Detail

pathToURLs

public static URL[] pathToURLs(String classpath)

addURL

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

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

loadClass

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


Copyright © 2012. All Rights Reserved.