private CharSequence print(Bundle bundle) { // [ ID ] [STATE ] [ SL ] symname StartLevel sl = null; ServiceReference ref = context.getServiceReference(StartLevel.class.getName()); if (ref != null) { sl = (StartLevel) context.getService(ref); } if (sl == null) { return String.format("%5d|%-11s|%s (%s)", bundle.getBundleId(), getState(bundle), bundle.getSymbolicName(), bundle.getVersion()); } int level = sl.getBundleStartLevel(bundle); context.ungetService(ref); return String.format("%5d|%-11s|%5d|%s (%s)", bundle.getBundleId(), getState(bundle), level, bundle.getSymbolicName(), bundle.getVersion()); }
private CharSequence print(Bundle bundle) { // [ ID ] [STATE ] [ SL ] symname int level = bundle.adapt(BundleStartLevel.class).getStartLevel(); return String.format("%5d|%-11s|%5d|%s (%s)", bundle.getBundleId(), getState(bundle), level, bundle.getSymbolicName(), bundle.getVersion()); }
private CharSequence print(Bundle bundle) { // [ ID ] [STATE ] [ SL ] symname int level = bundle.adapt(BundleStartLevel.class).getStartLevel(); return String.format("%5d|%-11s|%5d|%s (%s)", bundle.getBundleId(), getState(bundle), level, bundle.getSymbolicName(), bundle.getVersion()); }
private CharSequence print(Bundle bundle) { // [ ID ] [STATE ] [ SL ] symname StartLevel sl = null; ServiceReference ref = context.getServiceReference(StartLevel.class.getName()); if (ref != null) { sl = (StartLevel) context.getService(ref); } if (sl == null) { return String.format("%5d|%-11s|%s (%s)", bundle.getBundleId(), getState(bundle), bundle.getSymbolicName(), bundle.getVersion()); } int level = sl.getBundleStartLevel(bundle); context.ungetService(ref); return String.format("%5d|%-11s|%5d|%s (%s)", bundle.getBundleId(), getState(bundle), level, bundle.getSymbolicName(), bundle.getVersion()); }