1 package org.apache.commons.httpclient.contrib.ssl; 2 3 import org.apache.commons.httpclient.HostConfiguration; 4 import org.apache.commons.httpclient.HttpURL; 5 import org.apache.commons.httpclient.protocol.Protocol; 6 7 23 class HostConfigurationWithHostFactory extends HostConfiguration 24 { 25 public HostConfigurationWithHostFactory(HttpHostFactory factory) 26 { 27 this.factory = factory; 28 } 29 30 private HostConfigurationWithHostFactory(HostConfigurationWithHostFactory that) 31 { 32 super(that); 33 this.factory = that.factory; 34 } 35 36 private final HttpHostFactory factory; 37 38 public Object clone() 39 { 40 return new HostConfigurationWithHostFactory(this); 41 } 42 43 private static final String DEFAULT_SCHEME = new String (HttpURL.DEFAULT_SCHEME); 44 45 public void setHost(String host) 46 { 47 setHost(host, Protocol.getProtocol(DEFAULT_SCHEME).getDefaultPort()); 48 } 49 50 public void setHost(final String host, int port) 51 { 52 setHost(host, port, DEFAULT_SCHEME); 53 } 54 55 public synchronized void setHost(String host, int port, String scheme) 56 { 57 setHost(factory.getHost(this, scheme, host, port)); 58 } 59 60 } 61 | Popular Tags |