Class ServiceProxyPool
java.lang.Object
org.apache.uima.collection.impl.cpm.container.ServiceProxyPool
Pool containing and managing instances of CasProcessors. Managed by the container the pool
facilitates check out and check in of Cas Processors.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCasProcessor
(CasProcessor aCasProcessor) void
checkIn
(CasProcessor aResource) Checks in a Resource to the pool.checkOut()
Checks out a Resource from the pool.checkOut
(long aTimeout) Checks out a Resource from the pool.void
destroy()
Destroys all Resources in this pool.int
int
getSize()
Gets the available size of this pool (the number of free, available instances at this moment).
-
Constructor Details
-
ServiceProxyPool
public ServiceProxyPool()
-
-
Method Details
-
checkOut
Checks out a Resource from the pool.- Returns:
- a Resource for use by the client. Returns
null
if none are available (in which case the client may wait on this object in order to be notified when an instance becomes available).
-
checkIn
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
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
null
if 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
-
getAllInstanceCount
public int getAllInstanceCount()
-