private static long getMaxId(State state) { BundleDescription[] bundleDescriptions = state.getBundles(); long maxId = DEFAULT_TIMESTAMP; for (int i = 0; i < bundleDescriptions.length; i++) if (maxId < bundleDescriptions[i].getBundleId()) { maxId = bundleDescriptions[i].getBundleId(); } return maxId; }
private static long getMaxId(State state) { BundleDescription[] bundleDescriptions = state.getBundles(); long maxId = DEFAULT_TIMESTAMP; for (int i = 0; i < bundleDescriptions.length; i++) if (maxId < bundleDescriptions[i].getBundleId()) { maxId = bundleDescriptions[i].getBundleId(); } return maxId; }
public int compareTo(BundleDelta obj) { long idcomp = getBundle().getBundleId() - obj.getBundle().getBundleId(); return (idcomp < 0L) ? -1 : ((idcomp > 0L) ? 1 : 0); } }
public int compareTo(BundleDelta obj) { long idcomp = getBundle().getBundleId() - obj.getBundle().getBundleId(); return (idcomp < 0L) ? -1 : ((idcomp > 0L) ? 1 : 0); } }
public int compareTo(BundleDelta obj) { long idcomp = getBundle().getBundleId() - obj.getBundle().getBundleId(); return (idcomp < 0L) ? -1 : ((idcomp > 0L) ? 1 : 0); } }
private static List getSystemExports(ExportPackageDescription[] matchingExports) { ArrayList list = null; for (int i = 0; i < matchingExports.length; i++) { if (matchingExports[i].getExporter().getBundleId() != 0) continue; if (list == null) list = new ArrayList(); list.add(matchingExports[i]); } return list == null ? Collections.EMPTY_LIST : list; }
void load(BundleDescription bundleDescription, PDEState state) { fClassname = state.getClassName(bundleDescription.getBundleId()); fHasExtensibleAPI = state.hasExtensibleAPI(bundleDescription.getBundleId()); super.load(bundleDescription, state); }
ResolverBundle(BundleDescription bundle, ResolverImpl resolver) { super(bundle); this.bundleID = new Long(bundle.getBundleId()); this.resolver = resolver; initialize(bundle.isResolved()); }
public static HashMap getBundleClasspaths(PDEState state) { HashMap properties = new HashMap(); BundleDescription[] bundles = state.getState().getBundles(); for (int i = 0; i < bundles.length; i++) { properties.put(new Long(bundles[i].getBundleId()), getValue(bundles[i], state)); } return properties; }
void load(BundleDescription bundleDesc, PDEState state) { fId = bundleDesc.getSymbolicName(); fVersion = bundleDesc.getVersion().toString(); fName = state.getPluginName(bundleDesc.getBundleId()); fProviderName = state.getProviderName(bundleDesc.getBundleId()); fHasBundleStructure = state.hasBundleStructure(bundleDesc.getBundleId()); fBundleSourceEntry = state.getBundleSourceEntry(bundleDesc.getBundleId()); loadRuntime(bundleDesc, state); loadImports(bundleDesc); }
public List<BundleRevision> getRevisions() { List<BundleRevision> revisions = new ArrayList<BundleRevision>(); BundleDescription current = getBundleDescription(); if (current != null) revisions.add(current); BundleDescription[] removals = framework.adaptor.getState().getRemovalPending(); for (BundleDescription removed : removals) { if (removed.getBundleId() == getBundleId() && removed != current) { revisions.add(removed); } } return revisions; }
public final BundleLoaderProxy getLoaderProxy(BundleDescription source) { Object userObject = source.getUserObject(); if (!(userObject instanceof BundleLoaderProxy)) { // may need to force the proxy to be created long exportingID = source.getBundleId(); BundleHost exportingBundle = (BundleHost) bundle.getFramework().getBundle(exportingID); if (exportingBundle == null) return null; userObject = exportingBundle.getLoaderProxy(); } return (BundleLoaderProxy) userObject; }
private boolean checkExtensionBundle(BundleDescription sameName) { if (sameName.getHost() == null || !sameName.isResolved()) return true; // only do this extra check for resolved fragment bundles // only add fragments if they are not for the system bundle if (((BundleDescription) sameName.getHost().getSupplier()).getBundleId() != 0) return true; // never do this for resolved system bundle fragments return false; }
public final BundleLoaderProxy getLoaderProxy(BundleDescription source) { Object userObject = source.getUserObject(); if (!(userObject instanceof BundleLoaderProxy)) { // may need to force the proxy to be created long exportingID = source.getBundleId(); BundleHost exportingBundle = (BundleHost) bundle.getFramework().getBundle(exportingID); if (exportingBundle == null) return null; userObject = exportingBundle.getLoaderProxy(); } return (BundleLoaderProxy) userObject; }
void loadRuntime(BundleDescription description, PDEState state) { String[] libraryNames = state.getLibraryNames(description.getBundleId()); for (int i = 0; i < libraryNames.length; i++) { PluginLibrary library = new PluginLibrary(); library.setModel(getModel()); library.setInTheModel(true); library.setParent(this); library.load(libraryNames[i]); fLibraries.add(library); } }
@Override boolean basicAddBundle(BundleDescription description) { if (framework != null && description.getUserObject() == null) { // We always set the user object to a BundleReference object; // This allows the resolver to implement BundleRevisions for // the resolver hooks. AbstractBundle bundle = framework.getBundle(description.getBundleId()); description.setUserObject(bundle != null ? bundle.getBundleData() : null); } return super.basicAddBundle(description); }
public void load(BundleDescription desc, PDEState state) { fExtensions = createExtensions(); fExtensions.setModel(this); fExtensions.load(state, desc.getBundleId()); updateTimeStamp(); setLoaded(true); }
private ExportedPackageImpl createExportedPackage(ExportPackageDescription description) { BundleDescription exporter = description.getExporter(); if (exporter == null || exporter.getHost() != null) return null; Object userObject = exporter.getUserObject(); if (!(userObject instanceof BundleLoaderProxy)) { BundleHost bundle = (BundleHost) framework.getBundle(exporter.getBundleId()); if (bundle == null) return null; userObject = bundle.getLoaderProxy(); } return new ExportedPackageImpl(description, (BundleLoaderProxy) userObject); }
private BundleInfo createBundleInfo(BundleDescription toConvert, boolean markedAsStarted, int sl, URI location, String fragmentHost) { BundleInfo result = new BundleInfo(); result.setSymbolicName(toConvert.getSymbolicName()); result.setVersion(toConvert.getVersion().toString()); result.setLocation(location); result.setResolved(toConvert.isResolved()); result.setMarkedAsStarted(markedAsStarted); result.setStartLevel(sl); result.setBundleId(toConvert.getBundleId()); result.setFragmentHost(fragmentHost); return result; }
private BundleInfo createBundleInfo(BundleDescription toConvert, boolean markedAsStarted, int sl, URI location, String fragmentHost) { BundleInfo result = new BundleInfo(); result.setSymbolicName(toConvert.getSymbolicName()); result.setVersion(toConvert.getVersion().toString()); result.setLocation(location); result.setResolved(toConvert.isResolved()); result.setMarkedAsStarted(markedAsStarted); result.setStartLevel(sl); result.setBundleId(toConvert.getBundleId()); result.setFragmentHost(fragmentHost); return result; }