org.jclouds.http.handlers
Class DelegatingRetryHandler

java.lang.Object
  extended by org.jclouds.http.handlers.DelegatingRetryHandler
All Implemented Interfaces:
HttpRetryHandler

@Singleton
public class DelegatingRetryHandler
extends Object
implements HttpRetryHandler

Delegates to HttpRetryHandlers who are annotated according to the response codes they relate to.

Author:
Adrian Cole

Field Summary
 
Fields inherited from interface org.jclouds.http.HttpRetryHandler
ALWAYS_RETRY, NEVER_RETRY
 
Constructor Summary
DelegatingRetryHandler(BackoffLimitedRetryHandler backOff, RedirectionRetryHandler redirectionRetryHandler)
           
 
Method Summary
 HttpRetryHandler getClientErrorRetryHandler()
           
 HttpRetryHandler getRedirectionRetryHandler()
           
 HttpRetryHandler getServerErrorRetryHandler()
           
 boolean shouldRetryRequest(HttpCommand command, HttpResponse response)
          Return true if the command should be retried.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingRetryHandler

@Inject
public DelegatingRetryHandler(BackoffLimitedRetryHandler backOff,
                                     RedirectionRetryHandler redirectionRetryHandler)
Method Detail

shouldRetryRequest

public boolean shouldRetryRequest(HttpCommand command,
                                  HttpResponse response)
Description copied from interface: HttpRetryHandler
Return true if the command should be retried. This method should only be invoked when the response has failed with a HTTP 5xx error indicating a server-side error.

Specified by:
shouldRetryRequest in interface HttpRetryHandler

getRedirectionRetryHandler

public HttpRetryHandler getRedirectionRetryHandler()

getClientErrorRetryHandler

public HttpRetryHandler getClientErrorRetryHandler()

getServerErrorRetryHandler

public HttpRetryHandler getServerErrorRetryHandler()


Copyright © 2009-2011 jclouds. All Rights Reserved.