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
public class BundleRevisionImpl extends java.lang.Object implements BundleRevision, Resource
-
-
Field Summary
Fields Modifier and Type Field Description static intEAGER_ACTIVATIONstatic intLAZY_ACTIVATIONprivate java.util.List<java.lang.String>m_activationExcludesprivate java.util.List<java.lang.String>m_activationIncludesprivate Bundlem_bundleprivate Contentm_contentprivate java.util.List<Content>m_contentPathprivate intm_declaredActivationPolicyprivate java.util.List<BundleCapability>m_declaredCapsprivate java.util.List<NativeLibrary>m_declaredNativeLibsprivate java.util.List<BundleRequirement>m_declaredReqsprivate java.util.Mapm_headerMapprivate java.lang.Stringm_idprivate booleanm_isExtensionprivate booleanm_isFragmentprivate java.lang.Stringm_manifestVersionprivate java.security.ProtectionDomainm_protectionDomainprivate static SecureActionm_secureActionprivate java.lang.Stringm_symbolicNameprivate Versionm_versionprivate BundleWiringImplm_wiring-
Fields inherited from interface org.osgi.framework.wiring.BundleRevision
BUNDLE_NAMESPACE, HOST_NAMESPACE, PACKAGE_NAMESPACE, TYPE_FRAGMENT
-
-
Constructor Summary
Constructors Constructor Description BundleRevisionImpl(Bundle bundle, java.lang.String id)This constructor is used by the extension manager, since it needs a constructor that does not throw an exception.BundleRevisionImpl(Bundle bundle, java.lang.String id, java.util.Map headerMap, Content content)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static java.util.List<Capability>asCapabilityList(java.util.List reqs)(package private) static java.util.List<Requirement>asRequirementList(java.util.List reqs)private java.util.ListcalculateContentPath(BundleRevision revision, Content content, java.util.List<Content> contentList, boolean searchFragments)(package private) voidclose()private java.net.URLcreateURL(int port, java.lang.String path)BundlegetBundle()Returns theBundleobject associated with thisBundleReference.java.util.List<Capability>getCapabilities(java.lang.String namespace)Returns the capabilities declared by this resource.ContentgetContent()(package private) java.util.List<Content>getContentPath()(package private) intgetDeclaredActivationPolicy()java.util.List<BundleCapability>getDeclaredCapabilities(java.lang.String namespace)Returns the capabilities declared by this bundle revision.java.util.List<NativeLibrary>getDeclaredNativeLibraries()java.util.List<BundleRequirement>getDeclaredRequirements(java.lang.String namespace)Returns the requirements declared by this bundle revision.java.net.URLgetEntry(java.lang.String name)java.util.MapgetHeaders()java.lang.StringgetId()java.io.InputStreamgetInputStream(int index, java.lang.String urlPath)java.net.URLgetLocalURL(int index, java.lang.String urlPath)java.lang.StringgetManifestVersion()java.security.ProtectionDomaingetProtectionDomain()java.util.List<Requirement>getRequirements(java.lang.String namespace)Returns the requirements declared by this bundle resource.(package private) java.net.URLgetResourceLocal(java.lang.String name)(package private) java.util.EnumerationgetResourcesLocal(java.lang.String name)(package private) static SecureActiongetSecureAction()java.lang.StringgetSymbolicName()Returns the symbolic name for this bundle revision.intgetTypes()Returns the special types of this bundle revision.VersiongetVersion()Returns the version for this bundle revision.BundleWiringgetWiring()Returns the bundle wiring which is using this bundle revision.booleanhasInputStream(int index, java.lang.String urlPath)private java.util.List<Content>initializeContentPath()(package private) booleanisActivationTrigger(java.lang.String pkgName)booleanisExtension()(package private) voidresetContent(Content content)voidresolve(BundleWiringImpl wiring)voidsetProtectionDomain(java.security.ProtectionDomain pd)java.lang.StringtoString()
-
-
-
Field Detail
-
EAGER_ACTIVATION
public static final int EAGER_ACTIVATION
- See Also:
- Constant Field Values
-
LAZY_ACTIVATION
public static final int LAZY_ACTIVATION
- See Also:
- Constant Field Values
-
m_id
private final java.lang.String m_id
-
m_headerMap
private final java.util.Map m_headerMap
-
m_manifestVersion
private final java.lang.String m_manifestVersion
-
m_isExtension
private final boolean m_isExtension
-
m_isFragment
private final boolean m_isFragment
-
m_symbolicName
private final java.lang.String m_symbolicName
-
m_version
private final Version m_version
-
m_declaredCaps
private final java.util.List<BundleCapability> m_declaredCaps
-
m_declaredReqs
private final java.util.List<BundleRequirement> m_declaredReqs
-
m_declaredNativeLibs
private final java.util.List<NativeLibrary> m_declaredNativeLibs
-
m_declaredActivationPolicy
private final int m_declaredActivationPolicy
-
m_activationIncludes
private final java.util.List<java.lang.String> m_activationIncludes
-
m_activationExcludes
private final java.util.List<java.lang.String> m_activationExcludes
-
m_bundle
private final Bundle m_bundle
-
m_content
private Content m_content
-
m_contentPath
private java.util.List<Content> m_contentPath
-
m_protectionDomain
private java.security.ProtectionDomain m_protectionDomain
-
m_secureAction
private static final SecureAction m_secureAction
-
m_wiring
private volatile BundleWiringImpl m_wiring
-
-
Constructor Detail
-
BundleRevisionImpl
public BundleRevisionImpl(Bundle bundle, java.lang.String id)
This constructor is used by the extension manager, since it needs a constructor that does not throw an exception.- Parameters:
logger-bundle-id-bootPkgs-bootPkgWildcards-- Throws:
BundleException
-
BundleRevisionImpl
BundleRevisionImpl(Bundle bundle, java.lang.String id, java.util.Map headerMap, Content content) throws BundleException
- Throws:
BundleException
-
-
Method Detail
-
getSecureAction
static SecureAction getSecureAction()
-
getDeclaredActivationPolicy
int getDeclaredActivationPolicy()
-
isActivationTrigger
boolean isActivationTrigger(java.lang.String pkgName)
-
getSymbolicName
public java.lang.String getSymbolicName()
Description copied from interface:BundleRevisionReturns the symbolic name for this bundle revision.- Specified by:
getSymbolicNamein interfaceBundleRevision- Returns:
- The symbolic name for this bundle revision.
- See Also:
Bundle.getSymbolicName()
-
getVersion
public Version getVersion()
Description copied from interface:BundleRevisionReturns the version for this bundle revision.- Specified by:
getVersionin interfaceBundleRevision- Returns:
- The version for this bundle revision, or
Version.emptyVersionif this bundle revision has no version information. - See Also:
Bundle.getVersion()
-
getCapabilities
public java.util.List<Capability> getCapabilities(java.lang.String namespace)
Description copied from interface:BundleRevisionReturns the capabilities declared by this resource.This method returns the same value as
BundleRevision.getDeclaredCapabilities(String).- Specified by:
getCapabilitiesin interfaceBundleRevision- Specified by:
getCapabilitiesin interfaceResource- Parameters:
namespace- The namespace of the declared capabilities to return ornullto return the declared capabilities from all namespaces.- Returns:
- An unmodifiable list containing the declared
Capabilitys from the specified namespace. The returned list will be empty if this resource declares no capabilities in the specified namespace.
-
asCapabilityList
static java.util.List<Capability> asCapabilityList(java.util.List reqs)
-
getDeclaredCapabilities
public java.util.List<BundleCapability> getDeclaredCapabilities(java.lang.String namespace)
Description copied from interface:BundleRevisionReturns the capabilities declared by this bundle revision.- Specified by:
getDeclaredCapabilitiesin interfaceBundleRevision- Parameters:
namespace- The namespace of the declared capabilities to return ornullto return the declared capabilities from all namespaces.- Returns:
- An unmodifiable list containing the declared
BundleCapabilitys 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
public java.util.List<Requirement> getRequirements(java.lang.String namespace)
Description copied from interface:BundleRevisionReturns the requirements declared by this bundle resource.This method returns the same value as
BundleRevision.getDeclaredRequirements(String).- Specified by:
getRequirementsin interfaceBundleRevision- Specified by:
getRequirementsin interfaceResource- Parameters:
namespace- The namespace of the declared requirements to return ornullto return the declared requirements from all namespaces.- Returns:
- An unmodifiable list containing the declared
Requirements from the specified namespace. The returned list will be empty if this resource declares no requirements in the specified namespace.
-
asRequirementList
static java.util.List<Requirement> asRequirementList(java.util.List reqs)
-
getDeclaredRequirements
public java.util.List<BundleRequirement> getDeclaredRequirements(java.lang.String namespace)
Description copied from interface:BundleRevisionReturns the requirements declared by this bundle revision.- Specified by:
getDeclaredRequirementsin interfaceBundleRevision- Parameters:
namespace- The namespace of the declared requirements to return ornullto return the declared requirements from all namespaces.- Returns:
- An unmodifiable list containing the declared
BundleRequirements 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:BundleRevisionReturns 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:
getTypesin interfaceBundleRevision- Returns:
- The special types of this bundle revision. The type values are ORed together.
-
getWiring
public BundleWiring getWiring()
Description copied from interface:BundleRevisionReturns the bundle wiring which is using this bundle revision.- Specified by:
getWiringin interfaceBundleRevision- Returns:
- The bundle wiring which is using this bundle revision or
nullif no bundle wiring is using this bundle revision. - See Also:
BundleWiring.getRevision()
-
getBundle
public Bundle getBundle()
Description copied from interface:BundleReferenceReturns theBundleobject associated with thisBundleReference.- Specified by:
getBundlein interfaceBundleReference- Returns:
- The
Bundleobject associated with thisBundleReference.
-
getHeaders
public java.util.Map getHeaders()
-
isExtension
public boolean isExtension()
-
getManifestVersion
public java.lang.String getManifestVersion()
-
getDeclaredNativeLibraries
public java.util.List<NativeLibrary> getDeclaredNativeLibraries()
-
getId
public java.lang.String getId()
-
resolve
public void resolve(BundleWiringImpl wiring)
-
setProtectionDomain
public void setProtectionDomain(java.security.ProtectionDomain pd)
-
getProtectionDomain
public java.security.ProtectionDomain getProtectionDomain()
-
getContent
public Content getContent()
-
resetContent
void resetContent(Content content)
-
getContentPath
java.util.List<Content> getContentPath()
-
initializeContentPath
private java.util.List<Content> initializeContentPath() throws java.lang.Exception
- Throws:
java.lang.Exception
-
calculateContentPath
private java.util.List calculateContentPath(BundleRevision revision, Content content, java.util.List<Content> contentList, boolean searchFragments) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getResourceLocal
java.net.URL getResourceLocal(java.lang.String name)
-
getResourcesLocal
java.util.Enumeration getResourcesLocal(java.lang.String name)
-
getEntry
public java.net.URL getEntry(java.lang.String name)
-
hasInputStream
public boolean hasInputStream(int index, java.lang.String urlPath)
-
getInputStream
public java.io.InputStream getInputStream(int index, java.lang.String urlPath) throws java.io.IOException- Throws:
java.io.IOException
-
getLocalURL
public java.net.URL getLocalURL(int index, java.lang.String urlPath)
-
createURL
private java.net.URL createURL(int port, java.lang.String path)
-
close
void close()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-