private Object handleFailOver ( SQLException qe , Method method , Object [ ] args , Protocol protocol ) throws Throwable { HostAddress failHostAddress = null ; boolean failIsMaster = true ; if ( protocol != null ) { failHostAddress = protocol . getHostAddress ( ) ; failIsMaster = protocol . isMasterConnection ( ) ; } HandleErrorResult handleErrorResult = listener . handleFailover ( qe , method , args , protocol ) ; if ( handleErrorResult . mustThrowError ) { listener . throwFailoverMessage ( failHostAddress , failIsMaster , qe , handleErrorResult . isReconnected ) ; } return handleErrorResult . resultObject ; }
After a connection exception launch failover .