org.apache.uima.collection.impl.cpm.container
Class ServiceProxyPool

java.lang.Object
  extended by org.apache.uima.collection.impl.cpm.container.ServiceProxyPool

public class ServiceProxyPool
extends java.lang.Object

Pool containing and managing instances of CasProcessors. Managed by the container the pool facilitates check out and check in of Cas Processors.


Constructor Summary
ServiceProxyPool()
           
 
Method Summary
 void addCasProcessor(CasProcessor aCasProcessor)
           
 void checkIn(CasProcessor aResource)
          Checks in a Resource to the pool.
 CasProcessor checkOut()
          Checks out a Resource from the pool.
 CasProcessor checkOut(long aTimeout)
          Checks out a Resource from the pool.
 void destroy()
          Destroys all Resources in this pool.
 int getAllInstanceCount()
           
 int getSize()
          Gets the available size of this pool (the number of free, available instances at this moment).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceProxyPool

public ServiceProxyPool()
Method Detail

checkOut

public CasProcessor 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

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 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

public void addCasProcessor(CasProcessor aCasProcessor)

getAllInstanceCount

public int getAllInstanceCount()


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.