protected static class Throttler.ConnectionThrottler extends java.lang.Object implements IConnectionThrottler
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String[] |
binNames |
protected Throttler.ThrottlingGroup |
parent |
protected java.util.concurrent.atomic.AtomicInteger[] |
poolCounts |
_rcsid, CONNECTION_FROM_CREATION, CONNECTION_FROM_NOWHERE, CONNECTION_FROM_POOL| Constructor and Description |
|---|
ConnectionThrottler(Throttler.ThrottlingGroup parent,
java.lang.String[] binNames) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkDestroyPooledConnection()
This method calculates whether a connection should be taken from the pool and destroyed
/* in order to meet quota requirements.
|
boolean |
checkExpireConnection()
Connection expiration is tricky, because even though a connection may be identified as
being expired, at the very same moment it could be handed out in another thread.
|
IFetchThrottler |
getNewConnectionFetchThrottler()
For a new connection, obtain the fetch throttler to use for the connection.
|
void |
noteConnectionDestroyed()
Note that a connection has been destroyed.
|
void |
noteConnectionReturnedToPool()
Note that a connection has been returned to the pool.
|
boolean |
noteReturnedConnection()
For returning a connection from use, there is only one method.
|
int |
waitConnectionAvailable()
Get permission to grab a connection for use.
|
int |
waitConnectionAvailable(IBreakCheck breakCheck)
Get permission to grab a connection for use.
|
protected final Throttler.ThrottlingGroup parent
protected final java.lang.String[] binNames
protected final java.util.concurrent.atomic.AtomicInteger[] poolCounts
public ConnectionThrottler(Throttler.ThrottlingGroup parent, java.lang.String[] binNames)
public int waitConnectionAvailable()
throws java.lang.InterruptedException
waitConnectionAvailable in interface IConnectionThrottlerjava.lang.InterruptedExceptionpublic int waitConnectionAvailable(IBreakCheck breakCheck) throws java.lang.InterruptedException, BreakException
waitConnectionAvailable in interface IConnectionThrottlerjava.lang.InterruptedExceptionBreakExceptionpublic IFetchThrottler getNewConnectionFetchThrottler()
getNewConnectionFetchThrottler in interface IConnectionThrottlerpublic boolean noteReturnedConnection()
noteReturnedConnection in interface IConnectionThrottlerpublic boolean checkDestroyPooledConnection()
checkDestroyPooledConnection in interface IConnectionThrottlerpublic boolean checkExpireConnection()
checkExpireConnection in interface IConnectionThrottlerpublic void noteConnectionReturnedToPool()
noteConnectionReturnedToPool in interface IConnectionThrottlerpublic void noteConnectionDestroyed()
noteConnectionDestroyed in interface IConnectionThrottler