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 java.lang.Object implements AnalysisEngineInstancePool
-
-
Constructor Summary
Constructors Constructor Description AnalysisEngineInstancePoolWithThreadAffinity(int aePoolSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckin(org.apache.uima.analysis_engine.AnalysisEngine anAnalysisEngine)Adds an instance of AnalysisEngine to the poolorg.apache.uima.analysis_engine.AnalysisEnginecheckout()Pins each process thread to a specific and dedicated AE instance.voiddestroy()Destroys Analysis Engine instance pool.booleanexists()Checks if the current Thread is assigned to an AE instancevoidintialize(java.util.List anAnalysisEngineInstanceList)Creates and initializes the AE Pool with intances of AEs provided in the anAnalysisEngineInstanceListintsize()
-
-
-
Method Detail
-
intialize
public void intialize(java.util.List anAnalysisEngineInstanceList) throws java.lang.ExceptionDescription copied from interface:AnalysisEngineInstancePoolCreates and initializes the AE Pool with intances of AEs provided in the anAnalysisEngineInstanceList- Specified by:
intializein interfaceAnalysisEngineInstancePool- Parameters:
anAnalysisEngineInstanceList- - list of AnalysisEngine instances- Throws:
java.lang.Exception
-
size
public int size()
- Specified by:
sizein interfaceAnalysisEngineInstancePool
-
checkin
public void checkin(org.apache.uima.analysis_engine.AnalysisEngine anAnalysisEngine) throws java.lang.ExceptionDescription copied from interface:AnalysisEngineInstancePoolAdds an instance of AnalysisEngine to the pool- Specified by:
checkinin interfaceAnalysisEngineInstancePool- Parameters:
anAnalysisEngine- - AnalysisEngine instance to be added to the pool- Throws:
java.lang.Exception
-
exists
public boolean exists()
Description copied from interface:AnalysisEngineInstancePoolChecks if the current Thread is assigned to an AE instance- Specified by:
existsin interfaceAnalysisEngineInstancePool- Returns:
-
checkout
public org.apache.uima.analysis_engine.AnalysisEngine checkout() throws java.lang.ExceptionPins 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:
checkoutin interfaceAnalysisEngineInstancePool- Returns:
- AnalysisEngine instance
- Throws:
java.lang.Exception- See Also:
AnalysisEngineInstancePool.checkout()
-
destroy
public void destroy() throws java.lang.ExceptionDescription copied from interface:AnalysisEngineInstancePoolDestroys Analysis Engine instance pool.- Specified by:
destroyin interfaceAnalysisEngineInstancePool- Throws:
java.lang.Exception
-
-