Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-07-22 12:25:46 +0000
committerEike Stepper2015-07-22 12:25:46 +0000
commit017c0e91d0dc68b7ead1b4c893f032d3d72e4e31 (patch)
tree43b63e279685bbafc4e131a243609487e5112c99 /plugins/org.eclipse.emf.cdo.examples
parentc8eba7351ffd2d37e17db3ae3c2a7009d366b769 (diff)
downloadcdo-017c0e91d0dc68b7ead1b4c893f032d3d72e4e31.tar.gz
cdo-017c0e91d0dc68b7ead1b4c893f032d3d72e4e31.tar.xz
cdo-017c0e91d0dc68b7ead1b4c893f032d3d72e4e31.zip
[473277] Enhance ThreadPool and use it as much as possible
https://bugs.eclipse.org/bugs/show_bug.cgi?id=473277
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.examples')
-rw-r--r--plugins/org.eclipse.emf.cdo.examples/META-INF/MANIFEST.MF10
-rw-r--r--plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java14
2 files changed, 7 insertions, 17 deletions
diff --git a/plugins/org.eclipse.emf.cdo.examples/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.examples/META-INF/MANIFEST.MF
index b372da0479..1e9592340d 100644
--- a/plugins/org.eclipse.emf.cdo.examples/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.examples/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.examples;singleton:=true
-Bundle-Version: 4.0.400.qualifier
+Bundle-Version: 4.0.500.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Activator: org.eclipse.emf.cdo.internal.examples.bundle.OM$Activator
@@ -20,7 +20,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";resoluti
org.eclipse.net4j.tcp;bundle-version="[4.0.0,5.0.0)",
org.eclipse.net4j.db.h2;bundle-version="[4.0.0,5.0.0)"
Import-Package: org.h2.jdbcx;version="[1.0.0,2.0.0)"
-Export-Package: org.eclipse.emf.cdo.examples;version="4.0.400";x-internal:=true,
- org.eclipse.emf.cdo.examples.server;version="4.0.400";x-internal:=true,
- org.eclipse.emf.cdo.examples.server.offline;version="4.0.400";x-internal:=true,
- org.eclipse.emf.cdo.internal.examples.bundle;version="4.0.400";x-internal:=true
+Export-Package: org.eclipse.emf.cdo.examples;version="4.0.500";x-internal:=true,
+ org.eclipse.emf.cdo.examples.server;version="4.0.500";x-internal:=true,
+ org.eclipse.emf.cdo.examples.server.offline;version="4.0.500";x-internal:=true,
+ org.eclipse.emf.cdo.internal.examples.bundle;version="4.0.500";x-internal:=true
diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java
index 01915f9e56..1ec52e6ed8 100644
--- a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java
+++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java
@@ -23,6 +23,7 @@ import org.eclipse.net4j.FactoriesProtocolProvider;
import org.eclipse.net4j.Net4jUtil;
import org.eclipse.net4j.buffer.IBufferProvider;
import org.eclipse.net4j.protocol.IProtocolProvider;
+import org.eclipse.net4j.util.concurrent.ThreadPool;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.net4j.util.om.log.PrintLogHandler;
@@ -31,8 +32,6 @@ import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
import org.eclipse.emf.ecore.EObject;
import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
/**
* @author Eike Stepper
@@ -47,16 +46,7 @@ public class StandaloneManualExample
OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
// Prepare receiveExecutor
- final ThreadGroup threadGroup = new ThreadGroup("net4j"); //$NON-NLS-1$
- ExecutorService receiveExecutor = Executors.newCachedThreadPool(new ThreadFactory()
- {
- public Thread newThread(Runnable r)
- {
- Thread thread = new Thread(threadGroup, r);
- thread.setDaemon(true);
- return thread;
- }
- });
+ ExecutorService receiveExecutor = ThreadPool.create();
// Prepare bufferProvider
IBufferProvider bufferProvider = Net4jUtil.createBufferPool();

Back to the top