diff options
author | Ian Bull | 2011-03-05 03:16:42 +0000 |
---|---|---|
committer | Ian Bull | 2011-03-05 03:16:42 +0000 |
commit | d826ca961eb560d90c9e8bbb266c06ad9bed8a6d (patch) | |
tree | 3687b3f9689ba60904941a51df380557b81095d7 /bundles/org.eclipse.equinox.p2.extensionlocation | |
parent | 088551f94aa91b7bbe9679da780ec00b548a17ad (diff) | |
download | rt.equinox.p2-d826ca961eb560d90c9e8bbb266c06ad9bed8a6d.tar.gz rt.equinox.p2-d826ca961eb560d90c9e8bbb266c06ad9bed8a6d.tar.xz rt.equinox.p2-d826ca961eb560d90c9e8bbb266c06ad9bed8a6d.zip |
NEW - bug 301903: Consider a file level lock during batch executionv20110305-0130
https://bugs.eclipse.org/bugs/show_bug.cgi?id=301903
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.extensionlocation')
2 files changed, 67 insertions, 22 deletions
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java index 5bdb8ad1f..5bcb42d0a 100644 --- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java @@ -147,30 +147,65 @@ public class ExtensionLocationArtifactRepository extends AbstractRepository<IArt return plugins.isDirectory() || features.isDirectory(); } + public void addDescriptor(IArtifactDescriptor descriptor, IProgressMonitor monitor) { + throw new UnsupportedOperationException(); + } + + @Deprecated public void addDescriptor(IArtifactDescriptor descriptor) { throw new UnsupportedOperationException(); } + public void addDescriptors(IArtifactDescriptor[] descriptors, IProgressMonitor monitor) { + throw new UnsupportedOperationException(); + } + + @Deprecated public void addDescriptors(IArtifactDescriptor[] descriptors) { throw new UnsupportedOperationException(); } + public void removeAll(IProgressMonitor monitor) { + throw new UnsupportedOperationException(); + } + + @Deprecated public void removeAll() { throw new UnsupportedOperationException(); } + public void removeDescriptor(IArtifactDescriptor descriptor, IProgressMonitor monitor) { + throw new UnsupportedOperationException(); + } + + @Deprecated public void removeDescriptor(IArtifactDescriptor descriptor) { throw new UnsupportedOperationException(); } + public void removeDescriptor(IArtifactKey key, IProgressMonitor monitor) { + throw new UnsupportedOperationException(); + } + + @Deprecated public void removeDescriptor(IArtifactKey key) { throw new UnsupportedOperationException(); } + public void removeDescriptors(IArtifactDescriptor[] descriptors, IProgressMonitor monitor) { + throw new UnsupportedOperationException(); + } + + @Deprecated public void removeDescriptors(IArtifactDescriptor[] descriptors) { throw new UnsupportedOperationException(); } + public void removeDescriptors(IArtifactKey[] keys, IProgressMonitor monitor) { + throw new UnsupportedOperationException(); + } + + @Deprecated public void removeDescriptors(IArtifactKey[] keys) { throw new UnsupportedOperationException(); } @@ -225,18 +260,23 @@ public class ExtensionLocationArtifactRepository extends AbstractRepository<IArt return artifactRepository.getProperties(); } - public String setProperty(String key, String value) { - ensureInitialized(); - String oldValue = artifactRepository.setProperty(key, value); - // if the value didn't really change then just return - if (oldValue == value || (oldValue != null && oldValue.equals(value))) - return oldValue; - // we want to re-initialize if we are changing the site policy or plug-in list - if (!SiteListener.SITE_LIST.equals(key) && !SiteListener.SITE_POLICY.equals(key)) + public String setProperty(String key, String value, IProgressMonitor monitor) { + try { + ensureInitialized(); + String oldValue = artifactRepository.setProperty(key, value); + // if the value didn't really change then just return + if (oldValue == value || (oldValue != null && oldValue.equals(value))) + return oldValue; + // we want to re-initialize if we are changing the site policy or plug-in list + if (!SiteListener.SITE_LIST.equals(key) && !SiteListener.SITE_POLICY.equals(key)) + return oldValue; + state = SiteListener.UNINITIALIZED; + ensureInitialized(); return oldValue; - state = SiteListener.UNINITIALIZED; - ensureInitialized(); - return oldValue; + } finally { + if (monitor != null) + monitor.done(); + } } public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) { diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java index 55f0d0c13..4c0651d5c 100644 --- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java +++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java @@ -207,17 +207,22 @@ public class ExtensionLocationMetadataRepository extends AbstractMetadataReposit * @see org.eclipse.equinox.p2.repository.spi.AbstractRepository#setProperty(java.lang.String, java.lang.String) */ @Override - public String setProperty(String key, String value) { - ensureInitialized(); - String oldValue = metadataRepository.setProperty(key, value); - // if the value didn't really change then just return - if (oldValue == value || (oldValue != null && oldValue.equals(value))) - return oldValue; - // we want to re-initialize if we are changing the site policy or plug-in list - if (!SiteListener.SITE_LIST.equals(key) && !SiteListener.SITE_POLICY.equals(key)) + public String setProperty(String key, String value, IProgressMonitor monitor) { + try { + ensureInitialized(); + String oldValue = metadataRepository.setProperty(key, value); + // if the value didn't really change then just return + if (oldValue == value || (oldValue != null && oldValue.equals(value))) + return oldValue; + // we want to re-initialize if we are changing the site policy or plug-in list + if (!SiteListener.SITE_LIST.equals(key) && !SiteListener.SITE_POLICY.equals(key)) + return oldValue; + state = SiteListener.UNINITIALIZED; + ensureInitialized(); return oldValue; - state = SiteListener.UNINITIALIZED; - ensureInitialized(); - return oldValue; + } finally { + if (monitor != null) + monitor.done(); + } } } |