/** * If useFwPersistentData flag equals false, this constructor will not take * a framework persistent data into account. Otherwise, it will. * * @param context * @param fwAdmin * @param manipulator * @param useFwPersistentData */ EquinoxBundlesState(BundleContext context, EquinoxFwAdminImpl fwAdmin, Manipulator manipulator, PlatformAdmin admin, boolean useFwPersistentData) { this.context = context; this.fwAdmin = fwAdmin; this.platformAdmin = admin; // copy manipulator object for avoiding modifying the parameters of the // manipulator. this.manipulator = fwAdmin.getManipulator(); this.manipulator.setConfigData(manipulator.getConfigData()); this.manipulator.setLauncherData(manipulator.getLauncherData()); initialize(useFwPersistentData); }
public BundlesState getBundlesState() throws FrameworkAdminRuntimeException { loadDelegate(); return manipulator.getBundlesState(); }
public BundleInfo[] save(Manipulator manipulator, boolean backup) throws IOException { List<BundleInfo> setToInitialConfig = new LinkedList<BundleInfo>(); List<BundleInfo> setToSimpleConfig = new LinkedList<BundleInfo>(); ConfigData configData = manipulator.getConfigData(); if (!divideBundleInfos(manipulator, setToInitialConfig, setToSimpleConfig, configData.getInitialBundleStartLevel())) return configData.getBundles(); File outputFile = getConfigFile(manipulator); URI installArea = ParserUtils.getOSGiInstallArea(Arrays.asList(manipulator.getLauncherData().getProgramArgs()), manipulator.getConfigData().getProperties(), manipulator.getLauncherData()).toURI(); saveConfiguration(setToSimpleConfig.toArray(new BundleInfo[setToSimpleConfig.size()]), outputFile, installArea, backup); configData.setProperty(SimpleConfiguratorManipulatorImpl.PROP_KEY_CONFIGURL, outputFile.toURL().toExternalForm()); return orderingInitialConfig(setToInitialConfig); }
public LauncherData getLauncherData() { return manipulator == null ? null : manipulator.getLauncherData(); }
public ConfigData getConfigData() throws FrameworkAdminRuntimeException { loadDelegate(); return manipulator.getConfigData(); }
private boolean initializeFromConfigFiles() { FrameworkAdmin fwk = LazyManipulator.getFrameworkAdmin(); if (fwk == null) return false; Manipulator manipulator = fwk.getManipulator(); LauncherData launcherData = manipulator.getLauncherData(); launcherData.setFwConfigLocation(configurationFolder != null ? configurationFolder : new File(installFolder, "configuration/config.ini")); //$NON-NLS-1$ launcherData.setHome(installFolder); try { manipulator.load(); } catch (IllegalStateException e) { return false; } catch (FrameworkAdminRuntimeException e) { return false; } catch (IOException e) { return false; } profileId = manipulator.getConfigData().getProperty("eclipse.p2.profile"); //$NON-NLS-1$ p2DataAreaURI = manipulator.getConfigData().getProperty("eclipse.p2.data.area"); //$NON-NLS-1$ return true; }
System.out.println("SimpleConfiguratorManipulatorImpl#updateBundles()"); //$NON-NLS-1$ BundlesState bundleState = manipulator.getBundlesState(); return; Properties properties = new Properties(); String[] jvmArgs = manipulator.getLauncherData().getJvmArgs(); for (int i = 0; i < jvmArgs.length; i++) { if (jvmArgs[i].startsWith("-D")) { //$NON-NLS-1$ Utils.appendProperties(properties, manipulator.getConfigData().getProperties()); boolean exclusiveInstallation = Boolean.valueOf(properties.getProperty(SimpleConfiguratorManipulatorImpl.PROP_KEY_EXCLUSIVE_INSTALLATION)).booleanValue(); File configFile = getConfigFile(manipulator); File installArea = ParserUtils.getOSGiInstallArea(Arrays.asList(manipulator.getLauncherData().getProgramArgs()), manipulator.getConfigData().getProperties(), manipulator.getLauncherData()); BundleInfo[] toInstall = new BundleInfo[0]; manipulator.getConfigData().setBundles(bundleState.getExpectedState());
manipulator.getLauncherData().setLauncher(new File(home, "eclipse")); //$NON-NLS-1$ File installDirectory = new File(home); manipulator.getLauncherData().setLauncherConfigLocation(new File(installDirectory, "eclipse.ini")); //$NON-NLS-1$ manipulator.getLauncherData().setHome(new File(home)); manipulator.setConfigData(configData); manipulator.load(); fVMArgs = manipulator.getLauncherData().getJvmArgs();
private void initializeFrameworkManipulator(File config, File executable) { getFrameworkManipulator(); LauncherData launcherData = manipulator.getLauncherData(); launcherData.setFwPersistentDataLocation(config, true); launcherData.setLauncher(executable); if (executable == null) launcherData.setHome(config.getParentFile()); try { manipulator.load(); } catch (IllegalStateException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } catch (FrameworkAdminRuntimeException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } catch (IOException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } }
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();
public void setConfigData(ConfigData configData) { loadDelegate(); manipulator.setConfigData(configData); }
public void setLauncherData(LauncherData launcherData) { loadDelegate(); manipulator.setLauncherData(launcherData); } }
public BundleInfo[] save(Manipulator manipulator, boolean backup) throws IOException { List setToInitialConfig = new LinkedList(); List setToSimpleConfig = new LinkedList(); ConfigData configData = manipulator.getConfigData(); if (!divideBundleInfos(manipulator, setToInitialConfig, setToSimpleConfig, configData.getInitialBundleStartLevel())) return configData.getBundles(); File outputFile = getConfigFile(manipulator); URI installArea = ParserUtils.getOSGiInstallArea(Arrays.asList(manipulator.getLauncherData().getProgramArgs()), manipulator.getConfigData().getProperties(), manipulator.getLauncherData()).toURI(); saveConfiguration((BundleInfo[]) setToSimpleConfig.toArray(new BundleInfo[setToSimpleConfig.size()]), outputFile, installArea, backup); configData.setProperty(SimpleConfiguratorManipulatorImpl.PROP_KEY_CONFIGURL, outputFile.toURL().toExternalForm()); return orderingInitialConfig(setToInitialConfig); }
public LauncherData getLauncherData() { return manipulator == null ? null : manipulator.getLauncherData(); }
public ConfigData getConfigData() throws FrameworkAdminRuntimeException { loadDelegate(); return manipulator.getConfigData(); }
private boolean initializeFromConfigFiles() { FrameworkAdmin fwk = LazyManipulator.getFrameworkAdmin(); if (fwk == null) return false; Manipulator manipulator = fwk.getManipulator(); LauncherData launcherData = manipulator.getLauncherData(); launcherData.setFwConfigLocation(configurationFolder != null ? configurationFolder : new File(installFolder, "configuration/config.ini")); //$NON-NLS-1$ launcherData.setHome(installFolder); try { manipulator.load(); } catch (IllegalStateException e) { return false; } catch (FrameworkAdminRuntimeException e) { return false; } catch (IOException e) { return false; } profileId = manipulator.getConfigData().getProperty("eclipse.p2.profile"); //$NON-NLS-1$ p2DataAreaURI = manipulator.getConfigData().getProperty("eclipse.p2.data.area"); //$NON-NLS-1$ return true; }
System.out.println("SimpleConfiguratorManipulatorImpl#updateBundles()"); //$NON-NLS-1$ BundlesState bundleState = manipulator.getBundlesState(); return; Properties properties = new Properties(); String[] jvmArgs = manipulator.getLauncherData().getJvmArgs(); for (int i = 0; i < jvmArgs.length; i++) { if (jvmArgs[i].startsWith("-D")) { //$NON-NLS-1$ Utils.appendProperties(properties, manipulator.getConfigData().getProperties()); boolean exclusiveInstallation = Boolean.parseBoolean(properties.getProperty(SimpleConfiguratorManipulatorImpl.PROP_KEY_EXCLUSIVE_INSTALLATION)); File configFile = getConfigFile(manipulator); File installArea = ParserUtils.getOSGiInstallArea(Arrays.asList(manipulator.getLauncherData().getProgramArgs()), manipulator.getConfigData().getProperties(), manipulator.getLauncherData()); BundleInfo[] toInstall = new BundleInfo[0]; manipulator.getConfigData().setBundles(bundleState.getExpectedState());
private void initializeFrameworkManipulator(File config, File executable) { getFrameworkManipulator(); LauncherData launcherData = manipulator.getLauncherData(); launcherData.setFwPersistentDataLocation(config, true); launcherData.setLauncher(executable); if (executable == null) launcherData.setHome(config.getParentFile()); try { manipulator.load(); } catch (IllegalStateException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } catch (FrameworkAdminRuntimeException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } catch (IOException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } }
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();
public void setConfigData(ConfigData configData) { loadDelegate(); manipulator.setConfigData(configData); }