org.jclouds.http.internal
Class JavaUrlHttpCommandExecutorService

java.lang.Object
  extended by org.jclouds.http.internal.BaseHttpCommandExecutorService<HttpURLConnection>
      extended by org.jclouds.http.internal.JavaUrlHttpCommandExecutorService
All Implemented Interfaces:
HttpCommandExecutorService

@Singleton
public class JavaUrlHttpCommandExecutorService
extends BaseHttpCommandExecutorService<HttpURLConnection>

Basic implementation of a HttpCommandExecutorService.

Author:
Adrian Cole

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jclouds.http.internal.BaseHttpCommandExecutorService
BaseHttpCommandExecutorService.HttpResponseCallable
 
Field Summary
protected  Logger logger
           
static String USER_AGENT
           
 
Fields inherited from class org.jclouds.http.internal.BaseHttpCommandExecutorService
headerLog, utils, wire
 
Constructor Summary
JavaUrlHttpCommandExecutorService(HttpUtils utils, ExecutorService ioWorkerExecutor, DelegatingRetryHandler retryHandler, IOExceptionRetryHandler ioRetryHandler, DelegatingErrorHandler errorHandler, HttpWire wire, HostnameVerifier verifier, com.google.common.base.Supplier<SSLContext> untrustedSSLContextProvider)
           
 
Method Summary
protected  void cleanup(HttpURLConnection connection)
          Only disconnect if there is no content, as disconnecting will throw away unconsumed content.
protected  HttpURLConnection convert(HttpRequest request)
           
protected  HttpResponse invoke(HttpURLConnection connection)
           
 
Methods inherited from class org.jclouds.http.internal.BaseHttpCommandExecutorService
consumeOnClose, submit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_AGENT

public static final String USER_AGENT

logger

protected Logger logger
Constructor Detail

JavaUrlHttpCommandExecutorService

@Inject
public JavaUrlHttpCommandExecutorService(HttpUtils utils,
                                                @Named(value="jclouds.io-worker-threads")
                                                ExecutorService ioWorkerExecutor,
                                                DelegatingRetryHandler retryHandler,
                                                IOExceptionRetryHandler ioRetryHandler,
                                                DelegatingErrorHandler errorHandler,
                                                HttpWire wire,
                                                @Named(value="untrusted")
                                                HostnameVerifier verifier,
                                                @Named(value="untrusted")
                                                com.google.common.base.Supplier<SSLContext> untrustedSSLContextProvider)
                                  throws SecurityException,
                                         NoSuchFieldException
Throws:
SecurityException
NoSuchFieldException
Method Detail

invoke

protected HttpResponse invoke(HttpURLConnection connection)
                       throws IOException,
                              InterruptedException
Specified by:
invoke in class BaseHttpCommandExecutorService<HttpURLConnection>
Throws:
IOException
InterruptedException

convert

protected HttpURLConnection convert(HttpRequest request)
                             throws IOException,
                                    InterruptedException
Specified by:
convert in class BaseHttpCommandExecutorService<HttpURLConnection>
Throws:
IOException
InterruptedException

cleanup

protected void cleanup(HttpURLConnection connection)
Only disconnect if there is no content, as disconnecting will throw away unconsumed content.

Specified by:
cleanup in class BaseHttpCommandExecutorService<HttpURLConnection>


Copyright © 2009-2012 jclouds. All Rights Reserved.