[infinispan-issues] [JBoss JIRA] Created: (ISPN-538) remove code duplication from HotRodOperationsImpl

Mircea Markus (JIRA) jira-events at lists.jboss.org
Mon Jul 12 11:06:47 EDT 2010


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: Manik Surtani


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