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

WebSocketCoreSession leaks into JPMS exported classes #4226

Closed
sbordet opened this issue Oct 20, 2019 · 4 comments · Fixed by #4451
Closed

WebSocketCoreSession leaks into JPMS exported classes #4226

sbordet opened this issue Oct 20, 2019 · 4 comments · Fixed by #4451
Assignees

Comments

@sbordet
Copy link
Contributor

sbordet commented Oct 20, 2019

WebSocketCoreSession is in an internal package that is not exported by its JPMS module.

However, Extension and AbstractExtension, which are JPMS exported classes, have WebSocketCoreSession in method signatures, which means that it needs to be visible.

These classes need to be restructured so that they have the proper JPMS visibility.

@sbordet
Copy link
Contributor Author

sbordet commented Oct 20, 2019

@gregw @lachlan-roberts it's not clear to me if you want websocket-core to be invisible if people wants to use either Javax WebSocket or Jetty WebSocket.
Should application just e.g. requires org.eclipse.jetty.websocket.client, or also requires org.eclipse.jetty.websocket.core?

If so, then Jetty WebSocket DispatchedMessageSink and subclasses leak core's Frame class.
JettyExtensionConfig leaks core's ExtensionConfig class.
JavaxWebSocketContainer leaks core's WebSocketExtensionRegistry.
There are other examples of this, can be detected compiling in the IDE with -Xlint:exports

@gregw
Copy link
Contributor

gregw commented Oct 20, 2019

@sbordet @lachlan-roberts @joakime the intention is for core to be hidden from users of the javax and jetty websocket API packages.

The problem is extensions, as they have not been clearly put into either the implementation nor API camps. I believe that the implementation of extensions should be an implementation matter and not exposed to regular users of the APIs. API users may select and/or configure extensions - but should do so using only native based APIs rather dependencies on core.

However, some users will want to write their own extensions, in which case they should be required to have an explicit dependency on core.

Also, it may be that some APIs might define their own extension APIs (dumb idea but they might), in which case those APIs need to be implemented using core, but not exposing core.

@sbordet
Copy link
Contributor Author

sbordet commented Oct 20, 2019

@gregw the problem is not only extensions. Core classes are leaked in signatures of major Jetty WebSocket classes.

A user that wants to use Jetty WebSocket classes embedded with JPMS will have to requires org.eclipse.jetty.websocket.core in its JPMS module.

That may be perfectly fine.

However, if we want to keep core hidden to Jetty WebSocket users, then we should avoid leaking of core classes.

If, instead, we don't want to hide core classes, then this issue can be closed without doing anything.

@gregw
Copy link
Contributor

gregw commented Oct 20, 2019 via email

lachlan-roberts added a commit that referenced this issue Jan 28, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jan 30, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jan 30, 2020
…tJPMS

Issue #4226 - fix JPMS issues with javax websockets
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 a pull request may close this issue.

3 participants