public abstract class BaseHttpCommandExecutorService<Q> extends Object implements HttpCommandExecutorService
Modifier and Type | Class and Description |
---|---|
class |
BaseHttpCommandExecutorService.HttpResponseCallable |
Modifier and Type | Field and Description |
---|---|
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 |
Modifier | Constructor and Description |
---|---|
protected |
BaseHttpCommandExecutorService(HttpUtils utils,
ContentMetadataCodec contentMetadataCodec,
com.google.common.util.concurrent.ListeningExecutorService ioExecutor,
DelegatingRetryHandler retryHandler,
IOExceptionRetryHandler ioRetryHandler,
DelegatingErrorHandler errorHandler,
HttpWire wire) |
Modifier and Type | Method and Description |
---|---|
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 . |
protected final HttpUtils utils
protected final ContentMetadataCodec contentMetadataCodec
protected final DelegatingRetryHandler retryHandler
protected final IOExceptionRetryHandler ioRetryHandler
protected final DelegatingErrorHandler errorHandler
protected final com.google.common.util.concurrent.ListeningExecutorService ioExecutor
protected Logger logger
@Named(value="jclouds.headers") protected Logger headerLog
protected final HttpWire wire
@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)
public static InputStream consumeOnClose(InputStream in)
public HttpResponse invoke(HttpCommand command)
HttpCommandExecutorService
HttpResponse
from the server which responded to the
command
.invoke
in interface HttpCommandExecutorService
public com.google.common.util.concurrent.ListenableFuture<HttpResponse> submit(HttpCommand command)
HttpCommandExecutorService
HttpResponse
from a server responding to the
command
. The output ListenableFuture
need not be
done, making HttpCommandExecutorService
suitable for asynchronous derivations.submit
in interface HttpCommandExecutorService
protected abstract Q convert(HttpRequest request) throws IOException, InterruptedException
IOException
InterruptedException
protected abstract HttpResponse invoke(Q nativeRequest) throws IOException, InterruptedException
IOException
InterruptedException
protected abstract void cleanup(Q nativeResponse)
Copyright © 2009-2013 jclouds. All Rights Reserved.