public BundleInfo[] getExpectedState() throws IllegalArgumentException, FrameworkAdminRuntimeException { //Log.log(LogService.LOG_DEBUG, this, "getExpectedState()", "BEGIN"); SimpleBundlesState.checkAvailability(fwAdmin); BundlesState bundleState = this.getBundlesState(); if (bundleState instanceof SimpleBundlesState) return new BundleInfo[0]; bundleState.resolve(true); return bundleState.getExpectedState(); }
void setPrerequisiteBundles(BundleInfo configuratorBundleInfo, BundlesState state, LocationInfo info) { if (state.isFullySupported()) if (!this.checkResolve(configuratorBundleInfo, state)) { printoutUnsatisfiedConstraints(configuratorBundleInfo, state); return; } BundleInfo[] prerequisites = state.getPrerequisteBundles(configuratorBundleInfo); info.prerequisiteLocations = new URI[prerequisites.length]; for (int i = 0; i < prerequisites.length; i++) info.prerequisiteLocations[i] = prerequisites[i].getLocation(); return; }
private boolean checkResolve(BundleInfo bInfo, BundlesState state) {//throws ManipulatorException { if (bInfo == null) throw new IllegalArgumentException("bInfo is null."); //$NON-NLS-1$ if (!state.isResolved()) state.resolve(false); // if (DEBUG) // System.out.println(state.toString()); if (!state.isResolved(bInfo)) { printoutUnsatisfiedConstraints(bInfo, state); return false; } return true; }
if (bundleState.isFullySupported()) bundleState.resolve(true); BundleInfo[] currentBInfos = bundleState.getExpectedState(); if (!isTargetConfiguratorBundle(currentBInfos)) return; bundleState.installBundle(toInstall[i]); } catch (RuntimeException e) { for (Iterator<BundleInfo> ite = toUninstall.iterator(); ite.hasNext();) { BundleInfo bInfo = ite.next(); bundleState.uninstallBundle(bInfo); bundleState.resolve(true); manipulator.getConfigData().setBundles(bundleState.getExpectedState());
private boolean divideBundleInfos(Manipulator manipulator, List<BundleInfo> setToInitialConfig, List<BundleInfo> setToSimpleConfig, final int initialBSL) { BundlesState state = manipulator.getBundlesState(); BundleInfo[] targetBundleInfos = null; if (state.isFullySupported()) { targetBundleInfos = state.getExpectedState(); } else { targetBundleInfos = manipulator.getConfigData().getBundles(); if (state.isFullySupported()) { state.resolve(false);
void setSystemBundles(BundlesState state, LocationInfo info) { BundleInfo systemBundleInfo = state.getSystemBundle(); if (systemBundleInfo == null) { // TODO Log //throw new IllegalStateException("There is no systemBundle.\n"); return; } if (state.isFullySupported()) if (!this.checkResolve(systemBundleInfo, state)) { printoutUnsatisfiedConstraints(systemBundleInfo, state); return; } info.systemBundleLocation = systemBundleInfo.getLocation(); BundleInfo[] fragments = state.getSystemFragmentedBundles(); info.systemFragmentedBundleLocations = new URI[fragments.length]; for (int i = 0; i < fragments.length; i++) info.systemFragmentedBundleLocations[i] = fragments[i].getLocation(); }
private void updateAccordingToExpectedState(BundlesState bundlesState) { // File newFwJar = EquinoxBundlesState.getFwJar(launcherData, configData); // if (bundlesState instanceof EquinoxBundlesState) // ((EquinoxBundlesState) bundlesState).setFwJar(newFwJar); // // if (launcherData.getFwJar() == null && newFwJar != null) // launcherData.setFwJar(newFwJar); BundleInfo[] newBundleInfos = bundlesState.getExpectedState(); configData.setBundles(newBundleInfos); }
if (bundleState.isFullySupported()) bundleState.resolve(true); BundleInfo[] currentBInfos = bundleState.getExpectedState(); if (!isTargetConfiguratorBundle(currentBInfos)) return; bundleState.installBundle(toInstall[i]); } catch (RuntimeException e) { for (Iterator ite = toUninstall.iterator(); ite.hasNext();) { BundleInfo bInfo = (BundleInfo) ite.next(); bundleState.uninstallBundle(bInfo); bundleState.resolve(true); manipulator.getConfigData().setBundles(bundleState.getExpectedState());
private boolean divideBundleInfos(Manipulator manipulator, List setToInitialConfig, List setToSimpleConfig, final int initialBSL) { BundlesState state = manipulator.getBundlesState(); BundleInfo[] targetBundleInfos = null; if (state.isFullySupported()) { targetBundleInfos = state.getExpectedState(); } else { targetBundleInfos = manipulator.getConfigData().getBundles(); if (state.isFullySupported()) { state.resolve(false);
void setSystemBundles(BundlesState state, LocationInfo info) { BundleInfo systemBundleInfo = state.getSystemBundle(); if (systemBundleInfo == null) { // TODO Log //throw new IllegalStateException("There is no systemBundle.\n"); return; } if (state.isFullySupported()) if (!this.checkResolve(systemBundleInfo, state)) { printoutUnsatisfiedConstraints(systemBundleInfo, state); return; } info.systemBundleLocation = systemBundleInfo.getLocation(); BundleInfo[] fragments = state.getSystemFragmentedBundles(); info.systemFragmentedBundleLocations = new URI[fragments.length]; for (int i = 0; i < fragments.length; i++) info.systemFragmentedBundleLocations[i] = fragments[i].getLocation(); }
private void updateAccordingToExpectedState(BundlesState bundlesState) { // File newFwJar = EquinoxBundlesState.getFwJar(launcherData, configData); // if (bundlesState instanceof EquinoxBundlesState) // ((EquinoxBundlesState) bundlesState).setFwJar(newFwJar); // // if (launcherData.getFwJar() == null && newFwJar != null) // launcherData.setFwJar(newFwJar); BundleInfo[] newBundleInfos = bundlesState.getExpectedState(); configData.setBundles(newBundleInfos); }
if (bundleState.isFullySupported()) bundleState.resolve(true); BundleInfo[] currentBInfos = bundleState.getExpectedState(); if (!isTargetConfiguratorBundle(currentBInfos)) return; bundleState.installBundle(toInstall[i]); } catch (RuntimeException e) { for (Iterator<BundleInfo> ite = toUninstall.iterator(); ite.hasNext();) { BundleInfo bInfo = ite.next(); bundleState.uninstallBundle(bInfo); bundleState.resolve(true); manipulator.getConfigData().setBundles(bundleState.getExpectedState());
private boolean divideBundleInfos(Manipulator manipulator, List<BundleInfo> setToInitialConfig, List<BundleInfo> setToSimpleConfig, final int initialBSL) { BundlesState state = manipulator.getBundlesState(); BundleInfo[] targetBundleInfos = null; if (state.isFullySupported()) { targetBundleInfos = state.getExpectedState(); } else { targetBundleInfos = manipulator.getConfigData().getBundles(); if (state.isFullySupported()) { state.resolve(false);
void setSystemBundles(BundlesState state, LocationInfo info) { BundleInfo systemBundleInfo = state.getSystemBundle(); if (systemBundleInfo == null) { // TODO Log //throw new IllegalStateException("There is no systemBundle.\n"); return; } if (state.isFullySupported()) if (!this.checkResolve(systemBundleInfo, state)) { printoutUnsatisfiedConstraints(systemBundleInfo, state); return; } info.systemBundleLocation = systemBundleInfo.getLocation(); BundleInfo[] fragments = state.getSystemFragmentedBundles(); info.systemFragmentedBundleLocations = new URI[fragments.length]; for (int i = 0; i < fragments.length; i++) info.systemFragmentedBundleLocations[i] = fragments[i].getLocation(); }
@Override public BundleInfo[] getExpectedState() throws IllegalArgumentException, FrameworkAdminRuntimeException { //Log.log(LogService.LOG_DEBUG, this, "getExpectedState()", "BEGIN"); SimpleBundlesState.checkAvailability(fwAdmin); BundlesState bundleState = this.getBundlesState(); if (bundleState instanceof SimpleBundlesState) return new BundleInfo[0]; bundleState.resolve(true); return bundleState.getExpectedState(); }
private boolean checkResolve(BundleInfo bInfo, BundlesState state) {//throws ManipulatorException { if (bInfo == null) throw new IllegalArgumentException("bInfo is null."); if (!state.isResolved()) state.resolve(false); // if (DEBUG) // System.out.println(state.toString()); if (!state.isResolved(bInfo)) { printoutUnsatisfiedConstraints(bInfo, state); return false; } return true; }
void setPrerequisiteBundles(BundleInfo configuratorBundleInfo, BundlesState state, LocationInfo info) { if (state.isFullySupported()) if (!this.checkResolve(configuratorBundleInfo, state)) { printoutUnsatisfiedConstraints(configuratorBundleInfo, state); return; } BundleInfo[] prerequisites = state.getPrerequisteBundles(configuratorBundleInfo); info.prerequisiteLocations = new URI[prerequisites.length]; for (int i = 0; i < prerequisites.length; i++) info.prerequisiteLocations[i] = prerequisites[i].getLocation(); return; }
private boolean checkResolve(BundleInfo bInfo, BundlesState state) {//throws ManipulatorException { if (bInfo == null) throw new IllegalArgumentException("bInfo is null."); //$NON-NLS-1$ if (!state.isResolved()) state.resolve(false); // if (DEBUG) // System.out.println(state.toString()); if (!state.isResolved(bInfo)) { printoutUnsatisfiedConstraints(bInfo, state); return false; } return true; }
void setPrerequisiteBundles(BundleInfo configuratorBundleInfo, BundlesState state, LocationInfo info) { if (state.isFullySupported()) if (!this.checkResolve(configuratorBundleInfo, state)) { printoutUnsatisfiedConstraints(configuratorBundleInfo, state); return; } BundleInfo[] prerequisites = state.getPrerequisteBundles(configuratorBundleInfo); info.prerequisiteLocations = new URI[prerequisites.length]; for (int i = 0; i < prerequisites.length; i++) info.prerequisiteLocations[i] = prerequisites[i].getLocation(); return; }