|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ClassLoader
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader
public class DefaultClassLoader
The default implementation of BaseClassLoader. This implementation extends
ClassLoader.
BaseClassLoader,
ClasspathManager| Field Summary | |
|---|---|
protected static java.security.PermissionCollection |
ALLPERMISSIONS
A PermissionCollection for AllPermissions; shared across all ProtectionDomains when security is disabled |
protected ClassLoaderDelegate |
delegate
|
protected java.security.ProtectionDomain |
domain
|
protected ClasspathManager |
manager
|
| Constructor Summary | |
|---|---|
DefaultClassLoader(java.lang.ClassLoader parent,
ClassLoaderDelegate delegate,
java.security.ProtectionDomain domain,
BaseData bundledata,
java.lang.String[] classpath)
Constructs a new DefaultClassLoader. |
|
| Method Summary | |
|---|---|
void |
attachFragment(BundleData sourcedata,
java.security.ProtectionDomain sourcedomain,
java.lang.String[] sourceclasspath)
Attaches the BundleData for a fragment to this BundleClassLoader. |
void |
close()
Closes this class loader. |
ClasspathEntry |
createClassPathEntry(BundleFile bundlefile,
java.security.ProtectionDomain cpDomain)
Creates a classpath entry with the given bundle file and domain |
static java.security.ProtectionDomain |
createProtectionDomain(BundleFile bundlefile,
java.security.ProtectionDomain baseDomain)
Creates a ProtectionDomain which uses specified BundleFile and the permissions of the baseDomain |
java.lang.Class |
defineClass(java.lang.String name,
byte[] classbytes,
ClasspathEntry classpathEntry,
BundleEntry entry)
Defines a Class. |
protected java.lang.String |
findLibrary(java.lang.String libname)
Finds a library for this bundle. |
java.lang.Class |
findLocalClass(java.lang.String classname)
Finds a local class in the BundleClassLoader without consulting the delegate. |
java.net.URL |
findLocalResource(java.lang.String resource)
Finds a local resource in the BundleClassLoader without consulting the delegate. |
java.util.Enumeration |
findLocalResources(java.lang.String resource)
Finds all local resources in the BundleClassLoader with the specified path without consulting the delegate. |
protected java.util.Enumeration |
findResources(java.lang.String name)
Finds all resources with the specified name. |
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 |
java.security.ProtectionDomain |
getDomain()
Returns the domain for the host bundle of this class loader |
java.net.URL |
getResource(java.lang.String name)
Gets a resource for the bundle. |
void |
initialize()
Initializes the ClassLoader. |
boolean |
isParallelCapable()
Indicates if this class loader is parallel capable. |
protected java.lang.Class |
loadClass(java.lang.String name,
boolean resolve)
Loads a class for the bundle. |
java.lang.Object |
publicDefinePackage(java.lang.String name,
java.lang.String specTitle,
java.lang.String specVersion,
java.lang.String specVendor,
java.lang.String implTitle,
java.lang.String implVersion,
java.lang.String implVendor,
java.net.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. |
java.lang.Class |
publicFindLoaded(java.lang.String classname)
A public version of the ClassLoader.findLoadedClass(java.lang.String) method. |
java.lang.Object |
publicGetPackage(java.lang.String pkgname)
A public version of the ClassLoader#getPackage(java.lang.String) method. |
| Methods inherited from class java.lang.ClassLoader |
|---|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLoadedClass, findResource, findSystemClass, getPackage, getPackages, getParent, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.osgi.framework.adaptor.BundleClassLoader |
|---|
getParent, getResources, loadClass |
| Field Detail |
|---|
protected static final java.security.PermissionCollection ALLPERMISSIONS
protected ClassLoaderDelegate delegate
protected java.security.ProtectionDomain domain
protected ClasspathManager manager
| Constructor Detail |
|---|
public DefaultClassLoader(java.lang.ClassLoader parent,
ClassLoaderDelegate delegate,
java.security.ProtectionDomain domain,
BaseData bundledata,
java.lang.String[] classpath)
parent - the parent classloaderdelegate - the delegate for this classloaderdomain - the domain for this classloaderbundledata - the bundledata for this classloaderclasspath - the classpath for this classloader| Method Detail |
|---|
protected java.lang.Class loadClass(java.lang.String name,
boolean resolve)
throws java.lang.ClassNotFoundException
loadClass in class java.lang.ClassLoadername - the name of the class to load.resolve - indicates whether to resolve the loaded class or not.
java.lang.ClassNotFoundException - if the class is not found.public java.net.URL getResource(java.lang.String name)
getResource in interface BundleClassLoadergetResource in class java.lang.ClassLoadername - The resource path to get.
protected java.util.Enumeration findResources(java.lang.String name)
throws java.io.IOException
findResources in class java.lang.ClassLoadername - The resource path to find.
java.io.IOExceptionprotected java.lang.String findLibrary(java.lang.String libname)
findLibrary in class java.lang.ClassLoaderlibname - The library to find.
public java.security.ProtectionDomain getDomain()
BaseClassLoader
getDomain in interface BaseClassLoader
public ClasspathEntry createClassPathEntry(BundleFile bundlefile,
java.security.ProtectionDomain cpDomain)
BaseClassLoader
createClassPathEntry in interface BaseClassLoaderbundlefile - the source bundle file for a classpath entrycpDomain - the source domain for a classpath entry
public java.lang.Class defineClass(java.lang.String name,
byte[] classbytes,
ClasspathEntry classpathEntry,
BundleEntry entry)
BaseClassLoader
defineClass 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 bytes
public java.lang.Class publicFindLoaded(java.lang.String classname)
BaseClassLoader
publicFindLoaded in interface BaseClassLoaderclassname - the class name to find.
public java.lang.Object publicGetPackage(java.lang.String pkgname)
BaseClassLoader
publicGetPackage in interface BaseClassLoaderpkgname - the package name to get.
public java.lang.Object publicDefinePackage(java.lang.String name,
java.lang.String specTitle,
java.lang.String specVersion,
java.lang.String specVendor,
java.lang.String implTitle,
java.lang.String implVersion,
java.lang.String implVendor,
java.net.URL sealBase)
BaseClassLoader
publicDefinePackage in interface BaseClassLoaderpublic void initialize()
BundleClassLoader
initialize in interface BundleClassLoaderpublic java.net.URL findLocalResource(java.lang.String resource)
BundleClassLoader
findLocalResource in interface BundleClassLoaderresource - the resource path to find.
public java.util.Enumeration findLocalResources(java.lang.String resource)
BundleClassLoader
findLocalResources in interface BundleClassLoaderresource - the resource path to find.
public java.lang.Class findLocalClass(java.lang.String classname)
throws java.lang.ClassNotFoundException
BundleClassLoader
findLocalClass in interface BundleClassLoaderclassname - the classname to find.
java.lang.ClassNotFoundException - if the classname does not exist locally.public void close()
BundleClassLoader
close in interface BundleClassLoader
public void attachFragment(BundleData sourcedata,
java.security.ProtectionDomain sourcedomain,
java.lang.String[] sourceclasspath)
BundleClassLoader
attachFragment in interface BundleClassLoadersourcedata - The BundleData of the fragment.sourcedomain - The ProtectionDomain of the resources of the fragment.
Any classes loaded from the fragment's BundleData must belong to this
ProtectionDomain.sourceclasspath - 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 ClassLoaderDelegate getDelegate()
BundleClassLoader
getDelegate in interface BundleClassLoader
public static java.security.ProtectionDomain createProtectionDomain(BundleFile bundlefile,
java.security.ProtectionDomain baseDomain)
bundlefile - The source bundlefile the domain is for.baseDomain - The source domain.
public ClasspathManager getClasspathManager()
BaseClassLoader
getClasspathManager in interface BaseClassLoaderpublic Bundle getBundle()
BundleReferenceBundle object associated with this
BundleReference.
getBundle in interface BundleReferenceBundle object associated with this
BundleReference.public boolean isParallelCapable()
ParallelClassLoader
isParallelCapable in interface ParallelClassLoader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||