org.apache.felix.framework.resolver
Interface Wire

All Known Implementing Classes:
WireImpl, WireModuleImpl

public interface Wire


Method Summary
 Capability getCapability()
          Returns the associated capability from the exporting module that satisfies the requirement of the importing module.
 Class getClass(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.
 URL getResource(String name)
          Requests a resource from the exporting module.
 Enumeration getResources(String name)
          Requests resources from the exporting module.
 boolean hasPackage(String pkgName)
          Returns whether or not the wire has a given package name.
 

Method Detail

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(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

Class getClass(String name)
               throws 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:
ClassNotFoundException - If the class was not found and the search should be aborted.

getResource

URL getResource(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

Enumeration getResources(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 © 2013 The Apache Software Foundation. All Rights Reserved.