org.apache.felix.framework.resolver
Class WireModuleImpl

java.lang.Object
  extended by org.apache.felix.framework.resolver.WireModuleImpl
All Implemented Interfaces:
Wire

public class WireModuleImpl
extends Object
implements Wire


Constructor Summary
WireModuleImpl(Module importer, Requirement requirement, Module exporter, Capability capability,  packages)
           
 
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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WireModuleImpl

public WireModuleImpl(Module importer,
                      Requirement requirement,
                      Module exporter,
                      Capability capability,
                       packages)
Method Detail

getImporter

public Module getImporter()
Description copied from interface: Wire
Returns the importing module.

Specified by:
getImporter in interface Wire
Returns:
The importing module.

getRequirement

public Requirement getRequirement()
Description copied from interface: Wire
Returns the associated requirement from the importing module that resulted in the creation of this wire.

Specified by:
getRequirement in interface Wire
Returns:

getExporter

public Module getExporter()
Description copied from interface: Wire
Returns the exporting module.

Specified by:
getExporter in interface Wire
Returns:
The exporting module.

getCapability

public Capability getCapability()
Description copied from interface: Wire
Returns the associated capability from the exporting module that satisfies the requirement of the importing module.

Specified by:
getCapability in interface Wire
Returns:

hasPackage

public boolean hasPackage(String pkgName)
Description copied from interface: Wire
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).

Specified by:
hasPackage in interface Wire
Returns:
true if the package name is attainable from this wire, false otherwise.

getClass

public Class getClass(String name)
               throws ClassNotFoundException
Description copied from interface: Wire
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.

Specified by:
getClass in interface Wire
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

public URL getResource(String name)
                throws ResourceNotFoundException
Description copied from interface: Wire
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.

Specified by:
getResource in interface Wire
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

public Enumeration getResources(String name)
                         throws ResourceNotFoundException
Description copied from interface: Wire
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.

Specified by:
getResources in interface Wire
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.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.