HTTPCLIENT-797:

* Removed javadoc comments about PlainSocketFactory having to be a singleton
* Removed overridden PlainSocketFactory#hashCode() and PlainSocketFactory#equals(). PlainSocketFactory should be using default Object implementation of those methods

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@698731 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2008-09-24 20:55:47 +00:00
parent 9f8564219e
commit 884a7cb69a
2 changed files with 11 additions and 30 deletions

View File

@ -48,7 +48,7 @@ import org.apache.http.params.HttpParams;
public final class PlainSocketFactory implements SocketFactory {
/**
* The factory singleton.
* The default factory.
*/
private static final
PlainSocketFactory DEFAULT_FACTORY = new PlainSocketFactory();
@ -56,8 +56,10 @@ public final class PlainSocketFactory implements SocketFactory {
private final HostNameResolver nameResolver;
/**
* Gets the singleton instance of this class.
* @return the one and only plain socket factory
* Gets the default factory. Usually there should be no reason for creating
* multiple instances of this class.
*
* @return the default factory
*/
public static PlainSocketFactory getSocketFactory() {
return DEFAULT_FACTORY;
@ -155,28 +157,4 @@ public final class PlainSocketFactory implements SocketFactory {
} // isSecure
/**
* Compares this factory with an object.
* There is only one instance of this class.
*
* @param obj the object to compare with
*
* @return iff the argument is this object
*/
@Override
public boolean equals(Object obj) {
return (obj == this);
}
/**
* Obtains a hash code for this object.
* All instances of this class have the same hash code.
* There is only one instance of this class.
*/
@Override
public int hashCode() {
return PlainSocketFactory.class.hashCode();
}
}

View File

@ -150,14 +150,17 @@ public class SSLSocketFactory implements LayeredSocketFactory {
public static final X509HostnameVerifier STRICT_HOSTNAME_VERIFIER
= new StrictHostnameVerifier();
/**
* The factory using the default JVM settings for secure connections.
* The default factory using the default JVM settings for secure connections.
*/
private static final SSLSocketFactory DEFAULT_FACTORY = new SSLSocketFactory();
/**
* Gets an singleton instance of the SSLProtocolSocketFactory.
* @return a SSLProtocolSocketFactory
* Gets the default factory, which uses the default JVM settings for secure
* connections.
*
* @return the default factory
*/
public static SSLSocketFactory getSocketFactory() {
return DEFAULT_FACTORY;