hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Sheehy (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCLIENT-1326) Cannot override DefaultClientConnectionOperator
Date Thu, 21 Feb 2013 22:30:13 GMT
John Sheehy created HTTPCLIENT-1326:
---------------------------------------

             Summary: Cannot override DefaultClientConnectionOperator
                 Key: HTTPCLIENT-1326
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1326
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
    Affects Versions: 4.2.3
            Reporter: John Sheehy
            Priority: Minor


Trying to override the DefaultClientConnectionOperator like so:

PoolingClientConnectionManager cm = new PoolingClientConnectionManager(schemeRegistry) { 

    @Override 
    protected ClientConnectionOperator createConnectionOperator(final SchemeRegistry schemeRegistry)
{ 
        return new DefaultClientConnectionOperator(schemeRegistry) { 
            @Override 
            public OperatedClientConnection createConnection() { 
                return new DefaultClientConnection() { 
                    @Override 
                    protected EntitySerializer createEntitySerializer() { 
                        return new MyEntitySerializer(new StrictContentLengthStrategy());

                    }
                };
            }
        }; 
    }
}

The createConnection() overriden function is never called. Looking at the code, it seems there's
a line in HttpConnPool (used internally by PoolingClientConnectionManager) that simply instantiates
a DefaultHttpConnection().


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message