Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hallgren2010-02-05 17:07:01 -0500
committerThomas Hallgren2010-02-05 17:07:01 -0500
commit9faaed06625f31f3e4f26f65c3cffe4e947604fd (patch)
tree162a1267d4429ff85e188de84970455c138abfa6 /bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse
parente640f35a91169ce4ad67d674ba7b150b42450478 (diff)
downloadrt.equinox.p2-9faaed06625f31f3e4f26f65c3cffe4e947604fd.tar.gz
rt.equinox.p2-9faaed06625f31f3e4f26f65c3cffe4e947604fd.tar.xz
rt.equinox.p2-9faaed06625f31f3e4f26f65c3cffe4e947604fd.zip
299987 : Removal of p2 services in favor of always using an agent.
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ValidateTask.java4
3 files changed, 16 insertions, 8 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
index 083755166..a8d947303 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
@@ -18,6 +18,9 @@ import org.apache.tools.ant.*;
import org.apache.tools.ant.types.FileSet;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.URIUtil;
+import org.eclipse.equinox.internal.p2.artifact.repository.Activator;
+import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.internal.repository.tools.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.query.IQuery;
@@ -99,6 +102,16 @@ public abstract class AbstractRepositoryTask extends Task {
}
/*
+ * Return the provisioning agent. Throw an exception if it cannot be obtained.
+ */
+ public static IProvisioningAgent getAgent() throws BuildException {
+ IProvisioningAgent agent = (IProvisioningAgent) ServiceHelper.getService(Activator.getContext(), IProvisioningAgent.SERVICE_NAME);
+ if (agent == null)
+ throw new BuildException(Messages.no_provisioning_agent);
+ return agent;
+ }
+
+ /*
* Add source repositories to mirror from
*/
public void addConfiguredSource(RepositoryList sourceList) {
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java
index d2a4a481a..cac2fd13f 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.internal.repository.tools.tasks;
-import org.eclipse.equinox.p2.core.ProvisionException;
-
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
@@ -19,9 +17,8 @@ import java.util.Map;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.p2.artifact.repository.Activator;
import org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository;
-import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
+import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
@@ -42,7 +39,7 @@ public class CreateCompositeArtifactRepositoryTask extends Task {
*/
public void execute() {
validate();
- IArtifactRepositoryManager manager = (IArtifactRepositoryManager) ServiceHelper.getService(Activator.getContext(), IArtifactRepositoryManager.SERVICE_NAME);
+ IArtifactRepositoryManager manager = (IArtifactRepositoryManager) AbstractRepositoryTask.getAgent().getService(IArtifactRepositoryManager.SERVICE_NAME);
if (manager == null)
throw new BuildException("Unable to aquire artifact repository manager service.");
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ValidateTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ValidateTask.java
index 5b3188218..21407c52a 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ValidateTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ValidateTask.java
@@ -13,8 +13,6 @@ package org.eclipse.equinox.p2.internal.repository.tools.tasks;
import java.net.URI;
import org.apache.tools.ant.BuildException;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.equinox.internal.p2.artifact.repository.Activator;
-import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.internal.repository.tools.ArtifactRepositoryValidator;
import org.eclipse.equinox.p2.internal.repository.tools.Messages;
@@ -32,7 +30,7 @@ public class ValidateTask extends AbstractRepositoryTask {
* @see org.apache.tools.ant.Task#execute()
*/
public void execute() {
- IArtifactRepositoryManager manager = (IArtifactRepositoryManager) ServiceHelper.getService(Activator.getContext(), IArtifactRepositoryManager.SERVICE_NAME);
+ IArtifactRepositoryManager manager = (IArtifactRepositoryManager) getAgent().getService(IArtifactRepositoryManager.SERVICE_NAME);
if (manager == null)
throw new BuildException(Messages.no_artifactRepo_manager);

Back to the top