Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2012-12-15 15:30:40 +0000
committerPascal Rapicault2013-01-19 22:13:46 +0000
commit54a9cd05bd5edca233d7e589e3abf74752c643e5 (patch)
tree9c2abfa53c32004a915b3783bcca2c8abb108815 /bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director
parent77ba1dec8f5448479ca50611e3ab8af509939304 (diff)
downloadrt.equinox.p2-54a9cd05bd5edca233d7e589e3abf74752c643e5.tar.gz
rt.equinox.p2-54a9cd05bd5edca233d7e589e3abf74752c643e5.tar.xz
rt.equinox.p2-54a9cd05bd5edca233d7e589e3abf74752c643e5.zip
changes to the director
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director')
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/DirectorComponent.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimpleDirector.java63
2 files changed, 0 insertions, 91 deletions
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/DirectorComponent.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/DirectorComponent.java
deleted file mode 100644
index 08935c47a..000000000
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/DirectorComponent.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009-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
- * Sonatype, Inc. - ongoing development
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.director;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
-import org.eclipse.equinox.p2.core.IProvisioningAgent;
-import org.eclipse.equinox.p2.core.spi.IAgentServiceFactory;
-import org.eclipse.equinox.p2.engine.IEngine;
-
-public class DirectorComponent implements IAgentServiceFactory {
-
- public Object createService(IProvisioningAgent agent) {
- IEngine engine = (IEngine) agent.getService(IEngine.SERVICE_NAME);
- IPlanner planner = (IPlanner) agent.getService(IPlanner.SERVICE_NAME);
- return new SimpleDirector(engine, planner);
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimpleDirector.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimpleDirector.java
deleted file mode 100644
index adf0fd4a6..000000000
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimpleDirector.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * 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
- * Sonatype, Inc. - ongoing development
- ******************************************************************************/
-package org.eclipse.equinox.internal.p2.director;
-
-import java.util.Collection;
-import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.provisional.p2.director.IDirector;
-import org.eclipse.equinox.internal.provisional.p2.director.PlanExecutionHelper;
-import org.eclipse.equinox.p2.engine.*;
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.planner.IPlanner;
-import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
-import org.eclipse.osgi.util.NLS;
-
-public class SimpleDirector implements IDirector {
- static final int PlanWork = 10;
- static final int EngineWork = 100;
- private IEngine engine;
- private IPlanner planner;
-
- public SimpleDirector(IEngine engine, IPlanner planner) {
- if (engine == null)
- throw new IllegalStateException("Provisioning engine is not registered"); //$NON-NLS-1$
- this.engine = engine;
- if (planner == null)
- throw new IllegalStateException("Unable to find provisioning planner"); //$NON-NLS-1$
- this.planner = planner;
- }
-
- public IStatus revert(IProfile currentProfile, IProfile revertProfile, ProvisioningContext context, IProgressMonitor monitor) {
- SubMonitor sub = SubMonitor.convert(monitor, Messages.Director_Task_Updating, PlanWork + EngineWork);
- try {
- IProvisioningPlan plan = planner.getDiffPlan(currentProfile, revertProfile, sub.newChild(PlanWork));
- return PlanExecutionHelper.executePlan(plan, engine, context, sub.newChild(EngineWork));
- } finally {
- sub.done();
- }
- }
-
- public IStatus provision(IProfileChangeRequest request, ProvisioningContext context, IProgressMonitor monitor) {
- String taskName = NLS.bind(Messages.Director_Task_Installing, ((ProfileChangeRequest) request).getProfile().getProperty(IProfile.PROP_INSTALL_FOLDER));
- SubMonitor sub = SubMonitor.convert(monitor, taskName, PlanWork + EngineWork);
- try {
- Collection<IInstallableUnit> installRoots = request.getAdditions();
- // mark the roots as such
- for (IInstallableUnit root : installRoots) {
- request.setInstallableUnitProfileProperty(root, IProfile.PROP_PROFILE_ROOT_IU, Boolean.toString(true));
- }
- IProvisioningPlan plan = planner.getProvisioningPlan(request, context, sub.newChild(PlanWork));
- return PlanExecutionHelper.executePlan(plan, engine, context, sub.newChild(EngineWork));
- } finally {
- sub.done();
- }
- }
-}

Back to the top