public class ShrinkWrapClassLoader
extends java.net.URLClassLoader
implements java.io.Closeable
close() to free resources.| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
EMPTY
Empty String
|
private static java.util.logging.Logger |
log
Logger
|
private java.util.List<java.io.InputStream> |
openedStreams
List of all streams opened, such that they may be closed in
close(). |
| Constructor and Description |
|---|
ShrinkWrapClassLoader(Archive<?>... archives)
Constructs a new ShrinkWrapClassLoader for the specified
Archives using the default delegation parent
ClassLoader. |
ShrinkWrapClassLoader(java.lang.ClassLoader parent,
Archive<?>... archives)
Constructs a new ShrinkWrapClassLoader for the given
Archives. |
| Modifier and Type | Method and Description |
|---|---|
private void |
addArchive(Archive<?> archive) |
private void |
addArchives(Archive<?>[] archives) |
void |
close() |
addURL, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignersprivate static final java.util.logging.Logger log
private static final java.lang.String EMPTY
private final java.util.List<java.io.InputStream> openedStreams
close(). Guarded by
"this".public ShrinkWrapClassLoader(Archive<?>... archives)
Archives using the default delegation parent
ClassLoader. The Archives will be searched in the order specified for classes and resources
after first searching in the parent class loader.archives - the Archives from which to load classes and resourcespublic ShrinkWrapClassLoader(java.lang.ClassLoader parent,
Archive<?>... archives)
Archives. The Archives will be searched in
the order specified for classes and resources after first searching in the specified parent class loader.parent - the parent class loader for delegationarchives - the Archives from which to load classes and resourcesprivate void addArchives(Archive<?>[] archives)
private void addArchive(Archive<?> archive)
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.net.URLClassLoaderjava.io.IOException