diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-08 11:17:14 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-08 11:17:14 +0000 |
commit | 651da5580bc86cc95dd2e5ecd651355fbfd8d5b2 (patch) | |
tree | e86d4441e35961b9ee7ba32182ad3ab3895edd0d /sca-java-1.x/trunk | |
parent | 5cf84ca2cb804d59d8d39db7cd171d0608c1e5b7 (diff) |
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
Diffstat (limited to 'sca-java-1.x/trunk')
-rw-r--r-- | sca-java-1.x/trunk/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/EmbeddedODEServer.java | 13 |
1 files changed, 12 insertions, 1 deletions
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; |