org.apache.uima.aae.controller
Class AnalysisEngineInstancePoolWithThreadAffinity

java.lang.Object
  extended by org.apache.uima.aae.controller.AnalysisEngineInstancePoolWithThreadAffinity
All Implemented Interfaces:
AnalysisEngineInstancePool

public class AnalysisEngineInstancePoolWithThreadAffinity
extends java.lang.Object
implements AnalysisEngineInstancePool


Constructor Summary
AnalysisEngineInstancePoolWithThreadAffinity(int aePoolSize)
           
 
Method Summary
 void checkin(org.apache.uima.analysis_engine.AnalysisEngine anAnalysisEngine)
          Adds an instance of AnalysisEngine to the pool
 org.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 instance
 void intialize(java.util.List anAnalysisEngineInstanceList)
          Creates and initializes the AE Pool with intances of AEs provided in the anAnalysisEngineInstanceList
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnalysisEngineInstancePoolWithThreadAffinity

public AnalysisEngineInstancePoolWithThreadAffinity(int aePoolSize)
Method Detail

intialize

public void intialize(java.util.List anAnalysisEngineInstanceList)
               throws java.lang.Exception
Description copied from interface: AnalysisEngineInstancePool
Creates and initializes the AE Pool with intances of AEs provided in the anAnalysisEngineInstanceList

Specified by:
intialize in interface AnalysisEngineInstancePool
Parameters:
anAnalysisEngineInstanceList - - list of AnalysisEngine instances
Throws:
java.lang.Exception

size

public int size()
Specified by:
size in interface AnalysisEngineInstancePool

checkin

public void checkin(org.apache.uima.analysis_engine.AnalysisEngine anAnalysisEngine)
             throws java.lang.Exception
Description copied from interface: AnalysisEngineInstancePool
Adds an instance of AnalysisEngine to the pool

Specified by:
checkin in interface AnalysisEngineInstancePool
Parameters:
anAnalysisEngine - - AnalysisEngine instance to be added to the pool
Throws:
java.lang.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 interface AnalysisEngineInstancePool
Returns:

checkout

public org.apache.uima.analysis_engine.AnalysisEngine checkout()
                                                        throws java.lang.Exception
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 interface AnalysisEngineInstancePool
Returns:
AnalysisEngine instance
Throws:
java.lang.Exception
See Also:
AnalysisEngineInstancePool.checkout()

destroy

public void destroy()
             throws java.lang.Exception
Description copied from interface: AnalysisEngineInstancePool
Destroys Analysis Engine instance pool.

Specified by:
destroy in interface AnalysisEngineInstancePool
Throws:
java.lang.Exception


Copyright © 2012. All Rights Reserved.