com.mchange.v2.resourcepool
Interface ResourcePool

All Superinterfaces:
com.mchange.v1.util.ClosableResource
All Known Subinterfaces:
EventSupportingResourcePool

public interface ResourcePool
extends com.mchange.v1.util.ClosableResource


Nested Class Summary
static interface ResourcePool.Manager
           
 
Field Summary
static int KNOWN_AND_AVAILABLE
           
static int KNOWN_AND_CHECKED_OUT
           
static int UNKNOWN_OR_PURGED
           
 
Method Summary
 void checkinAll()
           
 void checkinResource(java.lang.Object resc)
           
 java.lang.Object checkoutResource()
           
 java.lang.Object checkoutResource(long timeout)
           
 void close()
           
 void close(boolean close_checked_out_resources)
           
 int getAvailableCount()
           
 int getAwaitingCheckinCount()
           
 long getEffectiveExpirationEnforcementDelay()
           
 int getExcludedCount()
           
 java.lang.Throwable getLastAcquisitionFailure()
           
 java.lang.Throwable getLastCheckinFailure()
           
 java.lang.Throwable getLastCheckoutFailure()
           
 java.lang.Throwable getLastIdleCheckFailure()
           
 java.lang.Throwable getLastResourceTestFailure()
           
 int getMaxPoolSize()
           
 int getMinPoolSize()
           
 int getNumCheckoutWaiters()
           
 long getNumFailedCheckins()
           
 long getNumFailedCheckouts()
           
 long getNumFailedIdleTests()
           
 int getPoolSize()
           
 long getStartTime()
           
 long getUpTime()
           
 void markBroken(java.lang.Object resc)
          Marks a resource as broken.
 void resetPool()
          Discards all resources managed by the pool and reacquires new resources to populate the pool.
 void setPoolSize(int size)
           
 int statusInPool(java.lang.Object resc)
           
 

Field Detail

KNOWN_AND_AVAILABLE

static final int KNOWN_AND_AVAILABLE
See Also:
Constant Field Values

KNOWN_AND_CHECKED_OUT

static final int KNOWN_AND_CHECKED_OUT
See Also:
Constant Field Values

UNKNOWN_OR_PURGED

static final int UNKNOWN_OR_PURGED
See Also:
Constant Field Values
Method Detail

checkoutResource

java.lang.Object checkoutResource()
                                  throws ResourcePoolException,
                                         java.lang.InterruptedException
Throws:
ResourcePoolException
java.lang.InterruptedException

checkoutResource

java.lang.Object checkoutResource(long timeout)
                                  throws TimeoutException,
                                         ResourcePoolException,
                                         java.lang.InterruptedException
Throws:
TimeoutException
ResourcePoolException
java.lang.InterruptedException

checkinResource

void checkinResource(java.lang.Object resc)
                     throws ResourcePoolException
Throws:
ResourcePoolException

checkinAll

void checkinAll()
                throws ResourcePoolException
Throws:
ResourcePoolException

statusInPool

int statusInPool(java.lang.Object resc)
                 throws ResourcePoolException
Throws:
ResourcePoolException

markBroken

void markBroken(java.lang.Object resc)
                throws ResourcePoolException
Marks a resource as broken. If the resource is checked in, it will be destroyed immediately. Otherwise, it will be destroyed on checkin.

Throws:
ResourcePoolException

getMinPoolSize

int getMinPoolSize()
                   throws ResourcePoolException
Throws:
ResourcePoolException

getMaxPoolSize

int getMaxPoolSize()
                   throws ResourcePoolException
Throws:
ResourcePoolException

getPoolSize

int getPoolSize()
                throws ResourcePoolException
Throws:
ResourcePoolException

setPoolSize

void setPoolSize(int size)
                 throws ResourcePoolException
Throws:
ResourcePoolException

getAvailableCount

int getAvailableCount()
                      throws ResourcePoolException
Throws:
ResourcePoolException

getExcludedCount

int getExcludedCount()
                     throws ResourcePoolException
Throws:
ResourcePoolException

getAwaitingCheckinCount

int getAwaitingCheckinCount()
                            throws ResourcePoolException
Throws:
ResourcePoolException

getEffectiveExpirationEnforcementDelay

long getEffectiveExpirationEnforcementDelay()
                                            throws ResourcePoolException
Throws:
ResourcePoolException

getStartTime

long getStartTime()
                  throws ResourcePoolException
Throws:
ResourcePoolException

getUpTime

long getUpTime()
               throws ResourcePoolException
Throws:
ResourcePoolException

getNumFailedCheckins

long getNumFailedCheckins()
                          throws ResourcePoolException
Throws:
ResourcePoolException

getNumFailedCheckouts

long getNumFailedCheckouts()
                           throws ResourcePoolException
Throws:
ResourcePoolException

getNumFailedIdleTests

long getNumFailedIdleTests()
                           throws ResourcePoolException
Throws:
ResourcePoolException

getNumCheckoutWaiters

int getNumCheckoutWaiters()
                          throws ResourcePoolException
Throws:
ResourcePoolException

getLastAcquisitionFailure

java.lang.Throwable getLastAcquisitionFailure()
                                              throws ResourcePoolException
Throws:
ResourcePoolException

getLastCheckinFailure

java.lang.Throwable getLastCheckinFailure()
                                          throws ResourcePoolException
Throws:
ResourcePoolException

getLastCheckoutFailure

java.lang.Throwable getLastCheckoutFailure()
                                           throws ResourcePoolException
Throws:
ResourcePoolException

getLastIdleCheckFailure

java.lang.Throwable getLastIdleCheckFailure()
                                            throws ResourcePoolException
Throws:
ResourcePoolException

getLastResourceTestFailure

java.lang.Throwable getLastResourceTestFailure()
                                               throws ResourcePoolException
Throws:
ResourcePoolException

resetPool

void resetPool()
               throws ResourcePoolException
Discards all resources managed by the pool and reacquires new resources to populate the pool. Current checked out resources will still be valid, and should still be checked into the pool (so the pool can destroy them).

Throws:
ResourcePoolException

close

void close()
           throws ResourcePoolException
Specified by:
close in interface com.mchange.v1.util.ClosableResource
Throws:
ResourcePoolException

close

void close(boolean close_checked_out_resources)
           throws ResourcePoolException
Throws:
ResourcePoolException