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 IConnectionThrottler
java.lang.InterruptedException
public int waitConnectionAvailable(IBreakCheck breakCheck) throws java.lang.InterruptedException, BreakException
waitConnectionAvailable
in interface IConnectionThrottler
java.lang.InterruptedException
BreakException
public IFetchThrottler getNewConnectionFetchThrottler()
getNewConnectionFetchThrottler
in interface IConnectionThrottler
public boolean noteReturnedConnection()
noteReturnedConnection
in interface IConnectionThrottler
public boolean checkDestroyPooledConnection()
checkDestroyPooledConnection
in interface IConnectionThrottler
public boolean checkExpireConnection()
checkExpireConnection
in interface IConnectionThrottler
public void noteConnectionReturnedToPool()
noteConnectionReturnedToPool
in interface IConnectionThrottler
public void noteConnectionDestroyed()
noteConnectionDestroyed
in interface IConnectionThrottler