org.apache.felix.framework.searchpolicy
Class R4WireModule

java.lang.Object
  extended by org.apache.felix.framework.searchpolicy.R4WireModule
All Implemented Interfaces:
IWire

public class R4WireModule
extends java.lang.Object
implements IWire


Constructor Summary
R4WireModule(IModule importer, IRequirement requirement, IModule exporter, ICapability capability, java.util.Map pkgMap)
           
 
Method Summary
 ICapability 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.
 IModule getExporter()
          Returns the exporting module.
 IModule getImporter()
          Returns the importing module.
 IRequirement 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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

R4WireModule

public R4WireModule(IModule importer,
                    IRequirement requirement,
                    IModule exporter,
                    ICapability capability,
                    java.util.Map pkgMap)
Method Detail

getImporter

public IModule getImporter()
Description copied from interface: IWire
Returns the importing module.

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

getRequirement

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

Specified by:
getRequirement in interface IWire
Returns:

getExporter

public IModule getExporter()
Description copied from interface: IWire
Returns the exporting module.

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

getCapability

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

Specified by:
getCapability in interface IWire
Returns:

hasPackage

public boolean hasPackage(java.lang.String pkgName)
Description copied from interface: IWire
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 IWire
Returns:
true if the package name is attainable from this wire, false otherwise.

getClass

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

public java.net.URL getResource(java.lang.String name)
                         throws ResourceNotFoundException
Description copied from interface: IWire
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 IWire
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 java.util.Enumeration getResources(java.lang.String name)
                                   throws ResourceNotFoundException
Description copied from interface: IWire
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 IWire
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 java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010. All Rights Reserved.