public final class InstrClassLoader
extends java.net.URLClassLoader
| Modifier and Type | Class and Description |
|---|---|
private static class |
InstrClassLoader.PoolEntry |
| Modifier and Type | Field and Description |
|---|---|
private static int |
BAOS_INIT_SIZE |
private static int |
BAOS_MAX_SIZE |
private static int |
BAOS_POOL_SIZE |
private static java.net.URL[] |
EMPTY_URL_ARRAY |
private InstrClassLoader.PoolEntry[] |
m_bufPool |
private java.util.Map |
m_cache |
private int |
m_cacheHits |
private int |
m_cacheMisses |
private IInclExclFilter |
m_forcedDelegationFilter |
private IClassLoadHook |
m_hook |
private Logger |
m_log |
private int |
m_nestLevel |
private java.lang.ClassLoader |
m_parent |
private IInclExclFilter |
m_throughDelegationFilter |
static java.lang.String |
PROPERTY_FORCED_DELEGATION_FILTER |
static java.lang.String |
PROPERTY_THROUGH_DELEGATION_FILTER |
| Constructor and Description |
|---|
InstrClassLoader(java.lang.ClassLoader parent,
java.io.File[] classpath,
IInclExclFilter forcedDelegationFilter,
IInclExclFilter throughDelegationFilter,
IClassLoadHook hook,
java.util.Map cache) |
| Modifier and Type | Method and Description |
|---|---|
private InstrClassLoader.PoolEntry |
acquirePoolEntry() |
void |
debugDump(java.io.PrintWriter out) |
private java.lang.Class |
defineClass(java.lang.String className,
byte[] bytes,
int length,
java.net.URL srcURL) |
private static java.net.URL[] |
filesToURLs(java.io.File[] classpath) |
protected java.lang.Class |
findClass(java.lang.String name) |
java.net.URL |
getResource(java.lang.String name) |
java.lang.Class |
loadClass(java.lang.String name,
boolean resolve)
Overrides java.lang.ClassLoader.loadClass() to change the usual parent-child
delegation rules just enough to be able to 'replace' the parent loader.
|
private static void |
readFully(java.io.InputStream in,
ByteArrayOStream out,
byte[] buf)
Reads the entire contents of a given stream into a flat byte array.
|
private void |
releasePoolEntry(InstrClassLoader.PoolEntry buf) |
addURL, close, definePackage, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic static final java.lang.String PROPERTY_FORCED_DELEGATION_FILTER
public static final java.lang.String PROPERTY_THROUGH_DELEGATION_FILTER
private final java.lang.ClassLoader m_parent
private final IInclExclFilter m_forcedDelegationFilter
private final IInclExclFilter m_throughDelegationFilter
private final java.util.Map m_cache
private final IClassLoadHook m_hook
private final InstrClassLoader.PoolEntry[] m_bufPool
private final Logger m_log
private int m_nestLevel
private int m_cacheHits
private int m_cacheMisses
private static final int BAOS_INIT_SIZE
private static final int BAOS_MAX_SIZE
private static final int BAOS_POOL_SIZE
private static final java.net.URL[] EMPTY_URL_ARRAY
public InstrClassLoader(java.lang.ClassLoader parent,
java.io.File[] classpath,
IInclExclFilter forcedDelegationFilter,
IInclExclFilter throughDelegationFilter,
IClassLoadHook hook,
java.util.Map cache)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic final java.lang.Class loadClass(java.lang.String name,
boolean resolve)
throws java.lang.ClassNotFoundException
loadClass in class java.lang.ClassLoaderjava.lang.ClassNotFoundExceptionpublic final java.net.URL getResource(java.lang.String name)
getResource in class java.lang.ClassLoaderprotected final java.lang.Class findClass(java.lang.String name)
throws java.lang.ClassNotFoundException
findClass in class java.net.URLClassLoaderjava.lang.ClassNotFoundExceptionpublic void debugDump(java.io.PrintWriter out)
private java.lang.Class defineClass(java.lang.String className,
byte[] bytes,
int length,
java.net.URL srcURL)
private static java.net.URL[] filesToURLs(java.io.File[] classpath)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionprivate static void readFully(java.io.InputStream in,
ByteArrayOStream out,
byte[] buf)
throws java.io.IOException
java.io.IOExceptionprivate InstrClassLoader.PoolEntry acquirePoolEntry()
private void releasePoolEntry(InstrClassLoader.PoolEntry buf)