Package org.apache.uima.aae
Class UimaAsThreadFactory
java.lang.Object
org.apache.uima.aae.UimaAsThreadFactory
- All Implemented Interfaces:
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 -
Constructor Summary
ConstructorsConstructorDescriptionUimaAsThreadFactory
(ThreadGroup tGroup) UimaAsThreadFactory
(ThreadGroup tGroup, PrimitiveAnalysisEngineController aController) -
Method Summary
Modifier and TypeMethodDescriptionCreates a new thread, initializes instance of AE via a call on a given PrimitiveController.void
setDaemon
(boolean daemon) void
setThreadGroup
(ThreadGroup tGroup) void
setThreadNamePrefix
(String prefix) void
stop()
-
Field Details
-
poolIdGenerator
-
-
Constructor Details
-
UimaAsThreadFactory
-
UimaAsThreadFactory
- Parameters:
tGroup
-aController
-
-
-
Method Details
-
setThreadNamePrefix
-
setThreadGroup
-
setDaemon
public void setDaemon(boolean daemon) -
stop
public void stop() -
newThread
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 interfaceThreadFactory
-