com.gargoylesoftware.htmlunit.util
Class WebConnectionWrapper

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.util.WebConnectionWrapper
All Implemented Interfaces:
WebConnection
Direct Known Subclasses:
DebuggingWebConnection

public class WebConnectionWrapper
extends java.lang.Object
implements WebConnection

Provides a convenient implementation of the WebConnection interface that can be subclassed by developers wishing to adapt a particular WebConnection. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped web connection object.

Version:
$Revision: 1.3 $
Author:
Marc Guillemot

Constructor Summary
WebConnectionWrapper(WebConnection webConnection)
 Constructs a WebConnection object wrapping provided WebConnection.
 
Method Summary
 WebResponse getResponse(WebRequestSettings webRequestSettings)
 INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. The default behavior of this method is to return getResponse() on the wrapped connection object.
 org.apache.commons.httpclient.HttpState getState()
 INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. The default behavior of this method is to return getState() on the wrapped connection object.
 WebClient getWebClient()
 INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. The default behavior of this method is to return getWebClient() on the wrapped connection object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebConnectionWrapper

public WebConnectionWrapper(WebConnection webConnection)
                     throws java.lang.IllegalArgumentException
Constructs a WebConnection object wrapping provided WebConnection.

Parameters:
webConnection - the webConnection that does the real work
Throws:
java.lang.IllegalArgumentException - if the connection is null
Method Detail

getResponse

public WebResponse getResponse(WebRequestSettings webRequestSettings)
                        throws java.io.IOException
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Submits a request and retrieves a response. The default behavior of this method is to return getResponse() on the wrapped connection object.

Specified by:
getResponse in interface WebConnection
Parameters:
webRequestSettings - Settings to make the request with.
Returns:
The response to the request defined by the specified request settings.
Throws:
java.io.IOException - If an IO error occurs.

getState

public org.apache.commons.httpclient.HttpState getState()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Return the HttpState that is being used. The default behavior of this method is to return getState() on the wrapped connection object.

Specified by:
getState in interface WebConnection
Returns:
the state.

getWebClient

public WebClient getWebClient()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Return the web client. The default behavior of this method is to return getWebClient() on the wrapped connection object.

Specified by:
getWebClient in interface WebConnection
Returns:
The web client.


Copyright © 2003-2016 AppPerfect Corporation. All Rights Reserved.