Interface BundleStateMBean


  • public interface BundleStateMBean
    This MBean represents the Bundle state of the framework. This MBean also emits events that clients can use to get notified of the changes in the bundle state of the framework.
    • Method Detail

      • getBundle

        javax.management.openmbean.CompositeData getBundle​(long id)
                                                    throws java.io.IOException
        New!!
        Parameters:
        id - The Bundle ID
        Returns:
        The Bundle Data
        Throws:
        java.io.IOException
      • getBundleIds

        long[] getBundleIds()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getRequiredBundles

        long[] getRequiredBundles​(long bundleIdentifier)
                           throws java.io.IOException
        Answer the list of identifiers of the bundles this bundle depends upon
        Parameters:
        bundleIdentifier - the bundle identifier
        Returns:
        the list of bundle identifiers
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • listBundles

        javax.management.openmbean.TabularData listBundles()
                                                    throws java.io.IOException
        Answer the bundle state of the system in tabular form. Each row of the returned table represents a single bundle. The Tabular Data consists of Composite Data that is type by BUNDLES_TYPE.
        Returns:
        the tabular representation of the bundle state
        Throws:
        java.io.IOException
      • listBundles

        javax.management.openmbean.TabularData listBundles​(java.lang.String... items)
                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getExportedPackages

        java.lang.String[] getExportedPackages​(long bundleId)
                                        throws java.io.IOException
        Answer the list of exported packages for this bundle.
        Parameters:
        bundleId -
        Returns:
        the array of package names, combined with their version in the format <packageName;version>
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • getFragments

        long[] getFragments​(long bundleId)
                     throws java.io.IOException
        Answer the list of the bundle ids of the fragments associated with this bundle
        Parameters:
        bundleId -
        Returns:
        the array of bundle identifiers
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • getHeaders

        javax.management.openmbean.TabularData getHeaders​(long bundleId)
                                                   throws java.io.IOException
        Answer the headers for the bundle uniquely identified by the bundle id. The Tabular Data is typed by the HEADERS_TYPE.
        Parameters:
        bundleId - the unique identifier of the bundle
        Returns:
        the table of associated header key and values
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • getHeaders

        javax.management.openmbean.TabularData getHeaders​(long bundleId,
                                                          java.lang.String locale)
                                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • getHeader

        java.lang.String getHeader​(long bundleId,
                                   java.lang.String key)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • getHeader

        java.lang.String getHeader​(long bundleId,
                                   java.lang.String key,
                                   java.lang.String locale)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • getHosts

        long[] getHosts​(long fragment)
                 throws java.io.IOException
        Answer the list of bundle ids of the bundles which host a fragment
        Parameters:
        fragment - the bundle id of the fragment
        Returns:
        the array of bundle identifiers
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • getImportedPackages

        java.lang.String[] getImportedPackages​(long bundleId)
                                        throws java.io.IOException
        Answer the array of the packages imported by this bundle
        Parameters:
        bundleId - the bundle identifier
        Returns:
        the array of package names, combined with their version in the format <packageName;version>
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • getLastModified

        long getLastModified​(long bundleId)
                      throws java.io.IOException
        Answer the last modified time of a bundle
        Parameters:
        bundleId - the unique identifier of a bundle
        Returns:
        the last modified time
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • getRegisteredServices

        long[] getRegisteredServices​(long bundleId)
                              throws java.io.IOException
        Answer the list of service identifiers representing the services this bundle exports
        Parameters:
        bundleId - the bundle identifier
        Returns:
        the list of service identifiers
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • getRequiringBundles

        long[] getRequiringBundles​(long bundleIdentifier)
                            throws java.io.IOException
        Answer the list of identifiers of the bundles which require this bundle
        Parameters:
        bundleIdentifier - the bundle identifier
        Returns:
        the list of bundle identifiers
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • getServicesInUse

        long[] getServicesInUse​(long bundleIdentifier)
                         throws java.io.IOException
        Answer the list of service identifiers which refer to the the services this bundle is using
        Parameters:
        bundleIdentifier - the bundle identifier
        Returns:
        the list of service identifiers
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • getStartLevel

        int getStartLevel​(long bundleId)
                   throws java.io.IOException
        Answer the start level of the bundle
        Parameters:
        bundleId - the identifier of the bundle
        Returns:
        the start level
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • getState

        java.lang.String getState​(long bundleId)
                           throws java.io.IOException
        Answer the symbolic name of the state of the bundle
        Parameters:
        bundleId - the identifier of the bundle
        Returns:
        the string name of the bundle state
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • getSymbolicName

        java.lang.String getSymbolicName​(long bundleId)
                                  throws java.io.IOException
        Answer the symbolic name of the bundle
        Parameters:
        bundleId - the identifier of the bundle
        Returns:
        the symbolic name
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • isActivationPolicyUsed

        boolean isActivationPolicyUsed​(long bundleId)
                                throws java.io.IOException
        Answer whether the specified bundle's autostart setting indicates that the activation policy declared in the bundle's manifest must be used.
        Parameters:
        bundleId - the identifier of the bundle
        Returns:
        true if the bundle's autostart setting indicates the activation policy declared in the manifest must be used. false if the bundle must be eagerly activated.
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • isPersistentlyStarted

        boolean isPersistentlyStarted​(long bundleId)
                               throws java.io.IOException
        Answer if the bundle is persistently started when its start level is reached
        Parameters:
        bundleId - the identifier of the bundle
        Returns:
        true if the bundle is persistently started
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • isFragment

        boolean isFragment​(long bundleId)
                    throws java.io.IOException
        Answer whether the bundle is a fragment or not
        Parameters:
        bundleId - the identifier of the bundle
        Returns:
        true if the bundle is a fragment
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • isRemovalPending

        boolean isRemovalPending​(long bundleId)
                          throws java.io.IOException
        Answer true if the bundle is pending removal
        Parameters:
        bundleId - the identifier of the bundle
        Returns:
        true if the bundle is pending removal
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • isRequired

        boolean isRequired​(long bundleId)
                    throws java.io.IOException
        Answer true if the bundle is required by another bundle
        Parameters:
        bundleId - the identifier of the bundle
        Returns:
        true if the bundle is required by another bundle
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • getLocation

        java.lang.String getLocation​(long bundleId)
                              throws java.io.IOException
        Answer the location of the bundle.
        Parameters:
        bundleId - the identifier of the bundle
        Returns:
        The location string of this bundle
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist
      • getVersion

        java.lang.String getVersion​(long bundleId)
                             throws java.io.IOException
        Answer the location of the bundle.
        Parameters:
        bundleId - the identifier of the bundle
        Returns:
        The location string of this bundle
        Throws:
        java.io.IOException - if the operation fails
        java.lang.IllegalArgumentException - if the bundle indicated does not exist