OSGi™ Core
Release 6

org.osgi.framework.wiring
Interface BundleRequirement

All Superinterfaces:
Requirement

@ProviderType
public interface BundleRequirement
extends Requirement

A requirement that has been declared from a bundle revision.

"ThreadSafe"

Method Summary
 Map<String,Object> getAttributes()
          Returns the attributes of this requirement.
 Map<String,String> getDirectives()
          Returns the directives of this requirement.
 String getNamespace()
          Returns the namespace of this requirement.
 BundleRevision getResource()
          Returns the resource declaring this requirement.
 BundleRevision getRevision()
          Returns the bundle revision declaring this requirement.
 boolean matches(BundleCapability capability)
          Returns whether the specified capability matches this requirement.
 
Methods inherited from interface org.osgi.resource.Requirement
equals, hashCode
 

Method Detail

getRevision

BundleRevision getRevision()
Returns the bundle revision declaring this requirement.

Returns:
The bundle revision declaring this requirement.

matches

boolean matches(BundleCapability capability)
Returns whether the specified capability matches this requirement.

Parameters:
capability - The capability to match to this requirement.
Returns:
true if the specified capability has the same namespace as this requirement and the filter for this requirement matches the attributes of the specified capability; false otherwise.

getNamespace

String getNamespace()
Returns the namespace of this requirement.

Specified by:
getNamespace in interface Requirement
Returns:
The namespace of this requirement.

getDirectives

Map<String,String> getDirectives()
Returns the directives of this requirement.

All requirement directives not specified by the wiring namespaces have no specified semantics and are considered extra user defined information.

Specified by:
getDirectives in interface Requirement
Returns:
An unmodifiable map of directive names to directive values for this requirement, or an empty map if this requirement has no directives.

getAttributes

Map<String,Object> getAttributes()
Returns the attributes of this requirement.

Requirement attributes have no specified semantics and are considered extra user defined information.

Specified by:
getAttributes in interface Requirement
Returns:
An unmodifiable map of attribute names to attribute values for this requirement, or an empty map if this requirement has no attributes.

getResource

BundleRevision getResource()
Returns the resource declaring this requirement.

This method returns the same value as getRevision().

Specified by:
getResource in interface Requirement
Returns:
The resource declaring this requirement. This can be null if this requirement is synthesized.
Since:
1.1

OSGi™ Core
Release 6

Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0