Package org.apache.uima.aae
Class UimaAsThreadFactory
- java.lang.Object
-
- org.apache.uima.aae.UimaAsThreadFactory
-
- All Implemented Interfaces:
java.util.concurrent.ThreadFactory
public class UimaAsThreadFactory extends java.lang.Object implements java.util.concurrent.ThreadFactory
Custom ThreadFactory for use in the TaskExecutor. The TaskExecutor is plugged in by Spring from spring xml file generated by dd2spring. The TaskExecutor is only defined for PrimitiveControllers and its main purpose is to provide thread pooling and management. Each new thread produced by this ThreadFactory is used to initialize a dedicated AE instance in the PrimitiveController.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.concurrent.atomic.AtomicInteger
poolIdGenerator
-
Constructor Summary
Constructors Constructor Description UimaAsThreadFactory(java.lang.ThreadGroup tGroup)
UimaAsThreadFactory(java.lang.ThreadGroup tGroup, PrimitiveAnalysisEngineController aController)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Thread
newThread(java.lang.Runnable r)
Creates a new thread, initializes instance of AE via a call on a given PrimitiveController.void
setDaemon(boolean daemon)
void
setThreadGroup(java.lang.ThreadGroup tGroup)
void
setThreadNamePrefix(java.lang.String prefix)
void
stop()
-
-
-
Constructor Detail
-
UimaAsThreadFactory
public UimaAsThreadFactory(java.lang.ThreadGroup tGroup)
-
UimaAsThreadFactory
public UimaAsThreadFactory(java.lang.ThreadGroup tGroup, PrimitiveAnalysisEngineController aController)
- Parameters:
tGroup
-aController
-
-
-
Method Detail
-
setThreadNamePrefix
public void setThreadNamePrefix(java.lang.String prefix)
-
setThreadGroup
public void setThreadGroup(java.lang.ThreadGroup tGroup)
-
setDaemon
public void setDaemon(boolean daemon)
-
stop
public void stop()
-
newThread
public java.lang.Thread newThread(java.lang.Runnable r)
Creates a new thread, initializes instance of AE via a call on a given PrimitiveController. Once the thread finishes initializing AE instance in the controller, it calls run() on a given Runnable. This Runnable is a Worker instance managed by the TaskExecutor. When the thread calls run() on the Runnable it blocks until the Worker releases it.- Specified by:
newThread
in interfacejava.util.concurrent.ThreadFactory
-
-