public final class BundleClassSpace extends java.lang.Object implements ClassSpace
ClassSpace backed by a strongly-referenced Bundle.| Modifier and Type | Class and Description |
|---|---|
private static class |
BundleClassSpace.ChainedEnumeration<T>
Chains a series of
Enumerations together to look like a single Enumeration. |
| Modifier and Type | Field and Description |
|---|---|
private org.osgi.framework.Bundle |
bundle |
private java.net.URL[] |
bundleClassPath |
private static java.util.Enumeration<java.net.URL> |
NO_ENTRIES |
private static java.net.URL[] |
NO_URLS |
| Constructor and Description |
|---|
BundleClassSpace(org.osgi.framework.Bundle bundle) |
| Modifier and Type | Method and Description |
|---|---|
DeferredClass<?> |
deferLoadClass(java.lang.String name)
Defers loading of the named class from the surrounding class space.
|
boolean |
equals(java.lang.Object rhs) |
java.util.Enumeration<java.net.URL> |
findEntries(java.lang.String path,
java.lang.String glob,
boolean recurse)
Queries local class space content for entries matching the given pattern.
|
org.osgi.framework.Bundle |
getBundle() |
private java.net.URL[] |
getBundleClassPath()
Returns the expanded Bundle-ClassPath; we need this to iterate over embedded JARs.
|
java.net.URL |
getResource(java.lang.String name)
Queries the surrounding class space for the resource with the given name.
|
java.util.Enumeration<java.net.URL> |
getResources(java.lang.String name)
Queries the surrounding class space for all resources with the given name.
|
int |
hashCode() |
java.lang.Class<?> |
loadClass(java.lang.String name)
Loads the named class from the surrounding class space.
|
java.lang.String |
toString() |
private static final java.net.URL[] NO_URLS
private static final java.util.Enumeration<java.net.URL> NO_ENTRIES
private final org.osgi.framework.Bundle bundle
private java.net.URL[] bundleClassPath
public java.lang.Class<?> loadClass(java.lang.String name)
ClassSpaceloadClass in interface ClassSpacename - The class nameClassLoader.loadClass(String)public DeferredClass<?> deferLoadClass(java.lang.String name)
ClassSpacedeferLoadClass in interface ClassSpacename - The class nameClassLoader.loadClass(String)public java.net.URL getResource(java.lang.String name)
ClassSpacegetResource in interface ClassSpacename - The resource namenull if it wasn't foundClassLoader.getResource(String)public java.util.Enumeration<java.net.URL> getResources(java.lang.String name)
ClassSpacegetResources in interface ClassSpacename - The resource nameClassLoader.getResources(String)public java.util.Enumeration<java.net.URL> findEntries(java.lang.String path,
java.lang.String glob,
boolean recurse)
ClassSpacefindEntries in interface ClassSpacepath - The initial search directory; for example "META-INF"glob - The filename glob pattern; for example "*.xml"recurse - If true recurse into sub-directories; otherwise only search initial directoryBundle.findEntries(String, String, boolean)public org.osgi.framework.Bundle getBundle()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object rhs)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectprivate java.net.URL[] getBundleClassPath()