public void foundActiveSecondary ( Protocol newSecondaryProtocol ) throws SQLException { if ( isSecondaryHostFail ( ) ) { if ( isExplicitClosed ( ) ) { newSecondaryProtocol . close ( ) ; return ; } if ( proxy . lock . tryLock ( ) ) { try { lockAndSwitchSecondary ( newSecondaryProtocol ) ; } finally { proxy . lock . unlock ( ) ; } } else { if ( ! waitNewSecondaryProtocol . compareAndSet ( null , newSecondaryProtocol ) ) { newSecondaryProtocol . close ( ) ; } } } else { newSecondaryProtocol . close ( ) ; } }
Method called when a new secondary connection is found after a fallback .