From f19abed12ad5dbed3a6d97d0eb7fa71ba236d513 Mon Sep 17 00:00:00 2001 From: Pascal Rapicault Date: Wed, 12 May 2010 16:28:05 +0000 Subject: Bug 274272 - [repository] Cache artifact repository index --- bundles/org.eclipse.equinox.p2.repository/.project | 5 ++++ .../META-INF/MANIFEST.MF | 1 + .../OSGI-INF/cacheManager.xml | 8 +++++++ .../build.properties | 19 ++++----------- .../internal/p2/repository/CacheManager.java | 4 +--- .../p2/repository/CacheManagerComponent.java | 27 ++++++++++++++++++++++ .../equinox/internal/p2/repository/Messages.java | 5 ++++ .../internal/p2/repository/messages.properties | 7 +++--- 8 files changed, 56 insertions(+), 20 deletions(-) create mode 100644 bundles/org.eclipse.equinox.p2.repository/OSGI-INF/cacheManager.xml create mode 100644 bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManagerComponent.java (limited to 'bundles/org.eclipse.equinox.p2.repository') diff --git a/bundles/org.eclipse.equinox.p2.repository/.project b/bundles/org.eclipse.equinox.p2.repository/.project index 120c0420d..ee1e6707b 100644 --- a/bundles/org.eclipse.equinox.p2.repository/.project +++ b/bundles/org.eclipse.equinox.p2.repository/.project @@ -25,6 +25,11 @@ + + org.eclipse.pde.ds.core.builder + + + org.eclipse.pde.PluginNature diff --git a/bundles/org.eclipse.equinox.p2.repository/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.repository/META-INF/MANIFEST.MF index 8c9fb2323..63428ef07 100644 --- a/bundles/org.eclipse.equinox.p2.repository/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.repository/META-INF/MANIFEST.MF @@ -55,3 +55,4 @@ Import-Package: javax.xml.parsers, org.osgi.util.tracker;version="1.3.0", org.xml.sax, org.xml.sax.helpers +Service-Component: OSGI-INF/cacheManager.xml diff --git a/bundles/org.eclipse.equinox.p2.repository/OSGI-INF/cacheManager.xml b/bundles/org.eclipse.equinox.p2.repository/OSGI-INF/cacheManager.xml new file mode 100644 index 000000000..d04c8dfb1 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.repository/OSGI-INF/cacheManager.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/bundles/org.eclipse.equinox.p2.repository/build.properties b/bundles/org.eclipse.equinox.p2.repository/build.properties index 7ac06b41b..82222b857 100644 --- a/bundles/org.eclipse.equinox.p2.repository/build.properties +++ b/bundles/org.eclipse.equinox.p2.repository/build.properties @@ -1,19 +1,10 @@ -############################################################################### -# Copyright (c) 2005, 2009 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 -############################################################################### -source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ about.html,\ - plugin.properties + plugin.properties,\ + OSGI-INF/cacheManager.xml src.includes = about.html -javacTarget=jsr14 -javacSource=1.5 +javacSource = 1.5 +javacTarget = jsr14 +source.. = src/ diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java index 8bf33c346..e2fe061ce 100644 --- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java +++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java @@ -10,7 +10,7 @@ * Cloudsmith Inc - additional implementation * Sonatype Inc - additional implementation *******************************************************************************/ -package org.eclipse.equinox.internal.p2.metadata.repository; +package org.eclipse.equinox.internal.p2.repository; import java.io.*; import java.net.URI; @@ -19,8 +19,6 @@ import java.util.HashSet; import org.eclipse.core.runtime.*; import org.eclipse.ecf.filetransfer.UserCancelledException; import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; -import org.eclipse.equinox.internal.p2.repository.*; -import org.eclipse.equinox.internal.p2.repository.Activator; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.SynchronousProvisioningListener; import org.eclipse.equinox.internal.provisional.p2.repository.IStateful; diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManagerComponent.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManagerComponent.java new file mode 100644 index 000000000..26d5851b5 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManagerComponent.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2010 Sonatype, Inc 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: + * Sonatype, Inc. - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.internal.p2.repository; + +import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; +import org.eclipse.equinox.p2.core.IAgentLocation; +import org.eclipse.equinox.p2.core.IProvisioningAgent; +import org.eclipse.equinox.p2.core.spi.IAgentServiceFactory; + +public class CacheManagerComponent implements IAgentServiceFactory { + + public Object createService(IProvisioningAgent agent) { + final IProvisioningEventBus eventBus = (IProvisioningEventBus) agent.getService(IProvisioningEventBus.SERVICE_NAME); + CacheManager cache = new CacheManager((IAgentLocation) agent.getService(IAgentLocation.SERVICE_NAME)); + cache.setEventBus(eventBus); + return cache; + } + +} diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/Messages.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/Messages.java index 2ed09a9d3..daf6642ee 100644 --- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/Messages.java +++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/Messages.java @@ -8,6 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Cloudsmith Inc - additional messages + * Sonatype Inc - ongoing development *******************************************************************************/ package org.eclipse.equinox.internal.p2.repository; @@ -16,6 +17,10 @@ import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.equinox.internal.p2.repository.messages"; //$NON-NLS-1$ + public static String CacheManager_AuthenticationFaileFor_0; + public static String CacheManager_FailedCommunicationWithRepo_0; + public static String CacheManager_Neither_0_nor_1_found; + public static String artifact_not_found; public static String io_failedRead; public static String ecf_configuration_error; diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/messages.properties b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/messages.properties index 15728fe56..510885ba0 100644 --- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/messages.properties +++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/messages.properties @@ -8,6 +8,7 @@ # Contributors: # IBM Corporation - initial API and implementation # Cloudsmith Inc - additional messages +# Sonatype Inc - ongoing implementation ############################################################################### artifact_not_found=Artifact not found: {0}. @@ -18,9 +19,9 @@ ecf_configuration_error=Transport initialization error. repoMan_internalError=Internal error. repo_loading = Loading the repository {0} - - - +CacheManager_Neither_0_nor_1_found=Neither {0} nor {1} found. +CacheManager_AuthenticationFaileFor_0=Authentication failed for {0}. +CacheManager_FailedCommunicationWithRepo_0=Communication with repository at {0} failed. exception_malformedRepoURI = The repository location ({0}) must be a URI. -- cgit v1.2.3