|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.opennms.protocols.jmx.connectors.IsolatingClassLoader
public class IsolatingClassLoader
An extension of the URLClassLoader that ensures it loads specified packages rather letting the parent do it. The result is that classes loaded from these packages are isolated from other classloaders.
| Nested Class Summary | |
|---|---|
static class |
IsolatingClassLoader.InvalidContextClassLoaderException
|
| Constructor Summary | |
|---|---|
IsolatingClassLoader(java.lang.String name,
java.net.URL[] classpath,
java.lang.ClassLoader parent,
java.lang.String[] isolated,
boolean augmentClassPath)
|
|
IsolatingClassLoader(java.lang.String name,
java.net.URL[] classpath,
java.lang.String[] isolated,
boolean augmentClassPath)
|
|
| Method Summary | |
|---|---|
protected java.lang.Class |
loadClass(java.lang.String name,
boolean resolve)
Override to only check parent ClassLoader if the class name doesn't match our list of isolated classes. |
| Methods inherited from class java.net.URLClassLoader |
|---|
addURL, 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 |
| Constructor Detail |
|---|
public IsolatingClassLoader(java.lang.String name,
java.net.URL[] classpath,
java.lang.String[] isolated,
boolean augmentClassPath)
throws IsolatingClassLoader.InvalidContextClassLoaderException
classpath - Where to find classes.isolated - Array of fully qualified class names, or fully
qualified prefixes ending in "*", that identify the packages or
classes to isolate.augmentClassPath - true => Add the URL's of the current
thread context class loader to classpath.
IsolatingClassLoader.InvalidContextClassLoaderException - If augmentClassPath
is true and the current thread context class loader is not a
URLClassLoader.
public IsolatingClassLoader(java.lang.String name,
java.net.URL[] classpath,
java.lang.ClassLoader parent,
java.lang.String[] isolated,
boolean augmentClassPath)
throws IsolatingClassLoader.InvalidContextClassLoaderException
classpath - Where to find classes.isolated - Array of fully qualified class names, or fully
qualified prefixes ending in "*", that identify the packages or
classes to isolate.augmentClassPath - true => Add the URL's of the current
thread context class loader to classpath.
IsolatingClassLoader.InvalidContextClassLoaderException - If augmentClassPath
is true and the current thread context class loader is not a
URLClassLoader.| Method Detail |
|---|
protected java.lang.Class loadClass(java.lang.String name,
boolean resolve)
throws java.lang.ClassNotFoundException
loadClass in class java.lang.ClassLoaderjava.lang.ClassNotFoundException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||