org.infinispan.client.hotrod.impl.operations
Class RetryOnFailureOperation

java.lang.Object
  extended by org.infinispan.client.hotrod.impl.operations.HotRodOperation
      extended by org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation
All Implemented Interfaces:
HotRodConstants
Direct Known Subclasses:
AbstractKeyOperation, BulkGetOperation, ClearOperation, StatsOperation

@Immutable
public abstract class RetryOnFailureOperation
extends HotRodOperation

Base class for all the operations that need retry logic: if the operation fails due to connection problems, try with another available connection.

Since:
4.1
Author:
Mircea.Markus@jboss.com

Field Summary
protected  TransportFactory transportFactory
           
 
Fields inherited from class org.infinispan.client.hotrod.impl.operations.HotRodOperation
cacheName, flags, topologyId
 
Fields inherited from interface org.infinispan.client.hotrod.impl.protocol.HotRodConstants
BULK_GET_REQUEST, BULK_GET_RESPONSE, CLEAR_REQUEST, CLEAR_RESPONSE, CLIENT_INTELLIGENCE_BASIC, CLIENT_INTELLIGENCE_HASH_DISTRIBUTION_AWARE, CLIENT_INTELLIGENCE_TOPOLOGY_AWARE, COMMAND_TIMEOUT_STATUS, CONTAINS_KEY_REQUEST, CONTAINS_KEY_RESPONSE, DEFAULT_CACHE_NAME_BYTES, ERROR_RESPONSE, GET_REQUEST, GET_RESPONSE, GET_WITH_VERSION, GET_WITH_VERSION_RESPONSE, HOTROD_STRING_CHARSET, HOTROD_VERSION, INVALID_MAGIC_OR_MESSAGE_ID_STATUS, KEY_DOES_NOT_EXIST_STATUS, NO_ERROR_STATUS, NOT_PUT_REMOVED_REPLACED_STATUS, PING_REQUEST, PING_RESPONSE, PUT_IF_ABSENT_REQUEST, PUT_IF_ABSENT_RESPONSE, PUT_REQUEST, PUT_RESPONSE, REMOVE_IF_UNMODIFIED_REQUEST, REMOVE_IF_UNMODIFIED_RESPONSE, REMOVE_REQUEST, REMOVE_RESPONSE, REPLACE_IF_UNMODIFIED_REQUEST, REPLACE_IF_UNMODIFIED_RESPONSE, REPLACE_REQUEST, REPLACE_RESPONSE, REQUEST_MAGIC, REQUEST_PARSING_ERROR_STATUS, RESPONSE_MAGIC, SERVER_ERROR_STATUS, STATS_REQUEST, STATS_RESPONSE, UNKNOWN_COMMAND_STATUS, UNKNOWN_VERSION_STATUS
 
Constructor Summary
protected RetryOnFailureOperation(TransportFactory transportFactory, byte[] cacheName, AtomicInteger topologyId, Flag[] flags)
           
 
Method Summary
 Object execute()
           
protected abstract  Object executeOperation(Transport transport)
           
protected abstract  Transport getTransport(int retryCount)
           
protected  void logErrorAndThrowExceptionIfNeeded(int i, TransportException te)
           
protected  void releaseTransport(Transport transport)
           
protected  boolean shouldRetry(int retryCount)
           
 
Methods inherited from class org.infinispan.client.hotrod.impl.operations.HotRodOperation
checkForErrorsInResponseStatus, readHeaderAndValidate, writeHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transportFactory

protected final TransportFactory transportFactory
Constructor Detail

RetryOnFailureOperation

protected RetryOnFailureOperation(TransportFactory transportFactory,
                                  byte[] cacheName,
                                  AtomicInteger topologyId,
                                  Flag[] flags)
Method Detail

execute

public Object execute()
Specified by:
execute in class HotRodOperation

shouldRetry

protected boolean shouldRetry(int retryCount)

logErrorAndThrowExceptionIfNeeded

protected void logErrorAndThrowExceptionIfNeeded(int i,
                                                 TransportException te)

releaseTransport

protected void releaseTransport(Transport transport)

getTransport

protected abstract Transport getTransport(int retryCount)

executeOperation

protected abstract Object executeOperation(Transport transport)

Google Analytics

Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.