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 Object implements BundleRevision, Resource
  • Field Details

    • EAGER_ACTIVATION

      public static final int EAGER_ACTIVATION
      See Also:
    • LAZY_ACTIVATION

      public static final int LAZY_ACTIVATION
      See Also:
    • m_id

      private final String m_id
    • m_headerMap

      private final Map m_headerMap
    • m_manifestVersion

      private final String m_manifestVersion
    • m_isExtension

      private final boolean m_isExtension
    • m_isFragment

      private final boolean m_isFragment
    • m_symbolicName

      private final String m_symbolicName
    • m_version

      private final Version m_version
    • m_declaredCaps

      private final List<BundleCapability> m_declaredCaps
    • m_declaredReqs

      private final List<BundleRequirement> m_declaredReqs
    • m_declaredNativeLibs

      private final List<NativeLibrary> m_declaredNativeLibs
    • m_declaredActivationPolicy

      private final int m_declaredActivationPolicy
    • m_activationIncludes

      private final List<String> m_activationIncludes
    • m_activationExcludes

      private final List<String> m_activationExcludes
    • m_bundle

      private final Bundle m_bundle
    • m_content

      private Content m_content
    • m_contentPath

      private List<Content> m_contentPath
    • m_protectionDomain

      private ProtectionDomain m_protectionDomain
    • m_secureAction

      private static final SecureAction m_secureAction
    • m_wiring

      private volatile BundleWiringImpl m_wiring
  • Constructor Details

    • BundleRevisionImpl

      public BundleRevisionImpl(Bundle bundle, String id)
      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

      static SecureAction getSecureAction()
    • getDeclaredActivationPolicy

      int getDeclaredActivationPolicy()
    • isActivationTrigger

      boolean isActivationTrigger(String pkgName)
    • getSymbolicName

      public String getSymbolicName()
      Description copied from interface: BundleRevision
      Returns the symbolic name for this bundle revision.
      Specified by:
      getSymbolicName in interface BundleRevision
      Returns:
      The symbolic name for this bundle revision.
      See Also:
    • getVersion

      public Version getVersion()
      Description copied from interface: BundleRevision
      Returns the version for this bundle revision.
      Specified by:
      getVersion in interface BundleRevision
      Returns:
      The version for this bundle revision, or Version.emptyVersion if this bundle revision has no version information.
      See Also:
    • getCapabilities

      public List<Capability> getCapabilities(String namespace)
      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 interface BundleRevision
      Specified by:
      getCapabilities in interface Resource
      Parameters:
      namespace - The namespace of the declared capabilities to return or null to 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 List<Capability> asCapabilityList(List reqs)
    • getDeclaredCapabilities

      public List<BundleCapability> getDeclaredCapabilities(String namespace)
      Description copied from interface: BundleRevision
      Returns the capabilities declared by this bundle revision.
      Specified by:
      getDeclaredCapabilities in interface BundleRevision
      Parameters:
      namespace - The namespace of the declared capabilities to return or null to 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 List<Requirement> getRequirements(String namespace)
      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 interface BundleRevision
      Specified by:
      getRequirements in interface Resource
      Parameters:
      namespace - The namespace of the declared requirements to return or null 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

      static List<Requirement> asRequirementList(List reqs)
    • getDeclaredRequirements

      public List<BundleRequirement> getDeclaredRequirements(String namespace)
      Description copied from interface: BundleRevision
      Returns the requirements declared by this bundle revision.
      Specified by:
      getDeclaredRequirements in interface BundleRevision
      Parameters:
      namespace - The namespace of the declared requirements to return or null to 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: 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 interface BundleRevision
      Returns:
      The special types of this bundle revision. The type values are ORed together.
    • getWiring

      public BundleWiring getWiring()
      Description copied from interface: BundleRevision
      Returns the bundle wiring which is using this bundle revision.
      Specified by:
      getWiring in interface BundleRevision
      Returns:
      The bundle wiring which is using this bundle revision or null if no bundle wiring is using this bundle revision.
      See Also:
    • getBundle

      public Bundle getBundle()
      Description copied from interface: BundleReference
      Returns the Bundle object associated with this BundleReference.
      Specified by:
      getBundle in interface BundleReference
      Returns:
      The Bundle object associated with this BundleReference.
    • getHeaders

      public Map getHeaders()
    • isExtension

      public boolean isExtension()
    • getManifestVersion

      public String getManifestVersion()
    • getDeclaredNativeLibraries

      public List<NativeLibrary> getDeclaredNativeLibraries()
    • getId

      public String getId()
    • resolve

      public void resolve(BundleWiringImpl wiring)
    • setProtectionDomain

      public void setProtectionDomain(ProtectionDomain pd)
    • getProtectionDomain

      public ProtectionDomain getProtectionDomain()
    • getContent

      public Content getContent()
    • resetContent

      void resetContent(Content content)
    • getContentPath

      List<Content> getContentPath()
    • initializeContentPath

      private List<Content> initializeContentPath() throws Exception
      Throws:
      Exception
    • calculateContentPath

      private List calculateContentPath(BundleRevision revision, Content content, List<Content> contentList, boolean searchFragments) throws Exception
      Throws:
      Exception
    • getResourceLocal

      URL getResourceLocal(String name)
    • getResourcesLocal

      Enumeration getResourcesLocal(String name)
    • getEntry

      public URL getEntry(String name)
    • hasInputStream

      public boolean hasInputStream(int index, String urlPath)
    • getInputStream

      public InputStream getInputStream(int index, String urlPath) throws IOException
      Throws:
      IOException
    • getLocalURL

      public URL getLocalURL(int index, String urlPath)
    • createURL

      private URL createURL(int port, String path)
    • close

      void close()
    • toString

      public String toString()
      Overrides:
      toString in class Object