com.mysql.jdbc
Class FailoverConnectionProxy
java.lang.Object
com.mysql.jdbc.LoadBalancingConnectionProxy
com.mysql.jdbc.FailoverConnectionProxy
- All Implemented Interfaces:
- PingTarget, java.lang.reflect.InvocationHandler
public class FailoverConnectionProxy
- extends LoadBalancingConnectionProxy
Methods inherited from class com.mysql.jdbc.LoadBalancingConnectionProxy |
addHost, addToGlobalBlacklist, addToGlobalBlacklist, createConnectionForHost, doPing, getActivePhysicalConnectionCount, getConnectionGroupProxyID, getCurrentActiveHost, getCurrentTransactionDuration, getGlobalBlacklist, getLastUsed, getTotalPhysicalConnectionCount, getTransactionCount, inTransaction, invoke, isGlobalBlacklistEnabled, proxyIfInterfaceIsJdbc, removeHost, removeHostWhenNotInUse, shouldExceptionTriggerFailover, syncSessionState |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
failedOver
boolean failedOver
hasTriedMaster
boolean hasTriedMaster
preferSlaveDuringFailover
boolean preferSlaveDuringFailover
queriesIssuedFailedOver
long queriesIssuedFailedOver
FailoverConnectionProxy
FailoverConnectionProxy(java.util.List<java.lang.String> hosts,
java.util.Properties props)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
createConnectionProxy
protected LoadBalancingConnectionProxy.ConnectionErrorFiringInvocationHandler createConnectionProxy(java.lang.Object toProxy)
- Overrides:
createConnectionProxy
in class LoadBalancingConnectionProxy
dealWithInvocationException
void dealWithInvocationException(java.lang.reflect.InvocationTargetException e)
throws java.sql.SQLException,
java.lang.Throwable,
java.lang.reflect.InvocationTargetException
- Overrides:
dealWithInvocationException
in class LoadBalancingConnectionProxy
- Throws:
java.sql.SQLException
java.lang.Throwable
java.lang.reflect.InvocationTargetException
invoke
public java.lang.Object invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.lang.Throwable
- Specified by:
invoke
in interface java.lang.reflect.InvocationHandler
- Overrides:
invoke
in class LoadBalancingConnectionProxy
- Throws:
java.lang.Throwable
invalidateCurrentConnection
void invalidateCurrentConnection()
throws java.sql.SQLException
- Description copied from class:
LoadBalancingConnectionProxy
- Closes current connection and removes it from required mappings.
- Overrides:
invalidateCurrentConnection
in class LoadBalancingConnectionProxy
- Throws:
java.sql.SQLException
pickNewConnection
protected void pickNewConnection()
throws java.sql.SQLException
- Description copied from class:
LoadBalancingConnectionProxy
- Picks the "best" connection to use for the next transaction based on the
BalanceStrategy in use.
- Overrides:
pickNewConnection
in class LoadBalancingConnectionProxy
- Throws:
java.sql.SQLException