handleConnectionFailure(delegate);
handleConnectionFailure(delegate, delegate.getRemotingConnection());
   public Object invoke(Invocation invocation) throws Throwable   {      Object returnObject = null;      boolean failure = false;      // Eventually retries in case of listed exceptions      for (int i = 0; i < MAX_IO_RETRY_COUNT; i++)      {         // We shouldn't have any calls being made while the failover is being executed         valve.isOpened(true);         if (i > 0)         {            log.info("Retrying a call " + i);         }         failure = false;         try         {            returnObject = invocation.invokeNext();         }         catch (CannotConnectException e)         {            log.error("Got an exception on HAAspect, retryCount=" + i, e);            failure = true;         }         catch (IOException e)         {            log.error("Got an exception on HAAspect, retryCount=" + i, e);            failure = true;         }         catch (Throwable e)         {            log.error("ValveAspect didn't catch the exception " + e + ", and it will be forwarded", e);            throw e;         }         if (!failure)         {            break;         }      }      if (failure)      {         handleConnectionFailure(delegate);         // if on the end we still have an exception there is nothing we can do besides throw an exception         // so, no retires on the failedOver Invocation         returnObject = invocation.invokeNext();      }      // if the object returned is another DelegateSupport, we will install the aspect on the returned object      return returnObject;   }