Package org.eclipse.sisu.space
Class BundleClassSpace
- java.lang.Object
-
- org.eclipse.sisu.space.BundleClassSpace
-
- All Implemented Interfaces:
ClassSpace
public final class BundleClassSpace extends Object implements ClassSpace
ClassSpacebacked by a strongly-referencedBundle.
-
-
Constructor Summary
Constructors Constructor Description BundleClassSpace(org.osgi.framework.Bundle bundle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeferredClass<?>deferLoadClass(String name)Defers loading of the named class from the surrounding class space.booleanequals(Object rhs)Enumeration<URL>findEntries(String path, String glob, boolean recurse)Queries local class space content for entries matching the given pattern.org.osgi.framework.BundlegetBundle()URLgetResource(String name)Queries the surrounding class space for the resource with the given name.Enumeration<URL>getResources(String name)Queries the surrounding class space for all resources with the given name.inthashCode()Class<?>loadClass(String name)Loads the named class from the surrounding class space.StringtoString()
-
-
-
Method Detail
-
loadClass
public Class<?> loadClass(String name)
Description copied from interface:ClassSpaceLoads the named class from the surrounding class space.- Specified by:
loadClassin interfaceClassSpace- Parameters:
name- The class name- Returns:
- Class instance
- See Also:
ClassLoader.loadClass(String)
-
deferLoadClass
public DeferredClass<?> deferLoadClass(String name)
Description copied from interface:ClassSpaceDefers loading of the named class from the surrounding class space.- Specified by:
deferLoadClassin interfaceClassSpace- Parameters:
name- The class name- Returns:
- Deferred class
- See Also:
ClassLoader.loadClass(String)
-
getResource
public URL getResource(String name)
Description copied from interface:ClassSpaceQueries the surrounding class space for the resource with the given name.- Specified by:
getResourcein interfaceClassSpace- Parameters:
name- The resource name- Returns:
- URL pointing to the resource;
nullif it wasn't found - See Also:
ClassLoader.getResource(String)
-
getResources
public Enumeration<URL> getResources(String name)
Description copied from interface:ClassSpaceQueries the surrounding class space for all resources with the given name.- Specified by:
getResourcesin interfaceClassSpace- Parameters:
name- The resource name- Returns:
- Sequence of URLs, one for each matching resource
- See Also:
ClassLoader.getResources(String)
-
findEntries
public Enumeration<URL> findEntries(String path, String glob, boolean recurse)
Description copied from interface:ClassSpaceQueries local class space content for entries matching the given pattern.- Specified by:
findEntriesin interfaceClassSpace- Parameters:
path- The initial search directory; for example"META-INF"glob- The filename glob pattern; for example"*.xml"recurse- Iftruerecurse into sub-directories; otherwise only search initial directory- Returns:
- Sequence of URLs, one for each matching entry
- See Also:
Bundle.findEntries(String, String, boolean)
-
getBundle
public org.osgi.framework.Bundle getBundle()
-
-