com.vladium.emma.rt
Class InstrClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
com.vladium.emma.rt.InstrClassLoader
public final class InstrClassLoader
- extends java.net.URLClassLoader
- Author:
- Vlad Roubtsov, (C) 2003
Methods inherited from class java.net.URLClassLoader |
addURL, definePackage, 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, 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 |
PROPERTY_FORCED_DELEGATION_FILTER
public static final java.lang.String PROPERTY_FORCED_DELEGATION_FILTER
- See Also:
- Constant Field Values
PROPERTY_THROUGH_DELEGATION_FILTER
public static final java.lang.String PROPERTY_THROUGH_DELEGATION_FILTER
- See Also:
- Constant Field Values
m_parent
private final java.lang.ClassLoader m_parent
m_forcedDelegationFilter
private final IInclExclFilter m_forcedDelegationFilter
m_throughDelegationFilter
private final IInclExclFilter m_throughDelegationFilter
m_cache
private final java.util.Map m_cache
m_hook
private final IClassLoadHook m_hook
m_bufPool
private final InstrClassLoader.PoolEntry[] m_bufPool
m_log
private final Logger m_log
m_nestLevel
private int m_nestLevel
m_cacheHits
private int m_cacheHits
m_cacheMisses
private int m_cacheMisses
BAOS_INIT_SIZE
private static final int BAOS_INIT_SIZE
- See Also:
- Constant Field Values
BAOS_MAX_SIZE
private static final int BAOS_MAX_SIZE
- See Also:
- Constant Field Values
BAOS_POOL_SIZE
private static final int BAOS_POOL_SIZE
- See Also:
- Constant Field Values
EMPTY_URL_ARRAY
private static final java.net.URL[] EMPTY_URL_ARRAY
InstrClassLoader
public InstrClassLoader(java.lang.ClassLoader parent,
java.io.File[] classpath,
IInclExclFilter forcedDelegationFilter,
IInclExclFilter throughDelegationFilter,
IClassLoadHook hook,
java.util.Map cache)
throws java.net.MalformedURLException
- Throws:
java.net.MalformedURLException
loadClass
public final java.lang.Class loadClass(java.lang.String name,
boolean resolve)
throws java.lang.ClassNotFoundException
- Overrides java.lang.ClassLoader.loadClass() to change the usual parent-child
delegation rules just enough to be able to 'replace' the parent loader. This
also has the effect of detecting 'system' classes without doing any class
name-based matching.
- Overrides:
loadClass
in class java.lang.ClassLoader
- Throws:
java.lang.ClassNotFoundException
getResource
public final java.net.URL getResource(java.lang.String name)
- Overrides:
getResource
in class java.lang.ClassLoader
findClass
protected final java.lang.Class findClass(java.lang.String name)
throws java.lang.ClassNotFoundException
- Overrides:
findClass
in class java.net.URLClassLoader
- Throws:
java.lang.ClassNotFoundException
debugDump
public void debugDump(java.io.PrintWriter out)
defineClass
private java.lang.Class defineClass(java.lang.String className,
byte[] bytes,
int length,
java.net.URL srcURL)
filesToURLs
private static java.net.URL[] filesToURLs(java.io.File[] classpath)
throws java.net.MalformedURLException
- Throws:
java.net.MalformedURLException
readFully
private static void readFully(java.io.InputStream in,
ByteArrayOStream out,
byte[] buf)
throws java.io.IOException
- Reads the entire contents of a given stream into a flat byte array.
- Throws:
java.io.IOException
acquirePoolEntry
private InstrClassLoader.PoolEntry acquirePoolEntry()
releasePoolEntry
private void releasePoolEntry(InstrClassLoader.PoolEntry buf)