Interface SupportingResource

All Superinterfaces:
org.osgi.resource.Resource

public interface SupportingResource extends org.osgi.resource.Resource
The SupportingResource interface represents a resource that requires other resources that are needed to resolve the primary resource. It was introduced to support Multi Release Jars (MRJ). These jars contain content that varies depending on the JVM release it is deployed. This could be modeled with a supporting resource. The primary resource required a special capability. For each range of VMs as used in the MRJ, a supporting resource is created that provides the special capability and requires the proper VM range.

However, this could be useful in other cases so the current specification is independent of this use case.

This interface extends Resource, this is the primary.

  • Method Summary

    Modifier and Type
    Method
    Description
    default List<org.osgi.resource.Resource>
    all()
    Gets all of the supporting resources for this resource, including the primary.
    If this resource is part of the support group of a resource, it will return the primary resource, otherwise empty
    default int
    The primary resource will be 0, the supporting resources will be indexed from 1..n
    List<org.osgi.resource.Resource>
    Gets the supporting resources for this resource, not including itself.
    default boolean
    Checks whether this resource has an identity.

    Methods inherited from interface org.osgi.resource.Resource

    equals, getCapabilities, getRequirements, hashCode
  • Method Details

    • all

      default List<org.osgi.resource.Resource> all()
      Gets all of the supporting resources for this resource, including the primary.
      Returns:
      A list of all of the supporting resources for this resource.
    • getSupportingResources

      List<org.osgi.resource.Resource> getSupportingResources()
      Gets the supporting resources for this resource, not including itself.
      Returns:
      A list of the supporting resources for this resource.
    • hasIdentity

      default boolean hasIdentity()
      Checks whether this resource has an identity. This is determined by whether it has any capabilities in the IdentityNamespace.
      Returns:
      true if this resource has an identity, false otherwise.
    • getParent

      If this resource is part of the support group of a resource, it will return the primary resource, otherwise empty
    • getSupportingIndex

      default int getSupportingIndex()
      The primary resource will be 0, the supporting resources will be indexed from 1..n
      Returns:
      the supporting index