Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2010-03-05 12:06:29 -0500
committerSimon Kaegi2010-03-05 12:06:29 -0500
commit11310103f4665624bdc756b870e2abfb6e0d44a5 (patch)
tree26dd2f6e4dae497e907121a5e3ad90de15e46684
parentf0a701f74d7b17cc84d1d23836f6db4d60ec37cf (diff)
downloadrt.equinox.p2-11310103f4665624bdc756b870e2abfb6e0d44a5.tar.gz
rt.equinox.p2-11310103f4665624bdc756b870e2abfb6e0d44a5.tar.xz
rt.equinox.p2-11310103f4665624bdc756b870e2abfb6e0d44a5.zip
Bug 304280 - [api] PhaseSet is still API
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/PlanExecutionHelper.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Engine.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SizingPhaseSet.java (renamed from bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/SizingPhaseSet.java)20
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/CheckTrust.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Collect.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Configure.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Install.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Property.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Unconfigure.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Uninstall.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ISizingPhaseSet.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/PhaseSetFactory.java (renamed from bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/DefaultPhaseSet.java)34
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProfileModificationJob.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/AbstractProvisioningUITest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java40
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/PhaseSetTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstance.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstanceForCohostedMode.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java2
21 files changed, 105 insertions, 78 deletions
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/PlanExecutionHelper.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/PlanExecutionHelper.java
index 568860ce2..daab98c28 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/PlanExecutionHelper.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/PlanExecutionHelper.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.provisional.p2.director;
+import org.eclipse.equinox.p2.engine.PhaseSetFactory;
+
import java.io.IOException;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
@@ -20,7 +22,7 @@ import org.eclipse.equinox.p2.engine.*;
public class PlanExecutionHelper {
public static IStatus executePlan(IProvisioningPlan result, IEngine engine, ProvisioningContext context, IProgressMonitor progress) {
- return executePlan(result, engine, new DefaultPhaseSet(), context, progress);
+ return executePlan(result, engine, PhaseSetFactory.createDefaultPhaseSet(), context, progress);
}
public static IStatus executePlan(IProvisioningPlan result, IEngine engine, IPhaseSet phaseSet, ProvisioningContext context, IProgressMonitor progress) {
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Engine.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Engine.java
index f1f4e3457..e0e393e37 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Engine.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Engine.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.engine;
+import org.eclipse.equinox.p2.engine.PhaseSetFactory;
+
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
@@ -45,7 +47,7 @@ public class Engine implements IEngine {
}
public IStatus perform(IProvisioningPlan plan, IProgressMonitor monitor) {
- return perform(plan, new DefaultPhaseSet(), monitor);
+ return perform(plan, PhaseSetFactory.createDefaultPhaseSet(), monitor);
}
public IStatus perform(IProfile iprofile, IPhaseSet phases, Operand[] operands, ProvisioningContext context, IProgressMonitor monitor) {
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/SizingPhaseSet.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SizingPhaseSet.java
index 5064ab5d4..b82a208b3 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/SizingPhaseSet.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SizingPhaseSet.java
@@ -8,19 +8,13 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-/**
- *
- */
-package org.eclipse.equinox.p2.engine;
-import org.eclipse.equinox.internal.p2.engine.Phase;
-import org.eclipse.equinox.internal.p2.engine.PhaseSet;
+package org.eclipse.equinox.internal.p2.engine;
+
import org.eclipse.equinox.internal.p2.engine.phases.Sizing;
+import org.eclipse.equinox.p2.engine.ISizingPhaseSet;
-/**
- * @since 2.0
- */
-public class SizingPhaseSet extends PhaseSet {
+public class SizingPhaseSet extends PhaseSet implements ISizingPhaseSet {
private static Sizing sizing;
@@ -28,10 +22,16 @@ public class SizingPhaseSet extends PhaseSet {
super(new Phase[] {sizing = new Sizing(100)});
}
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.p2.engine.ISizingPhaseSet#getDiskSize()
+ */
public long getDiskSize() {
return sizing.getDiskSize();
}
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.p2.engine.ISizingPhaseSet#getDownloadSize()
+ */
public long getDownloadSize() {
return sizing.getDownloadSize();
}
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/CheckTrust.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/CheckTrust.java
index 6b18a1550..513c0f10d 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/CheckTrust.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/CheckTrust.java
@@ -17,7 +17,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.engine.InstallableUnitOperand;
import org.eclipse.equinox.internal.p2.engine.InstallableUnitPhase;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
-import org.eclipse.equinox.p2.engine.DefaultPhaseSet;
+import org.eclipse.equinox.p2.engine.PhaseSetFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
@@ -32,7 +32,7 @@ public class CheckTrust extends InstallableUnitPhase {
public static final String PARM_ARTIFACT_FILES = "artifactFiles"; //$NON-NLS-1$
public CheckTrust(int weight) {
- super(DefaultPhaseSet.PHASE_CHECK_TRUST, weight);
+ super(PhaseSetFactory.PHASE_CHECK_TRUST, weight);
}
protected boolean isApplicable(InstallableUnitOperand op) {
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Collect.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Collect.java
index aa43a00a3..6a32e8770 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Collect.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Collect.java
@@ -31,7 +31,7 @@ public class Collect extends InstallableUnitPhase {
public static final String NO_ARTIFACT_REPOSITORIES_AVAILABLE = "noArtifactRepositoriesAvailable"; //$NON-NLS-1$
public Collect(int weight) {
- super(DefaultPhaseSet.PHASE_COLLECT, weight);
+ super(PhaseSetFactory.PHASE_COLLECT, weight);
//re-balance work since postPerform will do almost all the time-consuming work
prePerformWork = 0;
mainPerformWork = 100;
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Configure.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Configure.java
index 1acf55f8c..165f3afcb 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Configure.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Configure.java
@@ -15,7 +15,7 @@ import org.eclipse.equinox.p2.query.QueryUtil;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.engine.*;
-import org.eclipse.equinox.p2.engine.DefaultPhaseSet;
+import org.eclipse.equinox.p2.engine.PhaseSetFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
@@ -25,7 +25,7 @@ import org.eclipse.osgi.util.NLS;
public class Configure extends InstallableUnitPhase {
public Configure(int weight) {
- super(DefaultPhaseSet.PHASE_CONFIGURE, weight);
+ super(PhaseSetFactory.PHASE_CONFIGURE, weight);
}
protected boolean isApplicable(InstallableUnitOperand op) {
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 ae9eff003..9fe045ef0 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
@@ -15,7 +15,7 @@ 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.DefaultPhaseSet;
+import org.eclipse.equinox.p2.engine.PhaseSetFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.engine.spi.Touchpoint;
@@ -71,7 +71,7 @@ public class Install extends InstallableUnitPhase {
}
public Install(int weight) {
- super(DefaultPhaseSet.PHASE_INSTALL, weight);
+ super(PhaseSetFactory.PHASE_INSTALL, weight);
}
protected boolean isApplicable(InstallableUnitOperand op) {
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Property.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Property.java
index c603497ab..ba69b2cf3 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Property.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Property.java
@@ -13,7 +13,7 @@ package org.eclipse.equinox.internal.p2.engine.phases;
import java.util.*;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.engine.*;
-import org.eclipse.equinox.p2.engine.DefaultPhaseSet;
+import org.eclipse.equinox.p2.engine.PhaseSetFactory;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
@@ -135,7 +135,7 @@ public class Property extends Phase {
}
public Property(int weight) {
- super(DefaultPhaseSet.PHASE_PROPERTY, weight);
+ super(PhaseSetFactory.PHASE_PROPERTY, weight);
}
protected List<ProvisioningAction> getActions(Operand operand) {
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Unconfigure.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Unconfigure.java
index 1e48ccdf5..d6181ab8d 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Unconfigure.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Unconfigure.java
@@ -15,7 +15,7 @@ import org.eclipse.equinox.p2.query.QueryUtil;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.engine.*;
-import org.eclipse.equinox.p2.engine.DefaultPhaseSet;
+import org.eclipse.equinox.p2.engine.PhaseSetFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
@@ -24,7 +24,7 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit;
public class Unconfigure extends InstallableUnitPhase {
public Unconfigure(int weight, boolean forced) {
- super(DefaultPhaseSet.PHASE_UNCONFIGURE, weight, forced);
+ super(PhaseSetFactory.PHASE_UNCONFIGURE, weight, forced);
}
public Unconfigure(int weight) {
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Uninstall.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Uninstall.java
index 5a7690638..f0b7adc80 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Uninstall.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Uninstall.java
@@ -15,7 +15,7 @@ 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.DefaultPhaseSet;
+import org.eclipse.equinox.p2.engine.PhaseSetFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.engine.spi.Touchpoint;
@@ -68,7 +68,7 @@ public class Uninstall extends InstallableUnitPhase {
}
public Uninstall(int weight, boolean forced) {
- super(DefaultPhaseSet.PHASE_UNINSTALL, weight, forced);
+ super(PhaseSetFactory.PHASE_UNINSTALL, weight, forced);
}
public Uninstall(int weight) {
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ISizingPhaseSet.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ISizingPhaseSet.java
new file mode 100644
index 000000000..ca8af918d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ISizingPhaseSet.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.engine;
+
+/**
+ * @since 2.0
+ */
+public interface ISizingPhaseSet extends IPhaseSet {
+
+ public long getDiskSize();
+
+ public long getDownloadSize();
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/DefaultPhaseSet.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/PhaseSetFactory.java
index e985b1317..1e5bcda21 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/DefaultPhaseSet.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/PhaseSetFactory.java
@@ -17,7 +17,7 @@ import org.eclipse.equinox.internal.p2.engine.phases.*;
/**
* @since 2.0
*/
-public class DefaultPhaseSet extends PhaseSet {
+public class PhaseSetFactory {
private static final boolean forcedUninstall = Boolean.valueOf(EngineActivator.getContext().getProperty("org.eclipse.equinox.p2.engine.forcedUninstall")).booleanValue(); //$NON-NLS-1$
@@ -67,29 +67,21 @@ public class DefaultPhaseSet extends PhaseSet {
private static final List<String> ALL_PHASES_LIST = Arrays.asList(new String[] {PHASE_COLLECT, PHASE_UNCONFIGURE, PHASE_UNINSTALL, PHASE_PROPERTY, PHASE_CHECK_TRUST, PHASE_INSTALL, PHASE_CONFIGURE});
- public DefaultPhaseSet() {
- this(new Phase[] {new Collect(100), new CheckTrust(10), new Unconfigure(10, forcedUninstall), new Uninstall(50, forcedUninstall), new Property(1), new Install(50), new Configure(10)});
- }
-
- private DefaultPhaseSet(Phase[] phases) {
- super(phases);
- }
-
/**
* Creates a default phase set that covers all the provisioning operations.
* Phases can be specified for exclusion.
*
* @param exclude - A set of bit options that specify the phases to exclude.
- * See {@link DefaultPhaseSet} for possible options
+ * See {@link PhaseSetFactory} for possible options
* @return the {@link PhaseSet}
*/
- public static final IPhaseSet createExcluding(String[] exclude) {
+ public static final IPhaseSet createDefaultPhaseSetExcluding(String[] exclude) {
if (exclude == null || exclude.length == 0)
- return new DefaultPhaseSet();
+ return createDefaultPhaseSet();
List<String> excludeList = Arrays.asList(exclude);
List<String> includeList = new ArrayList<String>(ALL_PHASES_LIST);
includeList.removeAll(excludeList);
- return createIncluding(includeList.toArray(new String[includeList.size()]));
+ return createPhaseSetIncluding(includeList.toArray(new String[includeList.size()]));
}
/**
@@ -97,12 +89,12 @@ public class DefaultPhaseSet extends PhaseSet {
* Phases can be specified for inclusion.
*
* @param include - A set of bit options that specify the phases to include.
- * See {@link DefaultPhaseSet} for possible options
+ * See {@link PhaseSetFactory} for possible options
* @return the {@link PhaseSet}
*/
- public static final IPhaseSet createIncluding(String[] include) {
+ public static final IPhaseSet createPhaseSetIncluding(String[] include) {
if (include == null || include.length == 0)
- return new DefaultPhaseSet(new Phase[0]);
+ return new PhaseSet(new Phase[0]);
List<String> includeList = Arrays.asList(include);
ArrayList<Phase> phases = new ArrayList<Phase>();
if (includeList.contains(PHASE_COLLECT))
@@ -119,6 +111,14 @@ public class DefaultPhaseSet extends PhaseSet {
phases.add(new Install(50));
if (includeList.contains(PHASE_CONFIGURE))
phases.add(new Configure(10));
- return new DefaultPhaseSet(phases.toArray(new Phase[phases.size()]));
+ return new PhaseSet(phases.toArray(new Phase[phases.size()]));
+ }
+
+ public static IPhaseSet createDefaultPhaseSet() {
+ return createPhaseSetIncluding(ALL_PHASES_LIST.toArray(new String[ALL_PHASES_LIST.size()]));
+ }
+
+ public static ISizingPhaseSet createSizingPhaseSet() {
+ return new SizingPhaseSet();
}
}
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProfileModificationJob.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProfileModificationJob.java
index d41511c89..eeeb1de04 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProfileModificationJob.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProfileModificationJob.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.operations;
+import org.eclipse.equinox.p2.engine.PhaseSetFactory;
+
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.p2.engine.*;
@@ -23,7 +25,7 @@ public class ProfileModificationJob extends ProvisioningJob implements IProfileC
IProvisioningPlan plan;
String profileId;
- IPhaseSet phaseSet = new DefaultPhaseSet();
+ IPhaseSet phaseSet = PhaseSetFactory.createDefaultPhaseSet();
ProvisioningContext provisioningContext;
int restartPolicy = ProvisioningJob.RESTART_OR_APPLY;
private String taskName;
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java
index f98e01563..fe15d96cc 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java
@@ -167,14 +167,14 @@ public class ProvisioningSession {
long installPlanSize = 0;
SubMonitor mon = SubMonitor.convert(monitor, 300);
if (plan.getInstallerPlan() != null) {
- SizingPhaseSet sizingPhaseSet = new SizingPhaseSet();
+ ISizingPhaseSet sizingPhaseSet = PhaseSetFactory.createSizingPhaseSet();
IStatus status = getEngine().perform(plan.getInstallerPlan(), sizingPhaseSet, mon.newChild(100));
if (status.isOK())
installPlanSize = sizingPhaseSet.getDiskSize();
} else {
mon.worked(100);
}
- SizingPhaseSet sizingPhaseSet = new SizingPhaseSet();
+ ISizingPhaseSet sizingPhaseSet = PhaseSetFactory.createSizingPhaseSet();
IStatus status = getEngine().perform(plan, sizingPhaseSet, mon.newChild(200));
if (status.isOK())
return installPlanSize + sizingPhaseSet.getDiskSize();
@@ -197,7 +197,7 @@ public class ProvisioningSession {
public IStatus performProvisioningPlan(IProvisioningPlan plan, IPhaseSet phaseSet, ProvisioningContext context, IProgressMonitor monitor) {
IPhaseSet set;
if (phaseSet == null)
- set = new DefaultPhaseSet();
+ set = PhaseSetFactory.createDefaultPhaseSet();
else
set = phaseSet;
@@ -211,7 +211,7 @@ public class ProvisioningSession {
IProfile profile = plan.getProfile();
if (plan.getInstallerPlan() != null) {
- if (set instanceof DefaultPhaseSet) {
+ if (set instanceof PhaseSetFactory) {
// If the phase set calls for download and install, then we want to download everything atomically before
// applying the install plan. This way, we can be sure to install the install handler only if we know
// we will be able to get everything else.
@@ -219,7 +219,7 @@ public class ProvisioningSession {
downloadRequest.setAbsoluteMode(true);
downloadRequest.addAll(QueryUtil.compoundQueryable(plan.getAdditions(), plan.getInstallerPlan().getAdditions()).query(QueryUtil.createIUAnyQuery(), null).toUnmodifiableSet());
- IPhaseSet download = DefaultPhaseSet.createIncluding(new String[] {DefaultPhaseSet.PHASE_COLLECT});
+ IPhaseSet download = PhaseSetFactory.createPhaseSetIncluding(new String[] {PhaseSetFactory.PHASE_COLLECT});
IProvisioningPlan downloadPlan = getPlanner().getProvisioningPlan(downloadRequest, context, mon.newChild(100));
IStatus downloadStatus = getEngine().perform(downloadPlan, download, mon.newChild(300));
if (!downloadStatus.isOK()) {
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
index 074d30fa4..1802d344c 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
@@ -453,13 +453,13 @@ public class ProfileSynchronizer {
ProfileChangeRequest addPropertyRequest = new ProfileChangeRequest(profile);
addPropertyRequest.setProfileProperty(key, value);
IProvisioningPlan plan = planner.getProvisioningPlan(addPropertyRequest, provisioningContext, monitor);
- IPhaseSet phaseSet = DefaultPhaseSet.createExcluding(new String[] {DefaultPhaseSet.PHASE_COLLECT, DefaultPhaseSet.PHASE_CHECK_TRUST});
+ IPhaseSet phaseSet = PhaseSetFactory.createDefaultPhaseSetExcluding(new String[] {PhaseSetFactory.PHASE_COLLECT, PhaseSetFactory.PHASE_CHECK_TRUST});
return engine.perform(plan, phaseSet, monitor);
}
private IStatus executePlan(IProvisioningPlan plan, ProvisioningContext provisioningContext, IProgressMonitor monitor) {
IEngine engine = (IEngine) agent.getService(IEngine.SERVICE_NAME);
- IPhaseSet phaseSet = DefaultPhaseSet.createExcluding(new String[] {DefaultPhaseSet.PHASE_COLLECT, DefaultPhaseSet.PHASE_CHECK_TRUST});
+ IPhaseSet phaseSet = PhaseSetFactory.createDefaultPhaseSetExcluding(new String[] {PhaseSetFactory.PHASE_COLLECT, PhaseSetFactory.PHASE_CHECK_TRUST});
if (plan.getInstallerPlan() != null) {
IStatus installerPlanStatus = engine.perform(plan.getInstallerPlan(), phaseSet, monitor);
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/AbstractProvisioningUITest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/AbstractProvisioningUITest.java
index d48948f0c..0cdf00266 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/AbstractProvisioningUITest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/AbstractProvisioningUITest.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.ui;
+import org.eclipse.equinox.p2.engine.PhaseSetFactory;
+
import org.eclipse.equinox.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription;
@@ -144,7 +146,7 @@ public abstract class AbstractProvisioningUITest extends AbstractProvisioningTes
IProvisioningPlan plan = getSession().getPlanner().getProvisioningPlan(req, new ProvisioningContext(new URI[] {}), getMonitor());
if (plan.getStatus().getSeverity() == IStatus.ERROR || plan.getStatus().getSeverity() == IStatus.CANCEL)
return plan.getStatus();
- return getSession().performProvisioningPlan(plan, new DefaultPhaseSet(), new ProvisioningContext(), getMonitor());
+ return getSession().performProvisioningPlan(plan, PhaseSetFactory.createDefaultPhaseSet(), new ProvisioningContext(), getMonitor());
}
protected IInstallableUnit createNamedIU(String id, String name, Version version, boolean isCategory) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java
index 070c8468b..25d0fa37d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java
@@ -10,12 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.engine;
-import org.eclipse.equinox.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitFragmentDescription;
-
-import org.eclipse.equinox.p2.query.QueryUtil;
-
import java.io.File;
import java.util.*;
import org.eclipse.core.runtime.*;
@@ -202,23 +198,23 @@ public class EngineTest extends AbstractProvisioningTest {
*/
public void testCreatePhaseSetExcluding() {
//null argument
- IPhaseSet set = DefaultPhaseSet.createExcluding(null);
+ IPhaseSet set = PhaseSetFactory.createDefaultPhaseSetExcluding(null);
assertEquals("1.0", 7, set.getPhaseIds().length);
//empty argument
- set = DefaultPhaseSet.createExcluding(new String[0]);
+ set = PhaseSetFactory.createDefaultPhaseSetExcluding(new String[0]);
assertEquals("2.0", 7, set.getPhaseIds().length);
//bogus argument
- set = DefaultPhaseSet.createExcluding(new String[] {"blort"});
+ set = PhaseSetFactory.createDefaultPhaseSetExcluding(new String[] {"blort"});
assertEquals("3.0", 7, set.getPhaseIds().length);
//valid argument
- set = DefaultPhaseSet.createExcluding(new String[] {DefaultPhaseSet.PHASE_CHECK_TRUST});
+ set = PhaseSetFactory.createDefaultPhaseSetExcluding(new String[] {PhaseSetFactory.PHASE_CHECK_TRUST});
final String[] phases = set.getPhaseIds();
assertEquals("4.0", 6, phases.length);
for (int i = 0; i < phases.length; i++)
- if (phases[i].equals(DefaultPhaseSet.PHASE_CHECK_TRUST))
+ if (phases[i].equals(PhaseSetFactory.PHASE_CHECK_TRUST))
fail("4.1." + i);
}
@@ -228,31 +224,31 @@ public class EngineTest extends AbstractProvisioningTest {
*/
public void testCreatePhaseSetIncluding() {
//null argument
- IPhaseSet set = DefaultPhaseSet.createIncluding(null);
+ IPhaseSet set = PhaseSetFactory.createPhaseSetIncluding(null);
assertNotNull("1.0", set);
assertEquals("1.1", 0, set.getPhaseIds().length);
//expected
//empty argument
- set = DefaultPhaseSet.createIncluding(new String[0]);
+ set = PhaseSetFactory.createPhaseSetIncluding(new String[0]);
assertNotNull("2.0", set);
assertEquals("2.1", 0, set.getPhaseIds().length);
//unknown argument
- set = DefaultPhaseSet.createIncluding(new String[] {"blort", "not a phase", "bad input"});
+ set = PhaseSetFactory.createPhaseSetIncluding(new String[] {"blort", "not a phase", "bad input"});
assertNotNull("3.0", set);
assertEquals("3.1", 0, set.getPhaseIds().length);
//one valid phase
- set = DefaultPhaseSet.createIncluding(new String[] {DefaultPhaseSet.PHASE_COLLECT});
+ set = PhaseSetFactory.createPhaseSetIncluding(new String[] {PhaseSetFactory.PHASE_COLLECT});
assertNotNull("4.0", set);
assertEquals("4.1", 1, set.getPhaseIds().length);
- assertEquals("4.2", DefaultPhaseSet.PHASE_COLLECT, set.getPhaseIds()[0]);
+ assertEquals("4.2", PhaseSetFactory.PHASE_COLLECT, set.getPhaseIds()[0]);
//one valid phase and one bogus
- set = DefaultPhaseSet.createIncluding(new String[] {DefaultPhaseSet.PHASE_COLLECT, "bogus"});
+ set = PhaseSetFactory.createPhaseSetIncluding(new String[] {PhaseSetFactory.PHASE_COLLECT, "bogus"});
assertNotNull("4.0", set);
assertEquals("4.1", 1, set.getPhaseIds().length);
- assertEquals("4.2", DefaultPhaseSet.PHASE_COLLECT, set.getPhaseIds()[0]);
+ assertEquals("4.2", PhaseSetFactory.PHASE_COLLECT, set.getPhaseIds()[0]);
}
@@ -347,7 +343,7 @@ public class EngineTest extends AbstractProvisioningTest {
// InstallableUnitOperand[] operands = new InstallableUnitOperand[] {new InstallableUnitOperand(createResolvedIU(doomed), null)};
// engine.perform(engine.createPlan(profile, null), new NullProgressMonitor());
// }
- // PhaseSet phaseSet = new DefaultPhaseSet();
+ // PhaseSet phaseSet = new PhaseSetFactory();
// InstallableUnitOperand[] operands = new InstallableUnitOperand[] {new InstallableUnitOperand(null, createOSGiIU())};
// IStatus result = ((Engine) engine).validate(profile, phaseSet, operands, null, new NullProgressMonitor());
// assertTrue(result.isOK());
@@ -433,7 +429,7 @@ public class EngineTest extends AbstractProvisioningTest {
// Map properties = new HashMap();
// properties.put(IProfile.PROP_INSTALL_FOLDER, testProvisioning.getAbsolutePath());
// IProfile profile = createProfile("testPerformRollback", properties);
- // PhaseSet phaseSet = new DefaultPhaseSet();
+ // PhaseSet phaseSet = new PhaseSetFactory();
//
// Iterator ius = getInstallableUnits(profile);
// assertFalse(ius.hasNext());
@@ -531,7 +527,7 @@ public class EngineTest extends AbstractProvisioningTest {
IProfile profile = createProfile("testPerformForcedUninstallWithBadUninstallIUActionThrowsException", properties);
// forcedUninstall is false by default
- PhaseSet phaseSet = new DefaultPhaseSet();
+ IPhaseSet phaseSet = PhaseSetFactory.createDefaultPhaseSet();
Iterator ius = getInstallableUnits(profile);
assertFalse(ius.hasNext());
@@ -551,7 +547,7 @@ public class EngineTest extends AbstractProvisioningTest {
ius = getInstallableUnits(profile);
assertTrue(ius.hasNext());
- // this simulates a DefaultPhaseSet with forcedUninstall set
+ // this simulates a PhaseSetFactory with forcedUninstall set
phaseSet = new TestPhaseSet(true);
plan = engine.createPlan(profile, null);
plan.removeInstallableUnit(badUninstallIU);
@@ -587,7 +583,7 @@ public class EngineTest extends AbstractProvisioningTest {
ius = getInstallableUnits(profile);
assertTrue(ius.hasNext());
- // this simulates a DefaultPhaseSet with forcedUninstall set
+ // this simulates a PhaseSetFactory with forcedUninstall set
IPhaseSet phaseSet = new TestPhaseSet(true);
plan = engine.createPlan(profile, null);
plan.removeInstallableUnit(badUninstallIU);
@@ -620,7 +616,7 @@ public class EngineTest extends AbstractProvisioningTest {
}
private IInstallableUnit createOSGiIU(String version) {
- InstallableUnitDescription description = new MetadataFactory.InstallableUnitDescription();
+ MetadataFactory.InstallableUnitDescription description = new MetadataFactory.InstallableUnitDescription();
description.setId("org.eclipse.osgi");
description.setVersion(Version.create(version));
description.setTouchpointType(AbstractProvisioningTest.TOUCHPOINT_OSGI);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/PhaseSetTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/PhaseSetTest.java
index 6ff9d9562..2138f7e72 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/PhaseSetTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/PhaseSetTest.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.engine;
+import org.eclipse.equinox.p2.engine.PhaseSetFactory;
+
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.engine.*;
@@ -40,8 +42,8 @@ public class PhaseSetTest extends AbstractProvisioningTest {
}
public void testNoTrustCheck() {
- IPhaseSet set1 = new DefaultPhaseSet();
- IPhaseSet set2 = DefaultPhaseSet.createExcluding(new String[] {DefaultPhaseSet.PHASE_CHECK_TRUST});
+ IPhaseSet set1 = PhaseSetFactory.createDefaultPhaseSet();
+ IPhaseSet set2 = PhaseSetFactory.createDefaultPhaseSetExcluding(new String[] {PhaseSetFactory.PHASE_CHECK_TRUST});
assertTrue("1.0", !set1.equals(set2));
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstance.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstance.java
index 11f113744..a3807b904 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstance.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstance.java
@@ -283,7 +283,7 @@ public class AgentPlanTestInExternalInstance extends AbstractProvisioningTest {
ProfileChangeRequest request3 = new ProfileChangeRequest(getProfile("installation"));
request3.removeInstallableUnits(new IInstallableUnit[] {a111});
IProvisioningPlan plan3 = planner.getProvisioningPlan(request3, ctx, new NullProgressMonitor());
- // assertOK("install actions", engine.perform(getProfile("agent"), new DefaultPhaseSet(), plan3.getInstallerPlan().getOperands(), null, null));
+ // assertOK("install actions", engine.perform(getProfile("agent"), new PhaseSetFactory(), plan3.getInstallerPlan().getOperands(), null, null));
// assertProfileContainsAll("Checking profile after install of actions", getProfile("agent"), new IInstallableUnit[] {act1b}); //At this point there is not
assertOK("install A", engine.perform(plan3, null));
assertProfileContainsAll("Checking profile after install of actions", getProfile("installation"), new IInstallableUnit[] {c, b});
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstanceForCohostedMode.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstanceForCohostedMode.java
index 8989da8b0..35ec11f78 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstanceForCohostedMode.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstanceForCohostedMode.java
@@ -283,7 +283,7 @@ public class AgentPlanTestInExternalInstanceForCohostedMode extends AbstractProv
ProfileChangeRequest request3 = new ProfileChangeRequest(getProfile("installation"));
request3.removeInstallableUnits(new IInstallableUnit[] {a111});
IProvisioningPlan plan3 = planner.getProvisioningPlan(request3, ctx, new NullProgressMonitor());
- // assertOK("install actions", engine.perform(getProfile("agent"), new DefaultPhaseSet(), plan3.getInstallerPlan().getOperands(), null, null));
+ // assertOK("install actions", engine.perform(getProfile("agent"), new PhaseSetFactory(), plan3.getInstallerPlan().getOperands(), null, null));
// assertProfileContainsAll("Checking profile after install of actions", getProfile("agent"), new IInstallableUnit[] {act1b}); //At this point there is not
assertOK("install A", engine.perform(plan3, null));
assertProfileContainsAll("Checking profile after install of actions", getProfile("installation"), new IInstallableUnit[] {c, b, act2});
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java
index c205f8b0d..3c5c01b79 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java
@@ -113,7 +113,7 @@ public class AutomaticUpdater implements IUpdateListener {
if (download) {
ProfileModificationJob job = new ProfileModificationJob(AutomaticUpdateMessages.AutomaticUpdater_AutomaticDownloadOperationName, getSession(), event.getProfileId(), operation.getProvisioningPlan(), new ProvisioningContext());
- job.setPhaseSet(DefaultPhaseSet.createIncluding(new String[] {DefaultPhaseSet.PHASE_COLLECT}));
+ job.setPhaseSet(PhaseSetFactory.createPhaseSetIncluding(new String[] {PhaseSetFactory.PHASE_COLLECT}));
job.setUser(false);
job.setSystem(true);
job.addJobChangeListener(new JobChangeAdapter() {

Back to the top