@Override
	public boolean canRetry(RetryContext context) {
		Throwable candidate = context.getLastThrowable();
		if (candidate == null) {
			return true;
		}
		return context.getRetryCount() <= this.maxNumberOfRetries
				&& isRetryAbleException(candidate);
	}
@ Override public boolean canRetry ( RetryContext context ) { Throwable candidate = context . getLastThrowable ( ) ; if ( candidate == null ) { return true ; } return context . getRetryCount ( ) <= this . maxNumberOfRetries && isRetryAbleException ( candidate ) ; }
Returns if this method is retryable based on the {@link RetryContext}. If there is
no Throwable registered, then this method returns <code>true</code> without
checking any further conditions. If there is a Throwable registered, this class
checks if the registered Throwable is a retryable Exception in the context of SQL
exception. If not successful, this class also checks the cause if there is a nested
retryable exception available.
<p>
Before checking exception this class checks that the current retry count (fetched
through {@link org.springframework.retry.RetryContext#getRetryCount()} is smaller
or equals to the {@link #maxNumberOfRetries}
</p>
@param context - the retry context holding information about the retryable
operation (number of retries, throwable if any)
@return <code>true</code> if there is no throwable registered, if there is a
retryable exception and the number of maximum numbers of retries have not been
reached.