public void doWork(RetryContext context) throws Exception
{
// Try validateConnection() rather than connect() which may be a less expensive operation while we're retrying.
if (validateConnections && context.getLastFailure() instanceof ConnectException)
{
Connectable failed = ((ConnectException) context.getLastFailure()).getFailed();
if (!failed.validateConnection(context).isOk())
{
throw new ConnectException(
MessageFactory.createStaticMessage("Still unable to connect to resource " + failed.getClass().getName()),
context.getLastFailure(), failed);
}
}
doConnect();