org.jclouds.http.internal
Class BaseHttpCommandExecutorService<Q>

java.lang.Object
  extended by org.jclouds.http.internal.BaseHttpCommandExecutorService<Q>
All Implemented Interfaces:
HttpCommandExecutorService
Direct Known Subclasses:
JavaUrlHttpCommandExecutorService

public abstract class BaseHttpCommandExecutorService<Q>
extends Object
implements HttpCommandExecutorService

Author:
Adrian Cole

Nested Class Summary
 class BaseHttpCommandExecutorService.HttpResponseCallable
           
 
Field Summary
protected  ContentMetadataCodec contentMetadataCodec
           
protected  DelegatingErrorHandler errorHandler
           
protected  Logger headerLog
           
protected  com.google.common.util.concurrent.ListeningExecutorService ioExecutor
           
protected  IOExceptionRetryHandler ioRetryHandler
           
protected  Logger logger
           
protected  DelegatingRetryHandler retryHandler
           
protected  HttpUtils utils
           
protected  HttpWire wire
           
 
Constructor Summary
protected BaseHttpCommandExecutorService(HttpUtils utils, ContentMetadataCodec contentMetadataCodec, com.google.common.util.concurrent.ListeningExecutorService ioExecutor, DelegatingRetryHandler retryHandler, IOExceptionRetryHandler ioRetryHandler, DelegatingErrorHandler errorHandler, HttpWire wire)
           
 
Method Summary
protected abstract  void cleanup(Q nativeResponse)
           
static InputStream consumeOnClose(InputStream in)
           
protected abstract  Q convert(HttpRequest request)
           
 HttpResponse invoke(HttpCommand command)
          Returns a HttpResponse from the server which responded to the command.
protected abstract  HttpResponse invoke(Q nativeRequest)
           
 com.google.common.util.concurrent.ListenableFuture<HttpResponse> submit(HttpCommand command)
          Returns a potentially deferred HttpResponse from a server responding to the command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

utils

protected final HttpUtils utils

contentMetadataCodec

protected final ContentMetadataCodec contentMetadataCodec

retryHandler

protected final DelegatingRetryHandler retryHandler

ioRetryHandler

protected final IOExceptionRetryHandler ioRetryHandler

errorHandler

protected final DelegatingErrorHandler errorHandler

ioExecutor

protected final com.google.common.util.concurrent.ListeningExecutorService ioExecutor

logger

protected Logger logger

headerLog

@Named(value="jclouds.headers")
protected Logger headerLog

wire

protected final HttpWire wire
Constructor Detail

BaseHttpCommandExecutorService

@Inject
protected BaseHttpCommandExecutorService(HttpUtils utils,
                                                ContentMetadataCodec contentMetadataCodec,
                                                @Named(value="jclouds.io-worker-threads")
                                                com.google.common.util.concurrent.ListeningExecutorService ioExecutor,
                                                DelegatingRetryHandler retryHandler,
                                                IOExceptionRetryHandler ioRetryHandler,
                                                DelegatingErrorHandler errorHandler,
                                                HttpWire wire)
Method Detail

consumeOnClose

public static InputStream consumeOnClose(InputStream in)

invoke

public HttpResponse invoke(HttpCommand command)
Description copied from interface: HttpCommandExecutorService
Returns a HttpResponse from the server which responded to the command.

Specified by:
invoke in interface HttpCommandExecutorService

submit

public com.google.common.util.concurrent.ListenableFuture<HttpResponse> submit(HttpCommand command)
Description copied from interface: HttpCommandExecutorService
Returns a potentially deferred HttpResponse from a server responding to the command. The output ListenableFuture need not be done, making HttpCommandExecutorService suitable for asynchronous derivations.

Specified by:
submit in interface HttpCommandExecutorService

convert

protected abstract Q convert(HttpRequest request)
                      throws IOException,
                             InterruptedException
Throws:
IOException
InterruptedException

invoke

protected abstract HttpResponse invoke(Q nativeRequest)
                                throws IOException,
                                       InterruptedException
Throws:
IOException
InterruptedException

cleanup

protected abstract void cleanup(Q nativeResponse)


Copyright © 2009-2013 jclouds. All Rights Reserved.