public static synchronized SimplifiedServerInfo getInfo() { if (info == null) { RuntimeService runtime = Framework.getRuntime(); Collection<RegistrationInfo> registrations = runtime.getComponentManager().getRegistrations(); bundleIds = new ArrayList<>(); List<SimplifiedBundleInfo> bundles = new ArrayList<>(); for (RegistrationInfo ri : registrations) { Bundle bundle = ri.getContext().getBundle(); if (bundle != null && !bundleIds.contains(bundle.getSymbolicName())) { SimplifiedBundleInfo bi = getBundleSimplifiedInfo(bundle); bundleIds.add(bundle.getSymbolicName()); if (bi != null) { bundles.add(bi); } } } Collections.sort(bundles); info = new SimplifiedServerInfo(); info.setBundleInfos(bundles); info.setRuntimeVersion(runtime.getVersion().toString()); info.setWarnings(runtime.getWarnings()); } return info; }
public static synchronized SimplifiedServerInfo getInfo() { if (info == null) { RuntimeService runtime = Framework.getRuntime(); Collection<RegistrationInfo> registrations = runtime.getComponentManager().getRegistrations(); bundleIds = new ArrayList<>(); List<SimplifiedBundleInfo> bundles = new ArrayList<>(); for (RegistrationInfo ri : registrations) { Bundle bundle = ri.getContext().getBundle(); if (bundle != null && !bundleIds.contains(bundle.getSymbolicName())) { SimplifiedBundleInfo bi = getBundleSimplifiedInfo(bundle); bundleIds.add(bundle.getSymbolicName()); if (bi != null) { bundles.add(bi); } } } Collections.sort(bundles); info = new SimplifiedServerInfo(); info.setBundleInfos(bundles); info.setRuntimeVersion(runtime.getVersion().toString()); RuntimeMessageHandler runtimeMessageHandler = runtime.getMessageHandler(); info.setWarnings(runtimeMessageHandler.getWarnings()); info.setErrors(runtimeMessageHandler.getErrors()); } return info; }