public class JarClassLoader extends SecureClassLoader
Modifier and Type | Method and Description |
---|---|
void |
close()
Method to safely close the JarClassLoader
|
static JarClassLoader |
createBootstrapClassLoader(File fileForFatJar,
List<String> listOfBridgeInterfaces,
java.nio.file.Path tmpDir)
Factory to create a JarClassLoader.
|
static JarClassLoader |
createWithParent(File fileForFatJar,
ClassLoader parentClassLoader,
List<String> listOfBridgeInterfaces,
java.nio.file.Path tmpDir)
Factory to create a JarClassLoader.
|
static long |
getNumberOfInstances()
Number of existing instances of the class.
|
Class<?> |
loadClass(String name) |
void |
unload() |
clearAssertionStatus, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus
public static JarClassLoader createWithParent(File fileForFatJar, ClassLoader parentClassLoader, List<String> listOfBridgeInterfaces, java.nio.file.Path tmpDir) throws MalformedURLException
fileForFatJar
- is the File object for the "fat" jar which we are loading classes fromparentClassLoader
- is the classloader we will load from if classes aren't in the fat jar filelistOfBridgeInterfaces
- is the name of classes which bridge the classloaders (e.g. com.cisco.thunderhead.plugin.example.ExamplePluginInterface)tmpDir
- Path to unload embedded jars intoMalformedURLException
- when URL is not formed correctlypublic static JarClassLoader createBootstrapClassLoader(File fileForFatJar, List<String> listOfBridgeInterfaces, java.nio.file.Path tmpDir) throws MalformedURLException
fileForFatJar
- is the File object for the "fat" jar which we are loading classes fromlistOfBridgeInterfaces
- is the name of classes which bridge the classloaders (e.g. com.cisco.thunderhead.plugin.example.ExamplePluginInterface)tmpDir
- Path to unload embedded jars intoMalformedURLException
- when URL is not formed correctlypublic static long getNumberOfInstances()
public void close() throws IOException
IOException
- when close operation failspublic void unload() throws IOException
IOException
public Class<?> loadClass(String name) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
ClassLoader.loadClass(String)
Copyright © 2018. All rights reserved.