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

Issue #3730 - Cleaning up Scopes in WebSocketClient #4423

Merged
merged 7 commits into from
Dec 19, 2019

Conversation

joakime
Copy link
Contributor

@joakime joakime commented Dec 13, 2019

  • Introducing HttpContainerScope to track HttpClient specific ByteBufferPool, SslContextFactory, and Executor.
  • New private WebSocketClient constructor that uses HttpContainerScope
  • Deprecated many constructors as irrelevant now that HttpClient is an option to create a WebSocketClient.
  • Removed SimpleContainerScope usage from WebSocketClient.

Signed-off-by: Joakim Erdfelt [email protected]

Closes #3730

+ Introducing HttpContainerScope to track HttpClient specific
  ByteBufferPool, SslContextFactory, and Executor.
+ New private WebSocketClient constructor that use HttpContainerScope
+ Deprecated many constructors as irrelevant now that HttpClient
  is an option to create a WebSocketClient.

Signed-off-by: Joakim Erdfelt <[email protected]>
Copy link
Contributor

@lachlan-roberts lachlan-roberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just have a few clean up suggestions.

this((HttpClient)null);
this(new HttpContainerScope(HttpClientProvider.get(null)));
// Add as bean, as HttpClient was created in this class
addBean(this.httpClient);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call to add the HttpClient as a bean is repeated in every constructor, while it should only be in the newly introduced constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, that's incorrect, there are 2 paths that have external clients.
Can't do that in the common constructor.

@joakime joakime merged commit cef67d9 into jetty-9.4.x Dec 19, 2019
@joakime joakime deleted the jetty-9.4.x-3730-websocket-scope-cleanup branch December 19, 2019 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebSocketClient constructor cleanup (and deprecations)
3 participants