com.mysql.jdbc
public class FailoverConnectionProxy extends LoadBalancingConnectionProxy
Modifier and Type | Class and Description |
---|---|
(package private) class |
FailoverConnectionProxy.FailoverInvocationHandler |
LoadBalancingConnectionProxy.ConnectionErrorFiringInvocationHandler
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
failedOver |
(package private) boolean |
hasTriedMaster |
(package private) boolean |
preferSlaveDuringFailover |
(package private) long |
queriesIssuedFailedOver |
BLACKLIST_TIMEOUT_PROPERTY_KEY, closedReason, currentConn, hostList, isClosed, liveConnections
Constructor and Description |
---|
FailoverConnectionProxy(java.util.List<java.lang.String> hosts,
java.util.Properties props) |
Modifier and Type | Method and Description |
---|---|
protected LoadBalancingConnectionProxy.ConnectionErrorFiringInvocationHandler |
createConnectionProxy(java.lang.Object toProxy) |
(package private) void |
dealWithInvocationException(java.lang.reflect.InvocationTargetException e) |
(package private) void |
invalidateCurrentConnection()
Closes current connection and removes it from required mappings.
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args) |
protected void |
pickNewConnection()
Picks the "best" connection to use for the next transaction based on the
BalanceStrategy in use.
|
addHost, addToGlobalBlacklist, addToGlobalBlacklist, createConnectionForHost, doPing, getActivePhysicalConnectionCount, getConnectionGroupProxyID, getCurrentActiveHost, getCurrentTransactionDuration, getGlobalBlacklist, getLastUsed, getTotalPhysicalConnectionCount, getTransactionCount, inTransaction, invalidateConnection, invoke, isGlobalBlacklistEnabled, proxyIfInterfaceIsJdbc, removeHost, removeHostWhenNotInUse, shouldExceptionTriggerFailover, syncSessionState
boolean failedOver
boolean hasTriedMaster
boolean preferSlaveDuringFailover
long queriesIssuedFailedOver
FailoverConnectionProxy(java.util.List<java.lang.String> hosts, java.util.Properties props) throws java.sql.SQLException
java.sql.SQLException
protected LoadBalancingConnectionProxy.ConnectionErrorFiringInvocationHandler createConnectionProxy(java.lang.Object toProxy)
createConnectionProxy
in class LoadBalancingConnectionProxy
void dealWithInvocationException(java.lang.reflect.InvocationTargetException e) throws java.sql.SQLException, java.lang.Throwable, java.lang.reflect.InvocationTargetException
dealWithInvocationException
in class LoadBalancingConnectionProxy
java.sql.SQLException
java.lang.Throwable
java.lang.reflect.InvocationTargetException
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
invoke
in interface java.lang.reflect.InvocationHandler
invoke
in class LoadBalancingConnectionProxy
java.lang.Throwable
void invalidateCurrentConnection() throws java.sql.SQLException
LoadBalancingConnectionProxy
invalidateCurrentConnection
in class LoadBalancingConnectionProxy
java.sql.SQLException
protected void pickNewConnection() throws java.sql.SQLException
LoadBalancingConnectionProxy
pickNewConnection
in class LoadBalancingConnectionProxy
java.sql.SQLException