-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
-
None
HotRodOperationsImpl - contain code duplication in the way retry is handled. Basically following logic is replicated through all operations:
Transport transport = getTransport(key, true);
int retryCount = 0;
do {
try
catch (TransportException te)
{ logErrorAndThrowExceptionIfNeeded(retryCount, te); }finally
{ releaseTransport(transport); }if (shouldRetry(retryCount))
{ transport = getTransport(key, false); } retryCount++;
} while (shouldRetry(retryCount));
throw new IllegalStateException("We should not reach here!");
This should be factorized in a TemplateMethod because: a - duplication is evil and b - duplication is more even in a reference implementation.