|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.net.URLConnection java.net.HttpURLConnection sun.net.www.protocol.http.HttpURLConnection com.sun.faban.driver.transport.sunhttp.HttpURLConnection
public class HttpURLConnection
Faban's implementation of HttpURLConnection relies heavily on the sun.net implementation. It is actually a subclass that creates instances of faban's HttpClient instead of the sun.net version. It also opens up the interface for clients to use a custom SocketFactory. This HttpURLConnection serves both http and https connections.
Field Summary |
---|
Fields inherited from class sun.net.www.protocol.http.HttpURLConnection |
---|
cachedResponse, handler, http, instProxy, pi, ps, userAgent |
Fields inherited from class java.net.URLConnection |
---|
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches |
Constructor Summary | |
---|---|
protected |
HttpURLConnection(URL url,
Proxy proxy,
Handler handler)
Creates a connection. |
Method Summary | |
---|---|
static SocketFactory |
getDefaultSocketFactory()
Gets the default static SocketFactory that is
inherited by new instances of this class. |
protected HttpClient |
getNewHttpClient(URL url,
Proxy p,
int connectTimeout)
|
SocketFactory |
getSocketFactory()
Gets the socket factory to be used when creating sockets for secure https URL connections. |
protected void |
proxiedConnect(URL url,
String proxyHost,
int proxyPort,
boolean useCache)
Connects via proxy. |
static void |
setDefaultSocketFactory(SocketFactory sf)
Sets the default SocketFactory inherited by new
instances of this class. |
protected void |
setNewClient(URL url,
boolean useCache)
Obtain a HttpClient object. |
void |
setSocketFactory(SocketFactory sf)
Sets the SocketFactory to be used when this instance
creates sockets for secure https URL connections. |
Methods inherited from class sun.net.www.protocol.http.HttpURLConnection |
---|
addRequestProperty, connect, disconnect, doTunneling, finalize, getConnectTimeout, getErrorStream, getHeaderField, getHeaderField, getHeaderFieldKey, getHeaderFields, getInputStream, getNewHttpClient, getOutputStream, getReadTimeout, getRequestProperties, getRequestProperty, openConnectionCheckRedirects, plainConnect, setConnectTimeout, setDefaultAuthenticator, setNewClient, setProxiedClient, setProxiedClient, setReadTimeout, setRequestProperty, usingProxy |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected HttpURLConnection(URL url, Proxy proxy, Handler handler)
url
- The target URLproxy
- Proxy, if anyhandler
- The protocol handlerMethod Detail |
---|
protected void setNewClient(URL url, boolean useCache) throws IOException
setNewClient
in class sun.net.www.protocol.http.HttpURLConnection
url
- the URL being accesseduseCache
- whether the cached connection should be used
if present
IOException
- Communication errorprotected void proxiedConnect(URL url, String proxyHost, int proxyPort, boolean useCache) throws IOException
proxiedConnect
in class sun.net.www.protocol.http.HttpURLConnection
url
- The URL to connectproxyHost
- The proxy hostproxyPort
- The proxy portuseCache
- Whether to use cached connections
IOException
- Communication errorprotected HttpClient getNewHttpClient(URL url, Proxy p, int connectTimeout) throws IOException
getNewHttpClient
in class sun.net.www.protocol.http.HttpURLConnection
IOException
public static void setDefaultSocketFactory(SocketFactory sf)
SocketFactory
inherited by new
instances of this class.
The socket factories are used when creating sockets for secure https URL connections.
sf
- the default socket factory
IllegalArgumentException
- if the SocketFactory
parameter is null.getDefaultSocketFactory()
public static SocketFactory getDefaultSocketFactory()
SocketFactory
that is
inherited by new instances of this class.
The socket factories are used when creating sockets for secure https URL connections.
SocketFactory
setDefaultSocketFactory(SocketFactory)
public void setSocketFactory(SocketFactory sf)
SocketFactory
to be used when this instance
creates sockets for secure https URL connections.
New instances of this class inherit the default static
SocketFactory
set by
setDefaultSocketFactory
. Calls to this method replace
this object's SocketFactory
.
sf
- the socket factory
IllegalArgumentException
- if the SocketFactory
parameter is null.getSocketFactory()
public SocketFactory getSocketFactory()
SocketFactory
setSocketFactory(SocketFactory)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |