Package 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
Nested Classes Modifier and Type Interface Description static interfaceResourcePool.Manager
-
Field Summary
Fields Modifier and Type Field Description static intKNOWN_AND_AVAILABLEstatic intKNOWN_AND_CHECKED_OUTstatic intUNKNOWN_OR_PURGED
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckinAll()voidcheckinResource(java.lang.Object resc)java.lang.ObjectcheckoutResource()java.lang.ObjectcheckoutResource(long timeout)voidclose()voidclose(boolean close_checked_out_resources)intgetAvailableCount()intgetAwaitingCheckinCount()intgetAwaitingCheckinNotExcludedCount()longgetEffectiveExpirationEnforcementDelay()intgetExcludedCount()java.lang.ThrowablegetLastAcquisitionFailure()java.lang.ThrowablegetLastCheckinFailure()java.lang.ThrowablegetLastCheckoutFailure()java.lang.ThrowablegetLastIdleCheckFailure()java.lang.ThrowablegetLastResourceTestFailure()intgetMaxPoolSize()intgetMinPoolSize()intgetNumCheckoutWaiters()longgetNumFailedCheckins()longgetNumFailedCheckouts()longgetNumFailedIdleTests()intgetPoolSize()longgetStartTime()longgetUpTime()voidmarkBroken(java.lang.Object resc)Marks a resource as broken.voidresetPool()Discards all resources managed by the pool and reacquires new resources to populate the pool.voidsetPoolSize(int size)intstatusInPool(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:
ResourcePoolExceptionjava.lang.InterruptedException
-
checkoutResource
java.lang.Object checkoutResource(long timeout) throws TimeoutException, ResourcePoolException, java.lang.InterruptedException- Throws:
TimeoutExceptionResourcePoolExceptionjava.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 ResourcePoolExceptionMarks 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
-
getAwaitingCheckinNotExcludedCount
int getAwaitingCheckinNotExcludedCount() 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 ResourcePoolExceptionDiscards 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:
closein interfacecom.mchange.v1.util.ClosableResource- Throws:
ResourcePoolException
-
close
void close(boolean close_checked_out_resources) throws ResourcePoolException- Throws:
ResourcePoolException
-
-