tyrus icon indicating copy to clipboard operation
tyrus copied to clipboard

Passing info from ServerEndpointCondig#Configurator to Endpoint instance

Open glassfishrobot opened this issue 10 years ago • 5 comments

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]

glassfishrobot avatar Mar 16 '15 08:03 glassfishrobot

  • Issue Imported From: https://github.com/tyrus-project/tyrus/issues/573
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: @pavelbucek

glassfishrobot avatar Feb 10 '18 20:02 glassfishrobot

@glassfishrobot Commented Reported by @pavelbucek

glassfishrobot avatar Mar 16 '15 08:03 glassfishrobot

@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 avatar Mar 18 '15 09:03 glassfishrobot

@glassfishrobot Commented Issue-Links: is related to WEBSOCKET_SPEC-235

glassfishrobot avatar Mar 16 '15 08:03 glassfishrobot

@glassfishrobot Commented This issue was imported from java.net JIRA TYRUS-396

glassfishrobot avatar Apr 25 '17 03:04 glassfishrobot