Search in sources :

Example 1 with BundleInfoProvider

use of org.apache.felix.webconsole.bundleinfo.BundleInfoProvider in project felix by apache.

the class BundlesServlet method bundleInfoDetails.

private final void bundleInfoDetails(List<Map<String, Object>> props, Bundle bundle, String appRoot, final Locale locale) {
    final Map<String, Object> val = new LinkedHashMap<String, Object>();
    val.put("key", "nfo");
    final Map<String, Object[]> value = new LinkedHashMap<String, Object[]>();
    final Object[] bundleInfoProviders = bundleInfoTracker.getServices();
    for (int i = 0; bundleInfoProviders != null && i < bundleInfoProviders.length; i++) {
        final BundleInfoProvider infoProvider = (BundleInfoProvider) bundleInfoProviders[i];
        final BundleInfo[] infos = infoProvider.getBundleInfo(bundle, appRoot, locale);
        if (null != infos && infos.length > 0) {
            final Object[] infoArray = new Object[infos.length];
            for (int j = 0; j < infos.length; j++) {
                infoArray[j] = bundleInfo(infos[j]);
            }
            value.put(infoProvider.getName(locale), infoArray);
        }
    }
    val.put("value", value);
    props.add(val);
}
Also used : BundleInfo(org.apache.felix.webconsole.bundleinfo.BundleInfo) LinkedHashMap(java.util.LinkedHashMap) BundleInfoProvider(org.apache.felix.webconsole.bundleinfo.BundleInfoProvider)

Aggregations

LinkedHashMap (java.util.LinkedHashMap)1 BundleInfo (org.apache.felix.webconsole.bundleinfo.BundleInfo)1 BundleInfoProvider (org.apache.felix.webconsole.bundleinfo.BundleInfoProvider)1