diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-13 12:39:53 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-13 12:39:53 +0000 |
commit | 9145d1479e838918317bc9d4c5e25fe537e5f6de (patch) | |
tree | 12c504c96900ee6ebeb19e71627cf3e97df4ab78 /branches/sca-java-1.x/modules/binding-ws-axis2-jms/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/transport/base/threads/NativeWorkerPool.java | |
parent | a0d58fe9ff6b7babfa8fd076779fbd374fe1db19 (diff) |
Abandon trying to use the new Axis2 JMS transport for now as its proving too messy tryingto backport it to the 1.4.1 release. Now trying a new approach which modifies the JMS transport from Axis2 1.4.1
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@774293 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | branches/sca-java-1.x/modules/binding-ws-axis2-jms/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/transport/base/threads/NativeWorkerPool.java | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2-jms/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/transport/base/threads/NativeWorkerPool.java b/branches/sca-java-1.x/modules/binding-ws-axis2-jms/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/transport/base/threads/NativeWorkerPool.java deleted file mode 100644 index 9401daee8e..0000000000 --- a/branches/sca-java-1.x/modules/binding-ws-axis2-jms/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/transport/base/threads/NativeWorkerPool.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.ws.axis2.transport.base.threads; - -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * Worker pool implementation based on java.util.concurrent in JDK 1.5 or later. - */ -public class NativeWorkerPool implements WorkerPool { - - static final Log log = LogFactory.getLog(NativeWorkerPool.class); - - private final ThreadPoolExecutor executor; - private final LinkedBlockingQueue<Runnable> blockingQueue; - - public NativeWorkerPool(int core, int max, int keepAlive, - int queueLength, String threadGroupName, String threadGroupId) { - - if (log.isDebugEnabled()) { - log.debug("Using native util.concurrent package.."); - } - blockingQueue = - (queueLength == -1 ? new LinkedBlockingQueue<Runnable>() - : new LinkedBlockingQueue<Runnable>(queueLength)); - executor = new ThreadPoolExecutor( - core, max, keepAlive, - TimeUnit.SECONDS, - blockingQueue, - new NativeThreadFactory(new ThreadGroup(threadGroupName), threadGroupId)); - } - - public void execute(final Runnable task) { - executor.execute(new Runnable() { - public void run() { - try { - task.run(); - } catch (Throwable t) { - log.error("Uncaught exception", t); - } - } - }); - } - - public int getActiveCount() { - return executor.getActiveCount(); - } - - public int getQueueSize() { - return blockingQueue.size(); - } - - public void shutdown(int timeout) throws InterruptedException { - executor.shutdown(); - executor.awaitTermination(timeout, TimeUnit.MILLISECONDS); - } -} |