You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2010/06/07 19:20:14 UTC
svn commit: r952340 -
/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/VmTransport.java
Author: cwiklik
Date: Mon Jun 7 17:20:13 2010
New Revision: 952340
URL: http://svn.apache.org/viewvc?rev=952340&view=rev
Log:
UIMA-1800 Reverted to code that is not using BlockingExecutor
Modified:
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/VmTransport.java
Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/VmTransport.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/VmTransport.java?rev=952340&r1=952339&r2=952340&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/VmTransport.java (original)
+++ uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/VmTransport.java Mon Jun 7 17:20:13 2010
@@ -36,7 +36,6 @@ import org.apache.uima.aae.UIDGenerator;
import org.apache.uima.aae.UIMAEE_Constants;
import org.apache.uima.aae.UimaAsContext;
import org.apache.uima.aae.UimaAsThreadFactory;
-import org.apache.uima.aae.UimaBlockingExecutor;
import org.apache.uima.aae.controller.AggregateAnalysisEngineController;
import org.apache.uima.aae.controller.AnalysisEngineController;
import org.apache.uima.aae.controller.BaseAnalysisEngineController;
@@ -67,8 +66,6 @@ public class VmTransport implements Uima
private ThreadPoolExecutor executor = null;
- private UimaBlockingExecutor blockingExecutor;
-
private ThreadGroup threadGroup = null;
// Create a queue for work items. The queue has a JMX wrapper to expose the
@@ -123,7 +120,7 @@ public class VmTransport implements Uima
}
public void startIt() throws UimaSpiException {
- dispatcher = new UimaVmMessageDispatcher(blockingExecutor, null, (String) context.get("EndpointName"));
+ dispatcher = new UimaVmMessageDispatcher(executor, null, (String) context.get("EndpointName"));
}
public synchronized void stopIt() throws UimaSpiException {
@@ -133,9 +130,7 @@ public class VmTransport implements Uima
stopping.set(true);
executor.purge();
executor.shutdownNow();
-
workQueue.clear();
- blockingExecutor.stop();
Set<Entry<String, UimaVmMessageDispatcher>> set = dispatchers.entrySet();
for (Entry<String, UimaVmMessageDispatcher> entry : set) {
UimaVmMessageDispatcher dispatcher = entry.getValue();
@@ -177,13 +172,10 @@ public class VmTransport implements Uima
}
}
- protected UimaBlockingExecutor getExecutorInstance() {
+ protected ThreadPoolExecutor getExecutorInstance() {
if (executor == null) {
int concurrentConsumerCount = context.getConcurrentConsumerCount();
-
- // Create an unbounded queue.
- workQueue = new UimaVmQueue();
-
+ workQueue = new UimaVmQueue();
// Create a ThreadPoolExecutor with as many threads as needed. The pool has
// a fixed number of threads that never expire and are never passivated.
executor = new ThreadPoolExecutor(concurrentConsumerCount, concurrentConsumerCount,
@@ -193,16 +185,10 @@ public class VmTransport implements Uima
(PrimitiveAnalysisEngineController) controller);
executor.setThreadFactory(tf);
}
-
executor.prestartAllCoreThreads();
- // instantiate a blocking executor with a maximum number of concurrent threads.
- // Internally the executor uses a Semaphore bounded by a max number of permits to
- // throttle requests. If number of requests exceeds number of available permits,
- // the submitting thread hangs until a permit becomes available.
- blockingExecutor = new UimaBlockingExecutor(executor, concurrentConsumerCount);
controller.changeState(ServiceState.RUNNING);
}
- return blockingExecutor;
+ return executor;
}
public void registerWithJMX(AnalysisEngineController aController, String queueKind ) {