From 651da5580bc86cc95dd2e5ecd651355fbfd8d5b2 Mon Sep 17 00:00:00 2001 From: nash Date: Mon, 8 Mar 2010 11:17:14 +0000 Subject: Update thread pool creation code to match the corresponding code in ODE 1.3.3 (TUSCANY-3475) git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@920274 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/implementation/bpel/ode/EmbeddedODEServer.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sca-java-1.x/trunk/modules/implementation-bpel-ode/src/main/java') diff --git a/sca-java-1.x/trunk/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java b/sca-java-1.x/trunk/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java index 84c40defd9..1ed85c18ca 100644 --- a/sca-java-1.x/trunk/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java +++ b/sca-java-1.x/trunk/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java @@ -26,6 +26,7 @@ import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; import javax.transaction.TransactionManager; import javax.xml.namespace.QName; @@ -147,9 +148,18 @@ public class EmbeddedODEServer { if (__log.isDebugEnabled()) { __log.debug("ODE initializing"); } + ThreadFactory threadFactory = new ThreadFactory() { + int threadNumber = 0; + public Thread newThread(Runnable r) { + threadNumber += 1; + Thread t = new Thread(r, "EmbeddedODEServer-"+threadNumber); + t.setDaemon(true); + return t; + } + }; //FIXME: externalize the configuration for ThreadPoolMaxSize - _executorService = Executors.newCachedThreadPool(); + _executorService = Executors.newCachedThreadPool(threadFactory); _bpelServer = new BpelServerImpl(); _scheduler = createScheduler(); @@ -222,6 +232,7 @@ public class EmbeddedODEServer { protected Scheduler createScheduler() { SimpleScheduler scheduler = new SimpleScheduler(new GUID().toString(),new JdbcDelegate(_db.getDataSource())); + scheduler.setExecutorService(_executorService); scheduler.setTransactionManager(_txMgr); return scheduler; -- cgit v1.2.3