[
https://jira.jboss.org/browse/ISPN-538?page=com.atlassian.jira.plugin.sys...
]
Mircea Markus edited comment on ISPN-538 at 7/14/10 12:11 PM:
--------------------------------------------------------------
Added a class hierarchy similar to the way commands look in core.
was (Author: mircea.markus):
added a class hierarchy.
remove code duplication from HotRodOperationsImpl
-------------------------------------------------
Key: ISPN-538
URL:
https://jira.jboss.org/browse/ISPN-538
Project: Infinispan
Issue Type: Feature Request
Reporter: Mircea Markus
Assignee: Mircea Markus
Fix For: 4.1.0.CR2
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 {
//to something here
} 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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira