[infinispan-issues] [JBoss JIRA] Resolved: (ISPN-538) remove code duplication from HotRodOperationsImpl
Mircea Markus (JIRA)
jira-events at lists.jboss.org
Wed Jul 14 12:10:59 EDT 2010
[ https://jira.jboss.org/browse/ISPN-538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mircea Markus resolved ISPN-538.
--------------------------------
Fix Version/s: 4.1.0.CR2
Resolution: Done
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
More information about the infinispan-issues
mailing list