Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-11-09 11:14:04 -0500
committerEike Stepper2018-11-09 11:14:04 -0500
commit05368c5919b785a2bb1a06787e3ed6fabbb31177 (patch)
treef2b58b5bfb4840af884e196cc1e877bc7c9b0d5a
parentf479c76c7146a7bffd4d79d7f3cb84e507d76411 (diff)
downloadcdo-05368c5919b785a2bb1a06787e3ed6fabbb31177.tar.gz
cdo-05368c5919b785a2bb1a06787e3ed6fabbb31177.tar.xz
cdo-05368c5919b785a2bb1a06787e3ed6fabbb31177.zip
[540552] CDO's thread pool properties should be configurable
https://bugs.eclipse.org/bugs/show_bug.cgi?id=540552
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ExecutorServiceFactory.java7
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPoolFactory.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferProviderFactory.java)11
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/Net4jUtil.java6
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/TransportInjector.java4
4 files changed, 17 insertions, 11 deletions
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ExecutorServiceFactory.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ExecutorServiceFactory.java
index 9a8370c11e..464f58ddd8 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ExecutorServiceFactory.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ExecutorServiceFactory.java
@@ -18,6 +18,7 @@ import org.eclipse.net4j.util.lifecycle.ILifecycle;
import org.eclipse.net4j.util.lifecycle.LifecycleException;
import org.eclipse.net4j.util.lifecycle.LifecycleState;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.eclipse.net4j.util.om.OMPlatform;
import java.util.concurrent.ExecutorService;
@@ -29,7 +30,9 @@ public class ExecutorServiceFactory extends Factory
{
public static final String PRODUCT_GROUP = "org.eclipse.net4j.executorServices"; //$NON-NLS-1$
- public static final String TYPE = "default"; //$NON-NLS-1$
+ public static final String TYPE = OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.util.concurrent.ExecutorServiceFactory.type", "default"); //$NON-NLS-1$
+
+ public static final String DESCRIPTION = OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.util.concurrent.ExecutorServiceFactory.description");
public static final String DEFAULT_THREAD_GROUP_NAME = "net4j"; //$NON-NLS-1$
@@ -105,6 +108,6 @@ public class ExecutorServiceFactory extends Factory
public static ExecutorService get(IManagedContainer container)
{
- return (ExecutorService)container.getElement(PRODUCT_GROUP, TYPE, null);
+ return (ExecutorService)container.getElement(PRODUCT_GROUP, TYPE, DESCRIPTION);
}
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferProviderFactory.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPoolFactory.java
index a788c25e11..029759caad 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferProviderFactory.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPoolFactory.java
@@ -14,19 +14,22 @@ import org.eclipse.net4j.Net4jUtil;
import org.eclipse.net4j.buffer.IBufferProvider;
import org.eclipse.net4j.util.container.IManagedContainer;
import org.eclipse.net4j.util.factory.Factory;
+import org.eclipse.net4j.util.om.OMPlatform;
/**
* @author Eike Stepper
*/
-public class BufferProviderFactory extends Factory
+public class BufferPoolFactory extends Factory
{
public static final String PRODUCT_GROUP = "org.eclipse.net4j.bufferProviders"; //$NON-NLS-1$
- public static final String TYPE = "default"; //$NON-NLS-1$
+ public static final String TYPE = OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.buffer.BufferPoolFactory.type", "default"); //$NON-NLS-1$
+
+ public static final String DESCRIPTION = OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.buffer.BufferPoolFactory.description");
public static final short BUFFER_CAPACITY = 4096;
- public BufferProviderFactory()
+ public BufferPoolFactory()
{
super(PRODUCT_GROUP, TYPE);
}
@@ -38,6 +41,6 @@ public class BufferProviderFactory extends Factory
public static IBufferProvider get(IManagedContainer container)
{
- return (IBufferProvider)container.getElement(PRODUCT_GROUP, TYPE, null);
+ return (IBufferProvider)container.getElement(PRODUCT_GROUP, TYPE, DESCRIPTION);
}
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/Net4jUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/Net4jUtil.java
index 6dee6779a5..d87e67309d 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/Net4jUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/Net4jUtil.java
@@ -28,7 +28,7 @@ import org.eclipse.net4j.util.lifecycle.ILifecycle;
import org.eclipse.internal.net4j.TransportConfig;
import org.eclipse.internal.net4j.buffer.BufferFactory;
import org.eclipse.internal.net4j.buffer.BufferPool;
-import org.eclipse.internal.net4j.buffer.BufferProviderFactory;
+import org.eclipse.internal.net4j.buffer.BufferPoolFactory;
import org.eclipse.spi.net4j.AcceptorFactory;
import org.eclipse.spi.net4j.ConnectorFactory;
@@ -53,7 +53,7 @@ public final class Net4jUtil
public static void prepareContainer(IManagedContainer container)
{
ContainerUtil.prepareContainer(container);
- container.registerFactory(new BufferProviderFactory());
+ container.registerFactory(new BufferPoolFactory());
container.registerFactory(new GZIPStreamWrapper.Factory());
container.registerFactory(new HeartBeatProtocol.Server.Factory());
container.addPostProcessor(new TransportInjector());
@@ -67,7 +67,7 @@ public final class Net4jUtil
public static IBufferProvider getBufferProvider(IManagedContainer container)
{
- return BufferProviderFactory.get(container);
+ return BufferPoolFactory.get(container);
}
public static IAcceptor getAcceptor(IManagedContainer container, String type, String description)
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/TransportInjector.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/TransportInjector.java
index aff51177be..6edbcc907e 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/TransportInjector.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/TransportInjector.java
@@ -17,7 +17,7 @@ import org.eclipse.net4j.util.concurrent.ExecutorServiceFactory;
import org.eclipse.net4j.util.container.IElementProcessor;
import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.internal.net4j.buffer.BufferProviderFactory;
+import org.eclipse.internal.net4j.buffer.BufferPoolFactory;
import org.eclipse.spi.net4j.InternalAcceptor;
import org.eclipse.spi.net4j.InternalConnector;
@@ -96,7 +96,7 @@ public class TransportInjector implements IElementProcessor
*/
protected IBufferProvider getBufferProvider(IManagedContainer container)
{
- return (IBufferProvider)container.getElement(BufferProviderFactory.PRODUCT_GROUP, BufferProviderFactory.TYPE, null);
+ return (IBufferProvider)container.getElement(BufferPoolFactory.PRODUCT_GROUP, BufferPoolFactory.TYPE, null);
}
protected ExecutorService getExecutorService(IManagedContainer container)

Back to the top