Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDJ Houghton2011-01-19 21:42:03 +0000
committerDJ Houghton2011-01-19 21:42:03 +0000
commit399a463c78ff025543a7c04b35394fe5f9777430 (patch)
tree91f58ef4ea88b049dbb6ac7ee1ce4484ce5990ea /bundles/org.eclipse.equinox.p2.repository
parenta21e9016630cd6d7ac5d0fd38a35b3e520686280 (diff)
downloadrt.equinox.p2-399a463c78ff025543a7c04b35394fe5f9777430.tar.gz
rt.equinox.p2-399a463c78ff025543a7c04b35394fe5f9777430.tar.xz
rt.equinox.p2-399a463c78ff025543a7c04b35394fe5f9777430.zip
Bug 324873 - [repository] Share IUs for Composite Repositories
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/IMetadataRepository.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/spi/AbstractMetadataRepository.java13
2 files changed, 27 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/IMetadataRepository.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/IMetadataRepository.java
index e6633c37f..54654f75e 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/IMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/IMetadataRepository.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2011 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
@@ -13,6 +13,7 @@ package org.eclipse.equinox.p2.repository.metadata;
import java.util.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.equinox.p2.core.IPool;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.repository.*;
import org.eclipse.equinox.p2.repository.metadata.spi.AbstractMetadataRepository;
@@ -81,4 +82,17 @@ public interface IMetadataRepository extends IRepository<IInstallableUnit> {
* the execution will be returned in the status.
*/
public IStatus executeBatch(IRunnableWithProgress runnable, IProgressMonitor monitor);
+
+ /**
+ * Cause semantically equivalent IInstallableUnits in the receiver to be
+ * replaced with a shared object from the provided {@link IPool}. New objects are
+ * added to the {@link IPool} as required.
+ * <p>
+ * While the {@link IPool} should be retained to increase the scope of sharing when
+ * calling {@link #compress(IPool)} on subsequent repositories, the {@link IPool} can
+ * be discarded without adversely effecting the receiver.
+ * </p>
+ * @since 2.1
+ */
+ public void compress(IPool<IInstallableUnit> iuPool);
}
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/spi/AbstractMetadataRepository.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/spi/AbstractMetadataRepository.java
index b526bb874..92cae1740 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/spi/AbstractMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/spi/AbstractMetadataRepository.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2011 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,6 +15,7 @@ import java.util.Collection;
import java.util.Map;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.repository.Activator;
+import org.eclipse.equinox.p2.core.IPool;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
@@ -151,4 +152,14 @@ public abstract class AbstractMetadataRepository extends AbstractRepository<IIns
return Status.OK_STATUS;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.p2.repository.metadata.IMetadataRepository#compress(IPool<IInstallableUnit> iuPool)
+ */
+ /**
+ * @since 2.1
+ */
+ public void compress(IPool<IInstallableUnit> iuPool) {
+ // Default no-op. Subclasses should override as appropriate
+ }
+
}

Back to the top