Package org.apache.felix.framework
Class BundleRevisionImpl
java.lang.Object
org.apache.felix.framework.BundleRevisionImpl
- All Implemented Interfaces:
BundleReference
,BundleRevision
,Resource
- Direct Known Subclasses:
ExtensionManager.ExtensionManagerRevision
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
private final Bundle
private Content
private final int
private final List
<BundleCapability> private final List
<NativeLibrary> private final List
<BundleRequirement> private final Map
private final String
private final boolean
private final boolean
private final String
private ProtectionDomain
private static final SecureAction
private final String
private final Version
private BundleWiringImpl
Fields inherited from interface org.osgi.framework.wiring.BundleRevision
BUNDLE_NAMESPACE, HOST_NAMESPACE, PACKAGE_NAMESPACE, TYPE_FRAGMENT
-
Constructor Summary
ConstructorsConstructorDescriptionBundleRevisionImpl
(Bundle bundle, String id) This constructor is used by the extension manager, since it needs a constructor that does not throw an exception.BundleRevisionImpl
(Bundle bundle, String id, Map headerMap, Content content) -
Method Summary
Modifier and TypeMethodDescription(package private) static List
<Capability> asCapabilityList
(List reqs) (package private) static List
<Requirement> asRequirementList
(List reqs) private List
calculateContentPath
(BundleRevision revision, Content content, List<Content> contentList, boolean searchFragments) (package private) void
close()
private URL
Returns theBundle
object associated with thisBundleReference
.getCapabilities
(String namespace) Returns the capabilities declared by this resource.(package private) int
getDeclaredCapabilities
(String namespace) Returns the capabilities declared by this bundle revision.getDeclaredRequirements
(String namespace) Returns the requirements declared by this bundle revision.getId()
getInputStream
(int index, String urlPath) getLocalURL
(int index, String urlPath) getRequirements
(String namespace) Returns the requirements declared by this bundle resource.(package private) URL
getResourceLocal
(String name) (package private) Enumeration
getResourcesLocal
(String name) (package private) static SecureAction
Returns the symbolic name for this bundle revision.int
getTypes()
Returns the special types of this bundle revision.Returns the version for this bundle revision.Returns the bundle wiring which is using this bundle revision.boolean
hasInputStream
(int index, String urlPath) (package private) boolean
isActivationTrigger
(String pkgName) boolean
(package private) void
resetContent
(Content content) void
resolve
(BundleWiringImpl wiring) void
toString()
-
Field Details
-
EAGER_ACTIVATION
public static final int EAGER_ACTIVATION- See Also:
-
LAZY_ACTIVATION
public static final int LAZY_ACTIVATION- See Also:
-
m_id
-
m_headerMap
-
m_manifestVersion
-
m_isExtension
private final boolean m_isExtension -
m_isFragment
private final boolean m_isFragment -
m_symbolicName
-
m_version
-
m_declaredCaps
-
m_declaredReqs
-
m_declaredNativeLibs
-
m_declaredActivationPolicy
private final int m_declaredActivationPolicy -
m_activationIncludes
-
m_activationExcludes
-
m_bundle
-
m_content
-
m_contentPath
-
m_protectionDomain
-
m_secureAction
-
m_wiring
-
-
Constructor Details
-
BundleRevisionImpl
This constructor is used by the extension manager, since it needs a constructor that does not throw an exception.- Parameters:
bundle
-id
-logger
-bootPkgs
-bootPkgWildcards
-- Throws:
BundleException
-
BundleRevisionImpl
BundleRevisionImpl(Bundle bundle, String id, Map headerMap, Content content) throws BundleException - Throws:
BundleException
-
-
Method Details
-
getSecureAction
-
getDeclaredActivationPolicy
int getDeclaredActivationPolicy() -
isActivationTrigger
-
getSymbolicName
Description copied from interface:BundleRevision
Returns the symbolic name for this bundle revision.- Specified by:
getSymbolicName
in interfaceBundleRevision
- Returns:
- The symbolic name for this bundle revision.
- See Also:
-
getVersion
Description copied from interface:BundleRevision
Returns the version for this bundle revision.- Specified by:
getVersion
in interfaceBundleRevision
- Returns:
- The version for this bundle revision, or
Version.emptyVersion
if this bundle revision has no version information. - See Also:
-
getCapabilities
Description copied from interface:BundleRevision
Returns the capabilities declared by this resource.This method returns the same value as
BundleRevision.getDeclaredCapabilities(String)
.- Specified by:
getCapabilities
in interfaceBundleRevision
- Specified by:
getCapabilities
in interfaceResource
- Parameters:
namespace
- The namespace of the declared capabilities to return ornull
to return the declared capabilities from all namespaces.- Returns:
- An unmodifiable list containing the declared
Capability
s from the specified namespace. The returned list will be empty if this resource declares no capabilities in the specified namespace.
-
asCapabilityList
-
getDeclaredCapabilities
Description copied from interface:BundleRevision
Returns the capabilities declared by this bundle revision.- Specified by:
getDeclaredCapabilities
in interfaceBundleRevision
- Parameters:
namespace
- The namespace of the declared capabilities to return ornull
to return the declared capabilities from all namespaces.- Returns:
- An unmodifiable list containing the declared
BundleCapability
s from the specified namespace. The returned list will be empty if this bundle revision declares no capabilities in the specified namespace. The list contains the declared capabilities in the order they are specified in the manifest.
-
getRequirements
Description copied from interface:BundleRevision
Returns the requirements declared by this bundle resource.This method returns the same value as
BundleRevision.getDeclaredRequirements(String)
.- Specified by:
getRequirements
in interfaceBundleRevision
- Specified by:
getRequirements
in interfaceResource
- Parameters:
namespace
- The namespace of the declared requirements to return ornull
to return the declared requirements from all namespaces.- Returns:
- An unmodifiable list containing the declared
Requirement
s from the specified namespace. The returned list will be empty if this resource declares no requirements in the specified namespace.
-
asRequirementList
-
getDeclaredRequirements
Description copied from interface:BundleRevision
Returns the requirements declared by this bundle revision.- Specified by:
getDeclaredRequirements
in interfaceBundleRevision
- Parameters:
namespace
- The namespace of the declared requirements to return ornull
to return the declared requirements from all namespaces.- Returns:
- An unmodifiable list containing the declared
BundleRequirement
s from the specified namespace. The returned list will be empty if this bundle revision declares no requirements in the specified namespace. The list contains the declared requirements in the order they are specified in the manifest.
-
getTypes
public int getTypes()Description copied from interface:BundleRevision
Returns the special types of this bundle revision. The bundle revision type values are: A bundle revision may be more than one type at a time. A type code is used to identify the bundle revision type for future extendability.If this bundle revision is not one or more of the defined types then 0 is returned.
- Specified by:
getTypes
in interfaceBundleRevision
- Returns:
- The special types of this bundle revision. The type values are ORed together.
-
getWiring
Description copied from interface:BundleRevision
Returns the bundle wiring which is using this bundle revision.- Specified by:
getWiring
in interfaceBundleRevision
- Returns:
- The bundle wiring which is using this bundle revision or
null
if no bundle wiring is using this bundle revision. - See Also:
-
getBundle
Description copied from interface:BundleReference
Returns theBundle
object associated with thisBundleReference
.- Specified by:
getBundle
in interfaceBundleReference
- Returns:
- The
Bundle
object associated with thisBundleReference
.
-
getHeaders
-
isExtension
public boolean isExtension() -
getManifestVersion
-
getDeclaredNativeLibraries
-
getId
-
resolve
-
setProtectionDomain
-
getProtectionDomain
-
getContent
-
resetContent
-
getContentPath
-
initializeContentPath
- Throws:
Exception
-
calculateContentPath
private List calculateContentPath(BundleRevision revision, Content content, List<Content> contentList, boolean searchFragments) throws Exception - Throws:
Exception
-
getResourceLocal
-
getResourcesLocal
-
getEntry
-
hasInputStream
-
getInputStream
- Throws:
IOException
-
getLocalURL
-
createURL
-
close
void close() -
toString
-