Package org.apache.uima.aae.controller
Class AnalysisEngineInstancePoolWithThreadAffinity
java.lang.Object
org.apache.uima.aae.controller.AnalysisEngineInstancePoolWithThreadAffinity
- All Implemented Interfaces:
AnalysisEngineInstancePool
public class AnalysisEngineInstancePoolWithThreadAffinity
extends Object
implements AnalysisEngineInstancePool
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkin
(org.apache.uima.analysis_engine.AnalysisEngine anAnalysisEngine) Adds an instance of AnalysisEngine to the poolorg.apache.uima.analysis_engine.AnalysisEngine
checkout()
Pins each process thread to a specific and dedicated AE instance.void
destroy()
Destroys Analysis Engine instance pool.boolean
exists()
Checks if the current Thread is assigned to an AE instancevoid
Creates and initializes the AE Pool with intances of AEs provided in the anAnalysisEngineInstanceListint
size()
-
Constructor Details
-
AnalysisEngineInstancePoolWithThreadAffinity
public AnalysisEngineInstancePoolWithThreadAffinity(int aePoolSize)
-
-
Method Details
-
intialize
Description copied from interface:AnalysisEngineInstancePool
Creates and initializes the AE Pool with intances of AEs provided in the anAnalysisEngineInstanceList- Specified by:
intialize
in interfaceAnalysisEngineInstancePool
- Parameters:
anAnalysisEngineInstanceList
- - list of AnalysisEngine instances- Throws:
Exception
-
size
public int size()- Specified by:
size
in interfaceAnalysisEngineInstancePool
-
checkin
public void checkin(org.apache.uima.analysis_engine.AnalysisEngine anAnalysisEngine) throws Exception Description copied from interface:AnalysisEngineInstancePool
Adds an instance of AnalysisEngine to the pool- Specified by:
checkin
in interfaceAnalysisEngineInstancePool
- Parameters:
anAnalysisEngine
- - AnalysisEngine instance to be added to the pool- Throws:
Exception
-
exists
public boolean exists()Description copied from interface:AnalysisEngineInstancePool
Checks if the current Thread is assigned to an AE instance- Specified by:
exists
in interfaceAnalysisEngineInstancePool
- Returns:
-
checkout
Pins each process thread to a specific and dedicated AE instance. All AE instances are managed in a HashMap with thread name as a key. AE instance is not removed from the HashMap before it is returned to the client.- Specified by:
checkout
in interfaceAnalysisEngineInstancePool
- Returns:
- AnalysisEngine instance
- Throws:
Exception
- See Also:
-
destroy
Description copied from interface:AnalysisEngineInstancePool
Destroys Analysis Engine instance pool.- Specified by:
destroy
in interfaceAnalysisEngineInstancePool
- Throws:
Exception
-