public class InstrumentingClassLoader extends URLClassLoader
NOTE: Should the jar files found from jre/lib/ext (System.getProperty("java.ext.dirs")) also be added to search path?
Modifier and Type | Field and Description |
---|---|
protected Map<String,Class<?>> |
classes |
protected InstrumentationContext |
ctx |
Modifier | Constructor and Description |
---|---|
protected |
InstrumentingClassLoader(InstrumentationContext ctx,
URL[] urls,
ClassLoader parent) |
Modifier and Type | Method and Description |
---|---|
Class<?> |
bootstrap(String className) |
static ClassLoader |
createClassLoader()
Creates a new InstrumentingClassloader.
|
static ClassLoader |
createClassLoader(InstrumentationContext ctx)
Creates a new InstrumentingClassloader.
|
static ClassLoader |
createClassLoader(InstrumentationContext ctx,
ClassLoader parent)
Creates a new InstrumentingClassloader.
|
static ClassLoader |
createClassLoader(InstrumentationContextProvider icp)
Creates a new InstrumentingClassloader.
|
static ClassLoader |
createClassLoader(InstrumentationContextProvider icp,
ClassLoader parent)
Creates a new InstrumentingClassloader.
|
protected CodeSource |
createCodeSource(URL location)
Form a CodeSource for loaded class.
|
Class<?> |
findClass(String name) |
protected Class<?> |
loadClass(String className,
boolean resolve) |
void |
setContext(InstrumentationContext ctx)
Set the context for the ClassLoader.
|
addURL, close, definePackage, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
protected InstrumentationContext ctx
protected InstrumentingClassLoader(InstrumentationContext ctx, URL[] urls, ClassLoader parent)
public static ClassLoader createClassLoader()
public static ClassLoader createClassLoader(InstrumentationContextProvider icp) throws JiapiException
icp
- InstrumentationContextProviderJiapiException
- on errorpublic static ClassLoader createClassLoader(InstrumentationContextProvider icp, ClassLoader parent) throws JiapiException
icp
- InstrumentationContextProviderparent
- Parent ClassLoaderJiapiException
- on errorpublic static ClassLoader createClassLoader(InstrumentationContext ctx)
ctx
- InstrumentationContextpublic static ClassLoader createClassLoader(InstrumentationContext ctx, ClassLoader parent)
ctx
- InstrumentationContextparent
- Parent ClassLoaderprotected Class<?> loadClass(String className, boolean resolve) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
protected CodeSource createCodeSource(URL location)
location
- a location where the class was loaded frompublic void setContext(InstrumentationContext ctx)
ctx
- an InstrumentationContext to be usedpublic Class<?> bootstrap(String className) throws ClassNotFoundException
ClassNotFoundException
public Class<?> findClass(String name) throws ClassNotFoundException
findClass
in class URLClassLoader
ClassNotFoundException
Copyright © 2017. All rights reserved.