Set<XBundle> getBundles() { Set<XBundle> result = new HashSet<XBundle>(); XEnvironment env = injectedEnvironment.getValue(); for (Resource aux : env.getResources(XEnvironment.ALL_IDENTITY_TYPES)) { XBundle bundle = ((XBundleRevision) aux).getBundle(); if (bundle.getState() != Bundle.UNINSTALLED) result.add(bundle); } return Collections.unmodifiableSet(result); }
@Override public Set<XBundle> getBundles(Integer states) { Set<XBundle> result = new HashSet<XBundle>(); XEnvironment env = injectedEnvironment.getValue(); for (Resource aux : env.getResources(XEnvironment.ALL_IDENTITY_TYPES)) { XBundle bundle = ((XBundleRevision) aux).getBundle(); if (states == null || (bundle.getState() & states.intValue()) != 0) result.add(bundle); } return Collections.unmodifiableSet(result); }
@Override public XBundle getBundleById(long bundleId) { if (bundleId == 0) { return getFrameworkState().getSystemBundle(); } XEnvironment env = injectedEnvironment.getValue(); Collection<XResource> resources = env.getResources(XEnvironment.ALL_IDENTITY_TYPES); for (Resource aux : resources) { XBundle bundle = ((XBundleRevision) aux).getBundle(); if (bundle.getBundleId() == bundleId) { return bundle; } } return null; }