public long getStateTimeStamp() { PlatformAdmin admin = getPlatformAdmin(); return admin == null ? -1 : admin.getState(false).getTimeStamp(); }
private BundleDescription getBundleDescription(Object obj) { if (obj instanceof BundleSpecification) obj = ((BundleSpecification) obj).getSupplier(); else if (obj instanceof ImportPackageSpecification) obj = ((ExportPackageDescription) ((ImportPackageSpecification) obj).getSupplier()).getSupplier(); if (obj instanceof BundleDescription) return (BundleDescription) obj; return null; }
@Override public State readState(File stateDirectory) throws IOException { return getImplementation().readState(stateDirectory); } }
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; }
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; }
static void setDisabled(boolean disable, BundleDescription bundle) { State state = bundle.getContainingState(); if (disable) { state.addDisabledInfo(new DisabledInfo(COMPOSITE_POLICY, "Composite companion bundle is not resolved.", bundle)); //$NON-NLS-1$ } else { DisabledInfo toRemove = state.getDisabledInfo(bundle, COMPOSITE_POLICY); if (toRemove != null) state.removeDisabledInfo(toRemove); } }
public BundleWireImpl(StateWire wire) { VersionConstraint declaredRequirement = wire.getDeclaredRequirement(); if (declaredRequirement instanceof HostSpecification) this.capability = ((BaseDescriptionImpl) wire.getDeclaredCapability()).getCapability(BundleRevision.HOST_NAMESPACE); else this.capability = wire.getDeclaredCapability().getCapability(); this.provider = wire.getCapabilityHost().getWiring(); this.requirement = declaredRequirement.getRequirement(); this.requirer = wire.getRequirementHost().getWiring(); }
@Override public State createState(State state) { return getImplementation().createState(state); }
public boolean isRemovalPending() { BundleDescription exporter = exportedPackage.getExporter(); if (exporter != null) return exporter.isRemovalPending(); return true; }
@Override public HostSpecification createHostSpecification(String hostSymbolicName, VersionRange hostVersionRange) { return getImplementation().createHostSpecification(hostSymbolicName, hostVersionRange); }
@Override public NativeCodeSpecification createNativeCodeSpecification(NativeCodeDescription[] nativeCodeDescriptions, boolean optional) { return getImplementation().createNativeCodeSpecification(nativeCodeDescriptions, optional); }
@Override public NativeCodeDescription createNativeCodeDescription(String[] nativePaths, String[] processors, String[] osNames, VersionRange[] osVersions, String[] languages, String filter) throws InvalidSyntaxException { return getImplementation().createNativeCodeDescription(nativePaths, processors, osNames, osVersions, languages, filter); }
@Override public ExportPackageDescription createExportPackageDescription(ExportPackageDescription original) { return getImplementation().createExportPackageDescription(original); }
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; }
static void setDisabled(boolean disable, BundleDescription bundle) { State state = bundle.getContainingState(); if (disable) { state.addDisabledInfo(new DisabledInfo(COMPOSITE_POLICY, "Composite companion bundle is not resolved.", bundle)); //$NON-NLS-1$ } else { DisabledInfo toRemove = state.getDisabledInfo(bundle, COMPOSITE_POLICY); if (toRemove != null) state.removeDisabledInfo(toRemove); } }
@Override public State readState(File stateDirectory) throws IOException { return getImplementation().readState(stateDirectory); } }
@Override public State readState(File stateDirectory) throws IOException { return getImplementation().readState(stateDirectory); } }
@Override public State readState(File stateDirectory) throws IOException { return getImplementation().readState(stateDirectory); } }