private IStatus applyConfiguration(boolean isInstaller) { if (!isInstaller && isReconciliationApplicationRunning()) return Status.OK_STATUS; BundleContext context = Activator.getContext(); ServiceReference<Configurator> reference = context.getServiceReference(Configurator.class); Configurator configurator = context.getService(reference); try { configurator.applyConfiguration(); } catch (IOException e) { return new Status(IStatus.ERROR, Activator.ID, "Unexpected failure applying configuration", e); //$NON-NLS-1$ } finally { context.ungetService(reference); } return Status.OK_STATUS; }
/** * Apply the profile changes to the currently running configuration. */ void applyConfiguration() throws CoreException { BundleContext context = PDEPlugin.getDefault().getBundle().getBundleContext(); ServiceReference<Configurator> reference = context.getServiceReference(Configurator.class); Configurator configurator = context.getService(reference); try { configurator.applyConfiguration(); } catch (IOException e) { throw new CoreException(new Status(IStatus.ERROR, IPDEUIConstants.PLUGIN_ID, "Unexpected failure applying configuration", e)); //$NON-NLS-1$ } finally { context.ungetService(reference); } }
void applyProfileChanges() { Configurator configurator = (Configurator) ServiceHelper.getService(ProvUIActivator.getContext(), Configurator.class.getName()); try { configurator.applyConfiguration(); } catch (IOException e) { ProvUI.handleException(e, ProvUIMessages.ProvUI_ErrorDuringApplyConfig, StatusManager.LOG | StatusManager.BLOCK); } catch (IllegalStateException e) { IStatus illegalApplyStatus = new Status(IStatus.WARNING, ProvUIActivator.PLUGIN_ID, 0, ProvUIMessages.ProvisioningOperationRunner_CannotApplyChanges, e); ProvUI.reportStatus(illegalApplyStatus, StatusManager.LOG | StatusManager.BLOCK); } }
public static IStatus executePlan(IProvisioningPlan result, IEngine engine, IPhaseSet phaseSet, ProvisioningContext context, IProgressMonitor progress) { if (!result.getStatus().isOK()) return result.getStatus(); if (result.getInstallerPlan() != null) { IStatus installerPlanStatus = ((IEngine) result.getInstallerPlan().getProfile().getProvisioningAgent().getService(IEngine.SERVICE_NAME)).perform(result.getInstallerPlan(), phaseSet, progress); if (!installerPlanStatus.isOK()) return installerPlanStatus; Configurator configChanger = ServiceHelper.getService(DirectorActivator.context, Configurator.class); try { configChanger.applyConfiguration(); } catch (IOException e) { return new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, Messages.Director_error_applying_configuration, e); } } return engine.perform(result, phaseSet, progress); } }
configChanger.applyConfiguration(); } catch (IOException e) { mon.done();
configChanger.applyConfiguration(); } catch (IOException e) { mon.done();