Search in sources :

Example 1 with BundleData

use of org.apache.aries.jmx.codec.BundleData in project aries by apache.

the class BundleState method getBundle.

public CompositeData getBundle(long id) throws IOException {
    Bundle bundle = bundleContext.getBundle(id);
    if (bundle == null)
        return null;
    BundleData data = new BundleData(bundleContext, bundle, packageAdmin, startLevel);
    return data.toCompositeData();
}
Also used : Bundle(org.osgi.framework.Bundle) FrameworkUtils.resolveBundle(org.apache.aries.jmx.util.FrameworkUtils.resolveBundle) FrameworkUtils.getServicesInUseByBundle(org.apache.aries.jmx.util.FrameworkUtils.getServicesInUseByBundle) BundleData(org.apache.aries.jmx.codec.BundleData)

Example 2 with BundleData

use of org.apache.aries.jmx.codec.BundleData in project aries by apache.

the class BundleState method listBundles.

private TabularData listBundles(Collection<String> items) throws IOException {
    Bundle[] containerBundles = bundleContext.getBundles();
    List<BundleData> bundleDatas = new ArrayList<BundleData>();
    if (containerBundles != null) {
        for (Bundle containerBundle : containerBundles) {
            bundleDatas.add(new BundleData(bundleContext, containerBundle, packageAdmin, startLevel));
        }
    }
    TabularData bundleTable = new TabularDataSupport(BUNDLES_TYPE);
    for (BundleData bundleData : bundleDatas) {
        bundleTable.put(bundleData.toCompositeData(items));
    }
    return bundleTable;
}
Also used : Bundle(org.osgi.framework.Bundle) FrameworkUtils.resolveBundle(org.apache.aries.jmx.util.FrameworkUtils.resolveBundle) FrameworkUtils.getServicesInUseByBundle(org.apache.aries.jmx.util.FrameworkUtils.getServicesInUseByBundle) TabularDataSupport(javax.management.openmbean.TabularDataSupport) ArrayList(java.util.ArrayList) BundleData(org.apache.aries.jmx.codec.BundleData) TabularData(javax.management.openmbean.TabularData)

Aggregations

BundleData (org.apache.aries.jmx.codec.BundleData)2 FrameworkUtils.getServicesInUseByBundle (org.apache.aries.jmx.util.FrameworkUtils.getServicesInUseByBundle)2 FrameworkUtils.resolveBundle (org.apache.aries.jmx.util.FrameworkUtils.resolveBundle)2 Bundle (org.osgi.framework.Bundle)2 ArrayList (java.util.ArrayList)1 TabularData (javax.management.openmbean.TabularData)1 TabularDataSupport (javax.management.openmbean.TabularDataSupport)1