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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to