org.jboss.shrinkwrap.api.classloader
Class ShrinkWrapClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.jboss.shrinkwrap.api.classloader.ShrinkWrapClassLoader
- All Implemented Interfaces:
- Closeable
public class ShrinkWrapClassLoader
- extends URLClassLoader
- implements Closeable
Extension that will create a ClassLoader based on a Array of Archives. When done, call
close() to free resources.
- Author:
- Aslak Knutsen, ALR
|
Method Summary |
void |
close()
|
| 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, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ShrinkWrapClassLoader
public ShrinkWrapClassLoader(Archive<?>... archives)
- Constructs a new ShrinkWrapClassLoader for the specified
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.
- Parameters:
archives - the Archives from which to load classes and resources
ShrinkWrapClassLoader
public ShrinkWrapClassLoader(ClassLoader parent,
Archive<?>... archives)
- Constructs a new ShrinkWrapClassLoader for the given
Archives. The Archives will be searched in
the order specified for classes and resources after first searching in the specified parent class loader.
- Parameters:
parent - the parent class loader for delegationarchives - the Archives from which to load classes and resources
close
public void close()
throws IOException
- Specified by:
close in interface Closeable
- Throws:
IOException
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.