You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Jonathan Cottrill (JIRA)" <ji...@apache.org> on 2008/09/24 00:09:44 UTC

[jira] Created: (HTTPCLIENT-797) o.a.h.conn.scheme.PlainSocketFactory is not a true Singleton

o.a.h.conn.scheme.PlainSocketFactory is not a true Singleton
------------------------------------------------------------

                 Key: HTTPCLIENT-797
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-797
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
    Affects Versions: 4.0 Beta 1
         Environment: N/A
            Reporter: Jonathan Cottrill


The class "org.apache.http.conn.scheme.PlainSocketFactory" has a factory method, getSocketFactory(), and clearly indicates in the Javadocs that it expects to be a Singleton; however, the presence of public constructors makes it quite possible that this is not the case.

To protect the Singleton status of the class, the constructors should be private, or, at the very least, default (package) access. This will force access to the single instance through the factory method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Resolved: (HTTPCLIENT-797) o.a.h.conn.scheme.PlainSocketFactory is not a true Singleton

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-797?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCLIENT-797.
------------------------------------------

       Resolution: Fixed
    Fix Version/s: 4.0 Beta 2

Jonathan,

Actually there is no longer any reason why socket factories need to be implemented as singletons. This limitation of 3.x API is no longer relevant for 4.0. I updated the javadocs to not mention singleton anymore.

Many thanks for reporting the problem.

Oleg  

> o.a.h.conn.scheme.PlainSocketFactory is not a true Singleton
> ------------------------------------------------------------
>
>                 Key: HTTPCLIENT-797
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-797
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.0 Beta 1
>         Environment: N/A
>            Reporter: Jonathan Cottrill
>             Fix For: 4.0 Beta 2
>
>
> The class "org.apache.http.conn.scheme.PlainSocketFactory" has a factory method, getSocketFactory(), and clearly indicates in the Javadocs that it expects to be a Singleton; however, the presence of public constructors makes it quite possible that this is not the case.
> To protect the Singleton status of the class, the constructors should be private, or, at the very least, default (package) access. This will force access to the single instance through the factory method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org