org.apache.felix.framework.resolver
Interface Wire
public interface Wire
|
Method Summary |
Capability |
getCapability()
Returns the associated capability from the exporting module that
satisfies the requirement of the importing module. |
java.lang.Class |
getClass(java.lang.String name)
Requests a class from the exporting module. |
Module |
getExporter()
Returns the exporting module. |
Module |
getImporter()
Returns the importing module. |
Requirement |
getRequirement()
Returns the associated requirement from the importing module that
resulted in the creation of this wire. |
java.net.URL |
getResource(java.lang.String name)
Requests a resource from the exporting module. |
java.util.Enumeration |
getResources(java.lang.String name)
Requests resources from the exporting module. |
boolean |
hasPackage(java.lang.String pkgName)
Returns whether or not the wire has a given package name. |
getImporter
Module getImporter()
- Returns the importing module.
- Returns:
- The importing module.
getRequirement
Requirement getRequirement()
- Returns the associated requirement from the importing module that
resulted in the creation of this wire.
- Returns:
getExporter
Module getExporter()
- Returns the exporting module.
- Returns:
- The exporting module.
getCapability
Capability getCapability()
- Returns the associated capability from the exporting module that
satisfies the requirement of the importing module.
- Returns:
hasPackage
boolean hasPackage(java.lang.String pkgName)
- Returns whether or not the wire has a given package name. For some
wires, such as ones for Require-Bundle, there may be many packages.
This method is necessary since the set of packages attained by wires
restrict which packages can be dynamically imported (i.e., you cannot
dynamically import a package that is already attainable from an
existing wire).
- Returns:
- true if the package name is attainable from this wire,
false otherwise.
getClass
java.lang.Class getClass(java.lang.String name)
throws java.lang.ClassNotFoundException
- Requests a class from the exporting module. If the class is found, then
it is returned. If the class is not found, then this method may or may
not throw an exception depending on the wire type (e.g., for an
imported package or a required bundle). Throwing an exception indicates
that the search should be aborted, while returning a null
indicates that the search should continue.
- Returns:
- The class if found or null if not found and the search
should continue.
- Throws:
java.lang.ClassNotFoundException - If the class was not found and
the search should be aborted.
getResource
java.net.URL getResource(java.lang.String name)
throws ResourceNotFoundException
- Requests a resource from the exporting module. If the resource is found,
then an URL is returned. If the resource is not found, then this method may
or may not throw an exception depending on the wire type (e.g., for an
imported package or a required bundle). Throwing an exception indicates
that the search should be aborted, while returning a null
indicates that the search should continue.
- Returns:
- An URL to the resource if found or null if not found
and the search should continue.
- Throws:
ResourceNotFoundException - If the resource was not found and
the search should be aborted.
getResources
java.util.Enumeration getResources(java.lang.String name)
throws ResourceNotFoundException
- Requests resources from the exporting module. If the resources are found,
then an enumeration of URLs is returned. If the resources are not found,
then this method may or may not throw an exception depending on the wire
type (e.g., for an imported package or a required bundle). Throwing an
exception indicates that the search should be aborted, while returning a
null indicates that the search should continue.
- Returns:
- An enumeration of URLs for the resource if found or null
if not found and the search should continue.
- Throws:
ResourceNotFoundException - If the resource was not found and
the search should be aborted.
Copyright © 2007-2012 FuseSource, Corp.. All Rights Reserved.