Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2020-06-30 06:10:37 +0000
committerEike Stepper2020-06-30 06:10:37 +0000
commit0bb8e08a28cbdc6dd69c825eba9a1f54408a9411 (patch)
treef312166073b2e221fddf2ca2211503e7c1860120
parent41c0a62779d0f8d3cd570d95711b63dfb06010df (diff)
downloadcdo-0bb8e08a28cbdc6dd69c825eba9a1f54408a9411.tar.gz
cdo-0bb8e08a28cbdc6dd69c825eba9a1f54408a9411.tar.xz
cdo-0bb8e08a28cbdc6dd69c825eba9a1f54408a9411.zip
[564759] Provide a way to ignore an IRepository from the administration protocol
https://bugs.eclipse.org/bugs/show_bug.cgi?id=564759
-rw-r--r--plugins/org.eclipse.emf.cdo.server.admin/META-INF/MANIFEST.MF18
-rw-r--r--plugins/org.eclipse.emf.cdo.server.admin/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServer.java40
3 files changed, 43 insertions, 17 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.admin/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server.admin/META-INF/MANIFEST.MF
index 3eab838a68..f62ffc3421 100644
--- a/plugins/org.eclipse.emf.cdo.server.admin/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.server.admin/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.server.admin;singleton:=true
-Bundle-Version: 4.3.0.qualifier
+Bundle-Version: 4.3.1.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -17,12 +17,12 @@ Require-Bundle: org.eclipse.core.runtime;resolution:=optional;bundle-version="[3
org.eclipse.emf.cdo.server.security;bundle-version="[4.3.0,5.0.0)",
org.eclipse.emf.cdo.security;bundle-version="[4.3.0,5.0.0)",
org.eclipse.net4j.jvm;bundle-version="[4.1.100,5.0.0)";resolution:=optional
-Export-Package: org.eclipse.emf.cdo.server.admin;version="4.3.0",
- org.eclipse.emf.cdo.server.internal.admin;x-internal:=true;version="4.3.0",
- org.eclipse.emf.cdo.server.internal.admin.bundle;x-internal:=true;version="4.3.0",
- org.eclipse.emf.cdo.server.internal.admin.protocol;x-internal:=true;version="4.3.0",
- org.eclipse.emf.cdo.server.spi.admin;version="4.3.0",
- org.eclipse.emf.cdo.server.internal.admin.catalog;x-internal:=true;version="4.3.0",
- org.eclipse.emf.cdo.server.internal.admin.catalog.impl;x-internal:=true;version="4.3.0",
- org.eclipse.emf.cdo.server.internal.admin.catalog.util;x-internal:=true;version="4.3.0"
+Export-Package: org.eclipse.emf.cdo.server.admin;version="4.3.1",
+ org.eclipse.emf.cdo.server.internal.admin;x-internal:=true;version="4.3.1",
+ org.eclipse.emf.cdo.server.internal.admin.bundle;x-internal:=true;version="4.3.1",
+ org.eclipse.emf.cdo.server.internal.admin.protocol;x-internal:=true;version="4.3.1",
+ org.eclipse.emf.cdo.server.spi.admin;version="4.3.1",
+ org.eclipse.emf.cdo.server.internal.admin.catalog;x-internal:=true;version="4.3.1",
+ org.eclipse.emf.cdo.server.internal.admin.catalog.impl;x-internal:=true;version="4.3.1",
+ org.eclipse.emf.cdo.server.internal.admin.catalog.util;x-internal:=true;version="4.3.1"
Automatic-Module-Name: org.eclipse.emf.cdo.server.admin
diff --git a/plugins/org.eclipse.emf.cdo.server.admin/pom.xml b/plugins/org.eclipse.emf.cdo.server.admin/pom.xml
index 4d1b269e72..50fc1ec4ff 100644
--- a/plugins/org.eclipse.emf.cdo.server.admin/pom.xml
+++ b/plugins/org.eclipse.emf.cdo.server.admin/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.emf.cdo.server.admin</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServer.java b/plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServer.java
index 01210f2c90..e07253e861 100644
--- a/plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServer.java
+++ b/plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServer.java
@@ -51,6 +51,10 @@ import java.util.Set;
*/
public class CDOAdminServer extends AbstractCDOAdmin
{
+ public static final String PROP_IGNORE = "org.eclipse.emf.cdo.server.admin.ignore";
+
+ private static final String TRUE = Boolean.TRUE.toString();
+
private static Class<?> IJVMCHANNEL_CLASS;
private final IManagedContainer container;
@@ -227,9 +231,7 @@ public class CDOAdminServer extends AbstractCDOAdmin
{
if (element instanceof IRepository)
{
- IRepository delegate = (IRepository)element;
- CDOAdminServerRepository repository = new CDOAdminServerRepository(this, delegate);
- addElement(repository);
+ addDelegate((IRepository)element);
}
}
@@ -243,10 +245,35 @@ public class CDOAdminServer extends AbstractCDOAdmin
super.doDeactivate();
}
+ protected boolean validateDelegate(IRepository delegate)
+ {
+ String ignore = delegate.getProperties().get(PROP_IGNORE);
+ if (TRUE.equalsIgnoreCase(ignore))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ protected CDOAdminServerRepository addDelegate(IRepository delegate)
+ {
+ if (validateDelegate(delegate))
+ {
+ CDOAdminServerRepository repository = new CDOAdminServerRepository(this, delegate);
+ if (addElement(repository))
+ {
+ return repository;
+ }
+ }
+
+ return null;
+ }
+
protected void repositoryAdded(IRepository delegate)
{
- CDOAdminServerRepository repository = new CDOAdminServerRepository(this, delegate);
- if (addElement(repository))
+ CDOAdminServerRepository repository = addDelegate(delegate);
+ if (repository != null)
{
for (CDOAdminServerProtocol protocol : getProtocols())
{
@@ -267,7 +294,7 @@ public class CDOAdminServer extends AbstractCDOAdmin
String name = delegate.getName();
CDOAdminServerRepository repository = (CDOAdminServerRepository)getRepository(name);
- if (removeElement(repository))
+ if (repository != null && removeElement(repository))
{
repository.dispose();
for (CDOAdminServerProtocol protocol : getProtocols())
@@ -435,5 +462,4 @@ public class CDOAdminServer extends AbstractCDOAdmin
}
}
}
-
}

Back to the top