org.apache.commons.httpclient.params.HostParams Java Examples

The following examples show how to use org.apache.commons.httpclient.params.HostParams. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HostConfiguration.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private void init(final HostConfiguration hostConfiguration) {
    // wrap all of the assignments in a synchronized block to avoid
    // having to negotiate the monitor for each method call
    synchronized (hostConfiguration) {
        try {
            if (hostConfiguration.host != null) {
                this.host = (HttpHost) hostConfiguration.host.clone();
            } else {
                this.host = null;
            }
            if (hostConfiguration.proxyHost != null) {
                this.proxyHost = (ProxyHost) hostConfiguration.proxyHost.clone();
            } else {
                this.proxyHost = null;
            }
            this.localAddress = hostConfiguration.getLocalAddress();
            this.params = (HostParams)hostConfiguration.getParams().clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalArgumentException("Host configuration could not be cloned");
        }
    }        
}
 
Example #2
Source File: HostConfiguration.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 3 votes vote down vote up
/**
 * Assigns {@link HostParams HTTP protocol parameters} specific to this host.
 * 
 * @since 3.0
 * 
 * @see HostParams
 */
public void setParams(final HostParams params) {
    if (params == null) {
        throw new IllegalArgumentException("Parameters may not be null");
    }
    this.params = params;
}
 
Example #3
Source File: HostConfiguration.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * Returns {@link HostParams HTTP protocol parameters} associated with this host.
 *
 * @return HTTP parameters.
 *
 * @since 3.0
 */
public HostParams getParams() {
    return this.params;
}