RFR: 8476: Websocket server is tied to JfrEditor
Alex Macdonald
aptmac at openjdk.org
Wed Jan 7 19:30:34 UTC 2026
This PR addresses JMC-8476, in which the current websocket server implemention ties the server to a JfrEditor page.
At the moment, the Websocket server that is used to send selection data is created from within a JfrEditor page. So every time you open a new recording file, the JfrEditor code tries to start a new websocket server. This is a problem because there is only one field in the JMC settings to set the port number, and it is global to the application. So if I open recording-1, and then use the preferences menu to start the websocket server on port 8029, if I then open up recording-2 it will also try to open a websocket server on port 8029, and fail. As a result, sending data from recording-1 will work, but recording-2 will not (this can be seen in my "before" gif below).
I have extracted the websocket code out into it's own package and made it such that there is one server for the JMC application. So now if you toggle between recordings you can still send data to whatever application you want over websocket.
Before:
(exception thrown when trying to send events from the second recording)

After:
(selecting events from multiple recordings now works)

-------------
Commit messages:
- 8476: Websocket server is tied to JfrEditor
Changes: https://git.openjdk.org/jmc/pull/698/files
Webrev: https://webrevs.openjdk.org/?repo=jmc&pr=698&range=00
Issue: https://bugs.openjdk.org/browse/JMC-8476
Stats: 1154 lines in 23 files changed: 739 ins; 393 del; 22 mod
Patch: https://git.openjdk.org/jmc/pull/698.diff
Fetch: git fetch https://git.openjdk.org/jmc.git pull/698/head:pull/698
PR: https://git.openjdk.org/jmc/pull/698
More information about the jmc-dev
mailing list