tyrus
tyrus copied to clipboard
Passing info from ServerEndpointCondig#Configurator to Endpoint instance
Spec issue - WEBSOCKET_SPEC-235
I believe we should try to make that work at in Tyrus; some ideas:
- TyrusSession could expose HandshakeRequest
- HandshakeRequest could expose
Map<String, Object>(userProperties) which will be added to Session#getUserProperties..
Affected Versions
[1.10]
- Issue Imported From: https://github.com/tyrus-project/tyrus/issues/573
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @pavelbucek
@glassfishrobot Commented Reported by @pavelbucek
@glassfishrobot Commented @pavelbucek said: there is no good solution for that issue, if we limit the change only to WebSocket API implementation; all we can do here is to introduce another ServerEndpointConfig#Configurator descendant (let's call it TyrusServerConfigurator), which would somehow provide access to any object (most likely userProperties).
Since we are extending original Configurator, we cannot change the method signatures. Also the Configurator is currently singleton, so we cannot easily set the value and let the code get it - the concurrent invocation won't be handled correctly. I see two possible approaches:
- keep singleton, set the userProperties as ThreadLocal
- don't keep the singleton, make new instance for each endpoint instance
Currently I don't particularly like either of those, so if anyone has better suggestion, I'm all ears.. Thanks!
@glassfishrobot Commented Issue-Links: is related to WEBSOCKET_SPEC-235
@glassfishrobot Commented This issue was imported from java.net JIRA TYRUS-396