org.apache.wink.client.httpclient
Class ApacheHttpClientConfig

java.lang.Object
  extended by org.apache.wink.client.ClientConfig
      extended by org.apache.wink.client.httpclient.ApacheHttpClientConfig
All Implemented Interfaces:
Cloneable, org.apache.wink.common.internal.WinkConfiguration
Direct Known Subclasses:
ApacheHttpClientConfig

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);
      ...
 


Field Summary
protected  boolean chunked
           
protected  org.apache.http.client.HttpClient client
           
protected  int maxPooledConnections
           
 
Constructor Summary
ApacheHttpClientConfig()
           
ApacheHttpClientConfig(org.apache.http.client.HttpClient client)
           
 
Method Summary
protected  ConnectionHandler getConnectionHandler()
           
 int getMaxPooledConnections()
           
 boolean isChunked()
           
 void setChunked(boolean chunked)
           
 void setMaxPooledConnections(int maxPooledConnections)
           
 
Methods inherited from class org.apache.wink.client.ClientConfig
acceptHeaderAutoSet, applications, clone, connectTimeout, followRedirects, getApplications, getBypassHostnameVerification, getConnectTimeout, getHandlers, getProperties, getProxyHost, getProxyPort, getReadTimeout, handlers, isAcceptHeaderAutoSet, isFollowRedirects, isLoadWinkApplications, isSupportDTDExpansion, proxyHost, proxyPort, readTimeout, setBypassHostnameVerification, setLoadWinkApplications, setProperties, supportDTDExpansion
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

client

protected org.apache.http.client.HttpClient client

maxPooledConnections

protected int maxPooledConnections

chunked

protected boolean chunked
Constructor Detail

ApacheHttpClientConfig

public ApacheHttpClientConfig()

ApacheHttpClientConfig

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

getConnectionHandler

protected ConnectionHandler getConnectionHandler()
Overrides:
getConnectionHandler in class ClientConfig

setMaxPooledConnections

public void setMaxPooledConnections(int maxPooledConnections)

getMaxPooledConnections

public int getMaxPooledConnections()

isChunked

public boolean isChunked()

setChunked

public void setChunked(boolean chunked)


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