You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "John Sheehy (JIRA)" <ji...@apache.org> on 2013/02/21 23:30:13 UTC

[jira] [Created] (HTTPCLIENT-1326) Cannot override DefaultClientConnectionOperator

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