Package org.eclipse.sisu.space
Class BundleClassSpace
java.lang.Object
org.eclipse.sisu.space.BundleClassSpace
- All Implemented Interfaces:
ClassSpace
ClassSpace
backed by a strongly-referenced Bundle
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeferLoadClass
(String name) Defers loading of the named class from the surrounding class space.boolean
findEntries
(String path, String glob, boolean recurse) Queries local class space content for entries matching the given pattern.org.osgi.framework.Bundle
getResource
(String name) Queries the surrounding class space for the resource with the given name.getResources
(String name) Queries the surrounding class space for all resources with the given name.int
hashCode()
Class
<?> Loads the named class from the surrounding class space.toString()
-
Constructor Details
-
BundleClassSpace
public BundleClassSpace(org.osgi.framework.Bundle bundle)
-
-
Method Details
-
loadClass
Description copied from interface:ClassSpace
Loads the named class from the surrounding class space.- Specified by:
loadClass
in interfaceClassSpace
- Parameters:
name
- The class name- Returns:
- Class instance
- See Also:
-
deferLoadClass
Description copied from interface:ClassSpace
Defers loading of the named class from the surrounding class space.- Specified by:
deferLoadClass
in interfaceClassSpace
- Parameters:
name
- The class name- Returns:
- Deferred class
- See Also:
-
getResource
Description copied from interface:ClassSpace
Queries the surrounding class space for the resource with the given name.- Specified by:
getResource
in interfaceClassSpace
- Parameters:
name
- The resource name- Returns:
- URL pointing to the resource;
null
if it wasn't found - See Also:
-
getResources
Description copied from interface:ClassSpace
Queries the surrounding class space for all resources with the given name.- Specified by:
getResources
in interfaceClassSpace
- Parameters:
name
- The resource name- Returns:
- Sequence of URLs, one for each matching resource
- See Also:
-
findEntries
Description copied from interface:ClassSpace
Queries local class space content for entries matching the given pattern.- Specified by:
findEntries
in interfaceClassSpace
- Parameters:
path
- The initial search directory; for example"META-INF"
glob
- The filename glob pattern; for example"*.xml"
recurse
- Iftrue
recurse into sub-directories; otherwise only search initial directory- Returns:
- Sequence of URLs, one for each matching entry
- See Also:
-
getBundle
public org.osgi.framework.Bundle getBundle() -
hashCode
public int hashCode() -
equals
-
toString
-