public class ExtensionsClassLoader extends ClassLoader
Constructor and Description |
---|
ExtensionsClassLoader(ClassLoader parent,
ProtectionDomain protectionDomain,
String[] extensionJarsAndDlls,
String[] applicationPackages)
Creates a class loader.
|
ExtensionsClassLoader(ClassLoader parent,
ProtectionDomain protectionDomain,
String[] extensionJarAndDllResources,
URL[] extensionJarAndDllUrls,
String[] applicationPackages,
File cacheFolder,
String cachedFilesPrefix)
Creates a class loader.
|
ExtensionsClassLoader(ClassLoader parent,
ProtectionDomain protectionDomain,
String[] extensionJarAndDllResources,
URL[] extensionJarAndDllUrls,
String[] applicationPackages,
File cacheFolder,
String cachedFilesPrefix,
boolean cacheOnlyJars)
Creates a class loader.
|
Modifier and Type | Method and Description |
---|---|
void |
copyInputStreamToFile(InputStream input,
File file)
Copies the
input content to the given file. |
protected Class |
findClass(String name)
Finds and defines the given class among the extension JARs
given in constructor, then among resources.
|
protected String |
findLibrary(String libname)
Returns the library path of an extension DLL.
|
protected URL |
findResource(String name)
Returns the URL of the given resource searching first if it exists among
the extension JARs given in constructor.
|
protected Class |
loadClass(String name,
boolean resolve)
Loads a class with this class loader if its package belongs to
applicationPackages
given in constructor. |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLoadedClass, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public ExtensionsClassLoader(ClassLoader parent, ProtectionDomain protectionDomain, String[] extensionJarsAndDlls, String[] applicationPackages)
extensionJarsAndDlls
accessed as resources
as classpath and libclasspath elements with a higher priority than the ones of default classpath,
and will load itself all the classes belonging to packages of applicationPackages
.
No cache will be used.public ExtensionsClassLoader(ClassLoader parent, ProtectionDomain protectionDomain, String[] extensionJarAndDllResources, URL[] extensionJarAndDllUrls, String[] applicationPackages, File cacheFolder, String cachedFilesPrefix)
extensionJarAndDllResources
and extensionJarAndDllUrls
as classpath and libclasspath elements with a higher priority
than the ones of default classpath, and will load itself all the classes belonging to packages of
applicationPackages
.extensionJarAndDllResources
and extensionJarAndDllUrls
will be stored
in the given cache folder if possible, each file being prefixed by cachedFilesPrefix
.public ExtensionsClassLoader(ClassLoader parent, ProtectionDomain protectionDomain, String[] extensionJarAndDllResources, URL[] extensionJarAndDllUrls, String[] applicationPackages, File cacheFolder, String cachedFilesPrefix, boolean cacheOnlyJars)
extensionJarAndDllResources
and extensionJarAndDllUrls
as classpath and libclasspath elements with a higher priority
than the ones of default classpath, and will load itself all the classes belonging to packages of
applicationPackages
.extensionJarAndDllResources
and extensionJarAndDllUrls
will be stored
in the given cache folder if possible, each file being prefixed by cachedFilesPrefix
.public void copyInputStreamToFile(InputStream input, File file) throws FileNotFoundException, IOException
input
content to the given file.FileNotFoundException
IOException
protected Class findClass(String name) throws ClassNotFoundException
findClass
in class ClassLoader
ClassNotFoundException
protected String findLibrary(String libname)
findLibrary
in class ClassLoader
protected URL findResource(String name)
findResource
in class ClassLoader
protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException
applicationPackages
given in constructor.loadClass
in class ClassLoader
ClassNotFoundException
© Copyrights 2006-2016 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License