Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-11-10 13:14:22 -0500
committerEike Stepper2018-11-10 13:14:22 -0500
commit6657dd11669b4ffe0b5c0b5436fe99d4cdccfd04 (patch)
tree45c3aeaf9bc5dd65f7dce54a8467c109459e8982
parentd281f67ebbb61c795e06e1c342758f6dfde2d150 (diff)
downloadcdo-6657dd11669b4ffe0b5c0b5436fe99d4cdccfd04.tar.gz
cdo-6657dd11669b4ffe0b5c0b5436fe99d4cdccfd04.tar.xz
cdo-6657dd11669b4ffe0b5c0b5436fe99d4cdccfd04.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/.settings/.api_filters9
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ExecutorServiceFactory.java16
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPoolFactory.java12
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/TransportInjector.java4
4 files changed, 28 insertions, 13 deletions
diff --git a/plugins/org.eclipse.net4j.util/.settings/.api_filters b/plugins/org.eclipse.net4j.util/.settings/.api_filters
index 88b6121aac..669faac381 100644
--- a/plugins/org.eclipse.net4j.util/.settings/.api_filters
+++ b/plugins/org.eclipse.net4j.util/.settings/.api_filters
@@ -76,6 +76,15 @@
</message_arguments>
</filter>
</resource>
+ <resource path="src/org/eclipse/net4j/util/concurrent/ExecutorServiceFactory.java" type="org.eclipse.net4j.util.concurrent.ExecutorServiceFactory">
+ <filter id="389242988">
+ <message_arguments>
+ <message_argument value="org.eclipse.net4j.util.concurrent.ExecutorServiceFactory"/>
+ <message_argument value="TYPE"/>
+ <message_argument value="default"/>
+ </message_arguments>
+ </filter>
+ </resource>
<resource path="src/org/eclipse/net4j/util/container/ContainerEvent.java" type="org.eclipse.net4j.util.container.ContainerEvent">
<filter id="576725006">
<message_arguments>
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 464f58ddd8..9134da6cbf 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
@@ -28,17 +28,23 @@ import java.util.concurrent.ExecutorService;
*/
public class ExecutorServiceFactory extends Factory
{
+ public static final String DEFAULT_THREAD_GROUP_NAME = "net4j"; //$NON-NLS-1$
+
public static final String PRODUCT_GROUP = "org.eclipse.net4j.executorServices"; //$NON-NLS-1$
- public static final String TYPE = OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.util.concurrent.ExecutorServiceFactory.type", "default"); //$NON-NLS-1$
+ /**
+ * @deprecated As of 4.8 the value of the system property "org.eclipse.net4j.util.concurrent.ExecutorServiceFactory.type" is used.
+ */
+ @Deprecated
+ public static final String TYPE = "default"; //$NON-NLS-1$
- public static final String DESCRIPTION = OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.util.concurrent.ExecutorServiceFactory.description");
+ private static final String DEFAULT_TYPE = OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.util.concurrent.ExecutorServiceFactory.type", "default"); //$NON-NLS-1$
- public static final String DEFAULT_THREAD_GROUP_NAME = "net4j"; //$NON-NLS-1$
+ private static final String DEFAULT_DESCRIPTION = OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.util.concurrent.ExecutorServiceFactory.description");
public ExecutorServiceFactory()
{
- super(PRODUCT_GROUP, TYPE);
+ super(PRODUCT_GROUP, DEFAULT_TYPE);
}
public ExecutorService create(String description)
@@ -108,6 +114,6 @@ public class ExecutorServiceFactory extends Factory
public static ExecutorService get(IManagedContainer container)
{
- return (ExecutorService)container.getElement(PRODUCT_GROUP, TYPE, DESCRIPTION);
+ return (ExecutorService)container.getElement(PRODUCT_GROUP, DEFAULT_TYPE, DEFAULT_DESCRIPTION);
}
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPoolFactory.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPoolFactory.java
index 029759caad..2b18c3ef0f 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPoolFactory.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPoolFactory.java
@@ -11,7 +11,7 @@
package org.eclipse.internal.net4j.buffer;
import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.buffer.IBufferProvider;
+import org.eclipse.net4j.buffer.IBufferPool;
import org.eclipse.net4j.util.container.IManagedContainer;
import org.eclipse.net4j.util.factory.Factory;
import org.eclipse.net4j.util.om.OMPlatform;
@@ -21,26 +21,26 @@ import org.eclipse.net4j.util.om.OMPlatform;
*/
public class BufferPoolFactory extends Factory
{
+ public static final short BUFFER_CAPACITY = 4096;
+
public static final String PRODUCT_GROUP = "org.eclipse.net4j.bufferProviders"; //$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 BufferPoolFactory()
{
super(PRODUCT_GROUP, TYPE);
}
- public IBufferProvider create(String description)
+ public IBufferPool create(String description)
{
return Net4jUtil.createBufferPool(BUFFER_CAPACITY);
}
- public static IBufferProvider get(IManagedContainer container)
+ public static IBufferPool get(IManagedContainer container)
{
- return (IBufferProvider)container.getElement(PRODUCT_GROUP, TYPE, DESCRIPTION);
+ return (IBufferPool)container.getElement(PRODUCT_GROUP, TYPE, 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 6edbcc907e..d1366d3b7a 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/TransportInjector.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/TransportInjector.java
@@ -96,11 +96,11 @@ public class TransportInjector implements IElementProcessor
*/
protected IBufferProvider getBufferProvider(IManagedContainer container)
{
- return (IBufferProvider)container.getElement(BufferPoolFactory.PRODUCT_GROUP, BufferPoolFactory.TYPE, null);
+ return BufferPoolFactory.get(container);
}
protected ExecutorService getExecutorService(IManagedContainer container)
{
- return (ExecutorService)container.getElement(ExecutorServiceFactory.PRODUCT_GROUP, ExecutorServiceFactory.TYPE, null);
+ return ExecutorServiceFactory.get(container);
}
}

Back to the top