diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Install.java')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Install.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Install.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Install.java index 60b6c2c98..b90dc89d1 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Install.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Install.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. + * Copyright (c) 2007, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -15,8 +15,8 @@ import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.engine.*; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; import org.eclipse.equinox.p2.core.IProvisioningAgent; -import org.eclipse.equinox.p2.engine.PhaseSetFactory; import org.eclipse.equinox.p2.engine.IProfile; +import org.eclipse.equinox.p2.engine.PhaseSetFactory; import org.eclipse.equinox.p2.engine.spi.ProvisioningAction; import org.eclipse.equinox.p2.engine.spi.Touchpoint; import org.eclipse.equinox.p2.metadata.IArtifactKey; @@ -28,6 +28,7 @@ public class Install extends InstallableUnitPhase { final static class BeforeInstallEventAction extends ProvisioningAction { + @Override public IStatus execute(Map<String, Object> parameters) { IProfile profile = (IProfile) parameters.get(PARM_PROFILE); String phaseId = (String) parameters.get(PARM_PHASE_ID); @@ -37,6 +38,7 @@ public class Install extends InstallableUnitPhase { return null; } + @Override public IStatus undo(Map<String, Object> parameters) { Profile profile = (Profile) parameters.get(PARM_PROFILE); String phaseId = (String) parameters.get(PARM_PHASE_ID); @@ -50,6 +52,7 @@ public class Install extends InstallableUnitPhase { final static class AfterInstallEventAction extends ProvisioningAction { + @Override public IStatus execute(Map<String, Object> parameters) { Profile profile = (Profile) parameters.get(PARM_PROFILE); String phaseId = (String) parameters.get(PARM_PHASE_ID); @@ -60,6 +63,7 @@ public class Install extends InstallableUnitPhase { return null; } + @Override public IStatus undo(Map<String, Object> parameters) { IProfile profile = (IProfile) parameters.get(PARM_PROFILE); String phaseId = (String) parameters.get(PARM_PHASE_ID); @@ -74,10 +78,12 @@ public class Install extends InstallableUnitPhase { super(PhaseSetFactory.PHASE_INSTALL, weight); } + @Override protected boolean isApplicable(InstallableUnitOperand op) { return (op.second() != null && !op.second().equals(op.first())); } + @Override protected List<ProvisioningAction> getActions(InstallableUnitOperand currentOperand) { //TODO: monitor.subTask(NLS.bind(Messages.Engine_Installing_IU, unit.getId())); @@ -91,7 +97,7 @@ public class Install extends InstallableUnitPhase { afterAction.setTouchpoint(touchpoint); } - ArrayList<ProvisioningAction> actions = new ArrayList<ProvisioningAction>(); + ArrayList<ProvisioningAction> actions = new ArrayList<>(); actions.add(beforeAction); if (QueryUtil.isFragment(unit)) { @@ -106,10 +112,12 @@ public class Install extends InstallableUnitPhase { return actions; } + @Override protected String getProblemMessage() { return Messages.Phase_Install_Error; } + @Override protected IStatus initializeOperand(IProfile profile, InstallableUnitOperand operand, Map<String, Object> parameters, IProgressMonitor monitor) { IInstallableUnit iu = operand.second(); monitor.subTask(NLS.bind(Messages.Phase_Install_Task, iu.getId())); |