Class ServiceProxyPool
- java.lang.Object
-
- org.apache.uima.collection.impl.cpm.container.ServiceProxyPool
-
public class ServiceProxyPool extends java.lang.ObjectPool containing and managing instances of CasProcessors. Managed by the container the pool facilitates check out and check in of Cas Processors.
-
-
Constructor Summary
Constructors Constructor Description ServiceProxyPool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCasProcessor(CasProcessor aCasProcessor)voidcheckIn(CasProcessor aResource)Checks in a Resource to the pool.CasProcessorcheckOut()Checks out a Resource from the pool.CasProcessorcheckOut(long aTimeout)Checks out a Resource from the pool.voiddestroy()Destroys all Resources in this pool.intgetAllInstanceCount()intgetSize()Gets the available size of this pool (the number of free, available instances at this moment).
-
-
-
Method Detail
-
checkOut
public CasProcessor checkOut()
Checks out a Resource from the pool.- Returns:
- a Resource for use by the client. Returns
nullif none are available (in which case the client may wait on this object in order to be notified when an instance becomes available).
-
checkIn
public void checkIn(CasProcessor aResource)
Checks in a Resource to the pool. Also notifies other Threads that may be waiting for available instance.- Parameters:
aResource- - instance of the CasProcessor to check in
-
checkOut
public CasProcessor checkOut(long aTimeout)
Checks out a Resource from the pool. If none is currently available, wait for the specified amount of time for one to be checked in.- Parameters:
aTimeout- the time to wait in milliseconds. A value of <=0 will wait forever.- Returns:
- a Resource for use by the client. Returns
nullif none are available (in which case the client may wait on this object in order to be notified when an instance becomes available).
-
destroy
public void destroy()
Destroys all Resources in this pool.
-
getSize
public int getSize()
Gets the available size of this pool (the number of free, available instances at this moment).- Returns:
- the available size of this pool
-
addCasProcessor
public void addCasProcessor(CasProcessor aCasProcessor)
-
getAllInstanceCount
public int getAllInstanceCount()
-
-