Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the code responsible for configuring SardineImpl.builder to a separate class #262

Open
adammichalik opened this issue Oct 24, 2016 · 1 comment

Comments

@adammichalik
Copy link

In SardineImpl a substantial part of the class is responsible for configuring the default HttpClientBuilder. Refactoring it outside of SardineImpl and allowing a SardineImpl constructor to be parameterized with an instance of that "HttpClientBuilderFactory" would allow the developers to selectively modify the default Sardine's setup instead of providing the whole new HttpClientBuilder themselves.

My motivation: I'm using Sardine as a Spring singleton bean. That should work fine if I adjust the maxTotal and defaultMaxPerRoute of the underlying PoolingHttpClientConnectionManager. However, SardineImpl does not give access to the connection manager, so I have to subclass it and override createDefaultConnectionManager(). But that method is called during construction of SardineImpl (superclass), so I don't have a way to pass the maxTotal and defaultMaxPerRoute, because my subclass instance which would have these fields is not constructed yet.

@adammichalik
Copy link
Author

That would also allow to easily solve issues like #254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants