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"); } } }
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"); } } }
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"); } } }
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"); } } }
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"); } } }