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); } }
public int compareTo(BundleDelta obj) { long idcomp = getBundle().getBundleId() - obj.getBundle().getBundleId(); return (idcomp < 0L) ? -1 : ((idcomp > 0L) ? 1 : 0); } }
@Override public void stateResolved(StateDelta delta) { if (delta == null) { // if delta is null, then target has changed // prepare all projects for "touching" fTouchWorkspace = true; fProjectNames.clear(); } else { BundleDelta[] deltas = delta.getChanges(); for (int i = 0; i < deltas.length; i++) { // only interested in workspace plug-ins that are affected by delta // but not those who have caused it. int type = deltas[i].getType(); if ((type & BundleDelta.UPDATED) == BundleDelta.UPDATED || (type & BundleDelta.ADDED) == BundleDelta.ADDED || (type & BundleDelta.REMOVED) == BundleDelta.REMOVED) continue; IPluginModelBase model = PluginRegistry.findModel(deltas[i].getBundle()); IResource resource = model == null ? null : model.getUnderlyingResource(); if (resource != null) fProjectNames.add(resource.getProject().getName()); } } }
public void stateResolved(StateDelta delta) { if (delta == null) { // if delta is null, then target has changed // prepare all projects for "touching" fTouchWorkspace = true; fProjectNames.clear(); } else { BundleDelta[] deltas = delta.getChanges(); for (int i = 0; i < deltas.length; i++) { // only interested in workspace plug-ins that are affected by delta // but not those who have caused it. int type = deltas[i].getType(); if ((type & BundleDelta.UPDATED) == BundleDelta.UPDATED || (type & BundleDelta.ADDED) == BundleDelta.ADDED || (type & BundleDelta.REMOVED) == BundleDelta.REMOVED) continue; IPluginModelBase model = PluginRegistry.findModel(deltas[i].getBundle()); IResource resource = model == null ? null : model.getUnderlyingResource(); if (resource != null) fProjectNames.add(resource.getProject().getName()); } } }
private void applyDeltas(BundleDelta[] bundleDeltas) throws BundleException { Arrays.sort(bundleDeltas, new Comparator<BundleDelta>() { public int compare(BundleDelta delta0, BundleDelta delta1) { return (int) (delta0.getBundle().getBundleId() - delta1.getBundle().getBundleId()); } }); for (int i = 0; i < bundleDeltas.length; i++) { int type = bundleDeltas[i].getType(); if ((type & (BundleDelta.REMOVAL_PENDING | BundleDelta.REMOVAL_COMPLETE)) != 0) applyRemovalPending(bundleDeltas[i]); if ((type & BundleDelta.RESOLVED) != 0) { AbstractBundle bundle = setResolved(bundleDeltas[i].getBundle()); if (bundle != null && bundle.isResolved()) { NativeCodeSpecification nativeCode = bundleDeltas[i].getBundle().getNativeCodeSpecification(); if (nativeCode != null && nativeCode.getSupplier() != null) try { BundleData data = bundle.getBundleData(); data.installNativeCode(((NativeCodeDescription) nativeCode.getSupplier()).getNativePaths()); } catch (BundleException e) { framework.publishFrameworkEvent(FrameworkEvent.ERROR, bundle, e); } } } } }
private void applyDeltas(BundleDelta[] bundleDeltas) throws BundleException { Arrays.sort(bundleDeltas, new Comparator<BundleDelta>() { public int compare(BundleDelta delta0, BundleDelta delta1) { return (int) (delta0.getBundle().getBundleId() - delta1.getBundle().getBundleId()); } }); for (int i = 0; i < bundleDeltas.length; i++) { int type = bundleDeltas[i].getType(); if ((type & (BundleDelta.REMOVAL_PENDING | BundleDelta.REMOVAL_COMPLETE)) != 0) applyRemovalPending(bundleDeltas[i]); if ((type & BundleDelta.RESOLVED) != 0) { AbstractBundle bundle = setResolved(bundleDeltas[i].getBundle()); if (bundle != null && bundle.isResolved()) { NativeCodeSpecification nativeCode = bundleDeltas[i].getBundle().getNativeCodeSpecification(); if (nativeCode != null && nativeCode.getSupplier() != null) try { BundleData data = bundle.getBundleData(); data.installNativeCode(((NativeCodeDescription) nativeCode.getSupplier()).getNativePaths()); } catch (BundleException e) { framework.publishFrameworkEvent(FrameworkEvent.ERROR, bundle, e); } } } } }
IPluginModelBase model = findModel(deltas[i].getBundle()); IResource resource = model == null ? null : model.getUnderlyingResource(); if (resource != null) {
IPluginModelBase model = findModel(deltas[i].getBundle()); IResource resource = model == null ? null : model.getUnderlyingResource(); if (resource != null) {
private void applyRemovalPending(BundleDelta bundleDelta) throws BundleException { if ((bundleDelta.getType() & BundleDelta.REMOVAL_COMPLETE) != 0) { BundleDescription bundle = bundleDelta.getBundle(); if (bundle.getDependents() != null && bundle.getDependents().length > 0) { /* Reaching here is an internal error */ if (Debug.DEBUG_PACKAGEADMIN) { Debug.println("Bundles still depend on removed bundle! " + bundle); //$NON-NLS-1$ Debug.printStackTrace(new Exception("Stack trace")); //$NON-NLS-1$ } throw new BundleException(Msg.OSGI_INTERNAL_ERROR); } Object userObject = bundle.getUserObject(); if (userObject instanceof BundleLoaderProxy) { BundleLoader.closeBundleLoader((BundleLoaderProxy) userObject); try { ((BundleLoaderProxy) userObject).getBundleData().close(); } catch (IOException e) { // ignore } } else if (userObject instanceof BundleData) { try { ((BundleData) userObject).close(); } catch (IOException e) { // ignore } } } }
private void applyRemovalPending(BundleDelta bundleDelta) throws BundleException { if ((bundleDelta.getType() & BundleDelta.REMOVAL_COMPLETE) != 0) { BundleDescription bundle = bundleDelta.getBundle(); if (bundle.getDependents() != null && bundle.getDependents().length > 0) { /* Reaching here is an internal error */ if (Debug.DEBUG_PACKAGEADMIN) { Debug.println("Bundles still depend on removed bundle! " + bundle); //$NON-NLS-1$ Debug.printStackTrace(new Exception("Stack trace")); //$NON-NLS-1$ } throw new BundleException(Msg.OSGI_INTERNAL_ERROR); } Object userObject = bundle.getUserObject(); if (userObject instanceof BundleLoaderProxy) { BundleLoader.closeBundleLoader((BundleLoaderProxy) userObject); try { ((BundleLoaderProxy) userObject).getBundleData().close(); } catch (IOException e) { // ignore } } else if (userObject instanceof BundleData) { try { ((BundleData) userObject).close(); } catch (IOException e) { // ignore } } } }
AbstractBundle changedBundle = framework.getBundle(bundleDeltas[i].getBundle().getBundleId()); if (changedBundle != null && !bundlesList.contains(changedBundle)) bundlesList.add(changedBundle);
AbstractBundle changedBundle = framework.getBundle(bundleDeltas[i].getBundle().getBundleId()); if (changedBundle != null && !bundlesList.contains(changedBundle)) bundlesList.add(changedBundle);