public class MastersFailoverListener extends AbstractMastersListener
AbstractMastersListener.FailLoopblacklist, currentConnectionAttempts, currentProtocol, currentReadOnlyAsked, executorService, explicitClosed, isLooping, jdbcUrl, lastRetry, proxy, scheduledFailover| Constructor and Description |
|---|
MastersFailoverListener(JDBCUrl jdbcUrl) |
| Modifier and Type | Method and Description |
|---|---|
void |
foundActiveMaster(Protocol protocol)
method called when a new Master connection is found after a fallback
|
void |
initializeConnection() |
void |
preClose() |
void |
preExecute() |
HandleErrorResult |
primaryFail(Method method,
Object[] args) |
void |
reconnect() |
void |
reconnectFailedConnection(SearchFilter searchFilter)
Loop to connect
|
boolean |
shouldReconnect() |
void |
switchReadOnlyConnection(Boolean mustBeReadOnly) |
void |
throwFailoverMessage(QueryException queryException,
boolean reconnected)
Throw a human readable message after a failoverException
|
addToBlacklist, getBlacklist, getCurrentProtocol, getFilterForFailedHost, getJdbcUrl, getMasterHostFailTimestamp, getProxy, getRetriesAllDown, handleFailover, hasHostFail, invoke, isAutoReconnect, isClosed, isExplicitClosed, isMasterHostFail, isReadOnly, launchFailLoopIfNotlaunched, relaunchOperation, resetMasterFailoverData, resetOldsBlackListHosts, setExplicitClosed, setMasterHostFail, setProxy, setSessionReadOnly, stopFailover, syncConnectionpublic MastersFailoverListener(JDBCUrl jdbcUrl)
public void initializeConnection()
throws QueryException
initializeConnection in interface ListenerinitializeConnection in class AbstractMastersListenerQueryExceptionpublic void preExecute()
throws QueryException
preExecute in interface ListenerpreExecute in class AbstractMastersListenerQueryExceptionpublic boolean shouldReconnect()
shouldReconnect in interface ListenershouldReconnect in class AbstractMastersListenerpublic void preClose()
throws SQLException
preClose in interface ListenerpreClose in class AbstractMastersListenerSQLExceptionpublic HandleErrorResult primaryFail(Method method, Object[] args) throws Throwable
primaryFail in interface ListenerprimaryFail in class AbstractMastersListenerThrowablepublic void reconnectFailedConnection(SearchFilter searchFilter) throws QueryException
reconnectFailedConnection in interface ListenerreconnectFailedConnection in class AbstractMastersListenerQueryException - if there is any error during reconnectionQueryException - sqlExceptionpublic void switchReadOnlyConnection(Boolean mustBeReadOnly) throws QueryException
switchReadOnlyConnection in interface ListenerswitchReadOnlyConnection in class AbstractMastersListenerQueryExceptionpublic void foundActiveMaster(Protocol protocol) throws QueryException
protocol - the new active connectionQueryExceptionpublic void throwFailoverMessage(QueryException queryException, boolean reconnected) throws QueryException
throwFailoverMessage in interface ListenerthrowFailoverMessage in class AbstractMastersListenerqueryException - internal errorreconnected - connection statusQueryException - error with failover informationpublic void reconnect()
throws QueryException
reconnect in interface Listenerreconnect in class AbstractMastersListenerQueryExceptionCopyright © 2015. All rights reserved.