org.apache.wink.client
Class ApacheHttpClientConfig

java.lang.Object
  extended by org.apache.wink.client.ClientConfig
      extended by org.apache.wink.client.ApacheHttpClientConfig
All Implemented Interfaces:
java.lang.Cloneable

public class ApacheHttpClientConfig
extends ClientConfig

Configuration object that wraps Apache HttpClient as underling Http client. The following code snippet, demonstrates the typical usage:

      // create the client that uses Apache DefaultHttpClient as underling Http client. 
      RestClient client = new RestClient(new ApacheHttpClientConfig(new DefaultHttpClient()));
      
      // create the resource to make invocations on
      Resource resource = client.resource("http://myhost:80/my/service");
      
      // invoke GET on the resource and receive the response entity as a string
      String entity = resource.get(String.class);
      ...
 


Constructor Summary
ApacheHttpClientConfig()
           
ApacheHttpClientConfig(org.apache.http.client.HttpClient client)
           
 
Method Summary
protected  ConnectionHandler getConnectionHandler()
          Returns the client handler that acts as the connection handler.
 
Methods inherited from class org.apache.wink.client.ClientConfig
applications, clone, connectTimeout, followRedirects, getApplications, getConnectTimeout, getHandlers, getProxyHost, getProxyPort, getReadTimeout, handlers, isFollowRedirects, proxyHost, proxyPort, readTimeout
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApacheHttpClientConfig

public ApacheHttpClientConfig()

ApacheHttpClientConfig

public ApacheHttpClientConfig(org.apache.http.client.HttpClient client)
Method Detail

getConnectionHandler

protected ConnectionHandler getConnectionHandler()
Description copied from class: ClientConfig
Returns the client handler that acts as the connection handler. This handler is always the last handler on the chain and is automatically added to the end of the defined list of handlers.

This method should be overridden in order to provide an alternate connection handler.

Overrides:
getConnectionHandler in class ClientConfig
Returns:
the connection handler


Copyright © 2009 The Apache Software Foundation. All Rights Reserved.