public class FailoverProxy extends Object implements InvocationHandler
Modifier and Type | Field and Description |
---|---|
ReentrantLock |
lock |
LruTraceCache |
traceCache |
Constructor and Description |
---|
FailoverProxy(Listener listener,
ReentrantLock lock,
LruTraceCache traceCache)
Proxy constructor.
|
Modifier and Type | Method and Description |
---|---|
Listener |
getListener() |
boolean |
hasToHandleFailover(SQLException exception)
Check if this Sqlerror is a connection exception. if that's the case, must be handle by
failover
error codes : 08000 : connection exception 08001 : SQL client unable to establish SQL
connection 08002 : connection name in use 08003 : connection does not exist 08004 : SQL server
rejected SQL connection 08006 : connection failure 08007 : transaction resolution unknown 70100
: connection was killed if error code is "1927"
|
Object |
invoke(Object proxy,
Method method,
Object[] args)
Proxy that catch Protocol call, to permit to catch errors and handle failover when multiple
hosts.
|
void |
reconnect()
Launch reconnect implementation.
|
public final ReentrantLock lock
public final LruTraceCache traceCache
public FailoverProxy(Listener listener, ReentrantLock lock, LruTraceCache traceCache) throws SQLException
listener
- failover implementation.lock
- synchronisation locktraceCache
- trace cacheSQLException
- if connection error occurpublic Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
proxy
- the current protocolmethod
- the called method on the protocolargs
- methods parametersThrowable
- the method throwed error if not catch by failoverpublic boolean hasToHandleFailover(SQLException exception)
error codes : 08000 : connection exception 08001 : SQL client unable to establish SQL connection 08002 : connection name in use 08003 : connection does not exist 08004 : SQL server rejected SQL connection 08006 : connection failure 08007 : transaction resolution unknown 70100 : connection was killed if error code is "1927"
exception
- the Exceptionpublic void reconnect() throws SQLException
SQLException
- exceptionpublic Listener getListener()
Copyright © 2020 mariadb.com. All rights reserved.