org.osgi.framework.resource
Interface Wiring

All Known Subinterfaces:
BundleWiring

public interface Wiring

A wiring for a resource. A wiring is associated with a resource and represents the dependencies with other wirings.

Version:
$Id: 1dcd04f839191a84860d83b62124d2c35c433f08 $

Method Summary
 java.util.List<Wire> getProvidedResourceWires(java.lang.String namespace)
          Returns the Wires to the provided capabilities of this wiring.
 java.util.List<Wire> getRequiredResourceWires(java.lang.String namespace)
          Returns the Wires to the requirements in use by this wiring.
 Resource getResource()
          Returns the resource associated with this wiring.
 java.util.List<Capability> getResourceCapabilities(java.lang.String namespace)
          Returns the capabilities provided by this wiring.
 java.util.List<Requirement> getResourceRequirements(java.lang.String namespace)
          Returns the requirements of this wiring.
 

Method Detail

getResourceCapabilities

java.util.List<Capability> getResourceCapabilities(java.lang.String namespace)
Returns the capabilities provided by this wiring.

Only capabilities considered by the resolver are returned. For example, capabilities with effective directive not equal to resolve are not returned.

A capability may not be required by any wiring and thus there may be no wires for the capability.

A wiring for a non-fragment resource provides a subset of the declared capabilities from the resource and all attached fragment resources. Not all declared capabilities may be provided since some may be discarded. For example, if a package is declared to be both exported and imported, only one is selected and the other is discarded.

A wiring for a fragment resource with a symbolic name must provide exactly one identity capability.

† The identity capability provided by attached fragment resource must not be included in the capabilities of the host wiring.

Parameters:
namespace - The name space of the capabilities to return or null to return the capabilities from all name spaces.
Returns:
A list containing a snapshot of the Capabilitys, or an empty list if this wiring provides no capabilities in the specified name space. For a given name space, the list contains the wires in the order the capabilities were specified in the manifests of the resource and the attached fragment resources of this wiring. There is no ordering defined between capabilities in different name spaces.

getResourceRequirements

java.util.List<Requirement> getResourceRequirements(java.lang.String namespace)
Returns the requirements of this wiring.

Only requirements considered by the resolver are returned. For example, requirements with effective directive not equal to resolve are not returned.

A wiring for a non-fragment resource has a subset of the declared requirements from the resource and all attached fragment resources. Not all declared requirements may be present since some may be discarded. For example, if a package is declared to be optionally imported and is not actually imported, the requirement must be discarded.

Parameters:
namespace - The name space of the requirements to return or null to return the requirements from all name spaces.
Returns:
A list containing a snapshot of the Requirements, or an empty list if this wiring uses no requirements in the specified name space. For a given name space, the list contains the wires in the order the requirements were specified in the manifests of the resource and the attached fragment resources of this wiring. There is no ordering defined between requirements in different name spaces.

getProvidedResourceWires

java.util.List<Wire> getProvidedResourceWires(java.lang.String namespace)
Returns the Wires to the provided capabilities of this wiring.

Parameters:
namespace - The name space of the capabilities for which to return wires or null to return the wires for the capabilities in all name spaces.
Returns:
A list containing a snapshot of the Wires for the capabilities of this wiring, or an empty list if this wiring has no capabilities in the specified name space. For a given name space, the list contains the wires in the order the capabilities were specified in the manifests of the resource and the attached fragment resources of this wiring. There is no ordering defined between capabilities in different name spaces.

getRequiredResourceWires

java.util.List<Wire> getRequiredResourceWires(java.lang.String namespace)
Returns the Wires to the requirements in use by this wiring.

Parameters:
namespace - The name space of the requirements for which to return wires or null to return the wires for the requirements in all name spaces.
Returns:
A list containing a snapshot of the Wires for the requirements of this wiring, or an empty list if this wiring has no requirements in the specified name space. For a given name space, the list contains the wires in the order the requirements were specified in the manifests of the resource and the attached fragment resources of this wiring. There is no ordering defined between requirements in different name spaces.

getResource

Resource getResource()
Returns the resource associated with this wiring.

Returns:
The resource associated with this wiring.


Copyright © 2006-2012 The Apache Software Foundation. All Rights Reserved.