public class CompositeClassLoader extends ClassLoader implements BaseClassLoader
| Constructor and Description |
|---|
CompositeClassLoader(ClassLoader parent,
ClassLoaderDelegate delegate,
ClassLoaderDelegate companionDelegate,
BaseData data) |
| Modifier and Type | Method and Description |
|---|---|
void |
attachFragment(BundleData bundledata,
ProtectionDomain domain,
String[] classpath)
Attaches the BundleData for a fragment to this BundleClassLoader.
|
void |
close()
Closes this class loader.
|
ClasspathEntry |
createClassPathEntry(BundleFile bundlefile,
ProtectionDomain cpDomain)
Creates a classpath entry with the given bundle file and domain
|
Class |
defineClass(String name,
byte[] classbytes,
ClasspathEntry classpathEntry,
BundleEntry entry)
Defines a Class.
|
List<URL> |
findEntries(String path,
String filePattern,
int options)
Returns resource entries for the bundle associated with this class loader.
|
Class |
findLocalClass(String classname)
Finds a local class in the BundleClassLoader without
consulting the delegate.
|
URL |
findLocalResource(String resource)
Finds a local resource in the BundleClassLoader without
consulting the delegate.
|
Enumeration |
findLocalResources(String resource)
Finds all local resources in the BundleClassLoader with the specified
path without consulting the delegate.
|
Bundle |
getBundle()
Returns the
Bundle object associated with this
BundleReference. |
ClasspathManager |
getClasspathManager()
Returns the ClasspathManager for this BaseClassLoader
|
ClassLoaderDelegate |
getDelegate()
Returns the ClassLoaderDelegate used by this BundleClassLoader
|
ProtectionDomain |
getDomain()
Returns the domain for the host bundle of this class loader
|
URL |
getResource(String name)
This method will first search the parent class loader for the resource;
That failing, this method will invoke
ClassLoaderDelegate.findResource(String) to find the resource. |
void |
initialize()
Initializes the ClassLoader.
|
Collection<String> |
listLocalResources(String path,
String filePattern,
int options)
Returns the names of local resources visible to this bundle class loader.
|
Collection<String> |
listResources(String path,
String filePattern,
int options)
Returns the names of resources visible to this bundle class loader.
|
Class |
loadClass(String name)
This method will first search the parent class loader for the class;
That failing, this method will invoke
ClassLoaderDelegate.findClass(String) to find the resource. |
Object |
publicDefinePackage(String name,
String specTitle,
String specVersion,
String specVendor,
String implTitle,
String implVersion,
String implVendor,
URL sealBase)
A public version of the ClassLoader#definePackage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.net.URL) method.
|
Class |
publicFindLoaded(String classname)
A public version of the ClassLoader.findLoadedClass(java.lang.String) method.
|
Object |
publicGetPackage(String pkgname)
A public version of the ClassLoader#getPackage(java.lang.String) method.
|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetParent, getResourcespublic CompositeClassLoader(ClassLoader parent, ClassLoaderDelegate delegate, ClassLoaderDelegate companionDelegate, BaseData data)
public ClasspathEntry createClassPathEntry(BundleFile bundlefile, ProtectionDomain cpDomain)
BaseClassLoadercreateClassPathEntry in interface BaseClassLoaderbundlefile - the source bundle file for a classpath entrycpDomain - the source domain for a classpath entrypublic Class defineClass(String name, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry)
BaseClassLoaderdefineClass in interface BaseClassLoadername - the name of the class to defineclassbytes - the bytes of the class to defineclasspathEntry - the classpath entry used to load the class bytesentry - the bundle entry used to load the class bytespublic ClasspathManager getClasspathManager()
BaseClassLoadergetClasspathManager in interface BaseClassLoaderpublic ProtectionDomain getDomain()
BaseClassLoadergetDomain in interface BaseClassLoaderpublic Object publicDefinePackage(String name, String specTitle, String specVersion, String specVendor, String implTitle, String implVersion, String implVendor, URL sealBase)
BaseClassLoaderpublicDefinePackage in interface BaseClassLoaderpublic Class publicFindLoaded(String classname)
BaseClassLoaderpublicFindLoaded in interface BaseClassLoaderclassname - the class name to find.public Object publicGetPackage(String pkgname)
BaseClassLoaderpublicGetPackage in interface BaseClassLoaderpkgname - the package name to get.public void attachFragment(BundleData bundledata, ProtectionDomain domain, String[] classpath)
BundleClassLoaderattachFragment in interface BundleClassLoaderbundledata - The BundleData of the fragment.domain - The ProtectionDomain of the resources of the fragment.
Any classes loaded from the fragment's BundleData must belong to this
ProtectionDomain.classpath - An array of Bundle-ClassPath entries to
use for loading classes and resources. This is specified by the
Bundle-ClassPath manifest entry of the fragment.public void close()
BundleClassLoaderclose in interface BundleClassLoaderpublic Class findLocalClass(String classname) throws ClassNotFoundException
BundleClassLoaderfindLocalClass in interface BundleClassLoaderclassname - the classname to find.ClassNotFoundException - if the classname does not exist locally.public URL findLocalResource(String resource)
BundleClassLoaderfindLocalResource in interface BundleClassLoaderresource - the resource path to find.public Enumeration findLocalResources(String resource)
BundleClassLoaderfindLocalResources in interface BundleClassLoaderresource - the resource path to find.public ClassLoaderDelegate getDelegate()
BundleClassLoadergetDelegate in interface BundleClassLoaderpublic URL getResource(String name)
BundleClassLoaderClassLoaderDelegate.findResource(String) to find the resource.getResource in interface BundleClassLoadergetResource in class ClassLoadername - the resource path to get.null if the resource is not found.public void initialize()
BundleClassLoaderinitialize in interface BundleClassLoaderpublic Class loadClass(String name) throws ClassNotFoundException
BundleClassLoaderClassLoaderDelegate.findClass(String) to find the resource.loadClass in interface BundleClassLoaderloadClass in class ClassLoadername - the class name to load.ClassNotFoundExceptionpublic Bundle getBundle()
BundleReferenceBundle object associated with this
BundleReference.getBundle in interface BundleReferenceBundle object associated with this
BundleReference.public List<URL> findEntries(String path, String filePattern, int options)
BundleClassLoaderBundleWiring.findEntries(String, String, int) method.findEntries in interface BundleClassLoaderpath - The path name in which to look.filePattern - The file name pattern for selecting resource names in
the specified path.options - The options for listing resource names.BundleWiring#findEntries(String, String, int)}public Collection<String> listResources(String path, String filePattern, int options)
BundleClassLoaderBundleWiring.listResources(String, String, int) method.
This method should simply return the result of calling
ClassLoaderDelegate.listResources(String, String, int)listResources in interface BundleClassLoaderpath - The path name in which to look.filePattern - The file name pattern for selecting resource names in
the specified path.options - The options for listing resource names.BundleWiring#listResources(String, String, int)},
ClassLoaderDelegate#listResources(String, String, int)}public Collection<String> listLocalResources(String path, String filePattern, int options)
BundleClassLoaderlistLocalResources in interface BundleClassLoaderpath - The path name in which to look.filePattern - The file name pattern for selecting resource names in
the specified path.options - The options for listing resource names.ClassLoaderDelegate#listResources(String, String, int)}Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.