Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Websocket question

Hello all,

I have been experimenting with the JSR 356 Websocket support in Jetty using WebSocketServerContainerInitializer. Although the API is pretty clean and simple it is not a good match for my embedded Jetty application model since requests are being promoted to socket class instances at the context level.

The application (embedded Jetty) uses one context with one Servlet singleton and dispatches all messages through a complicated hierarchy into scripts (which are custom language applications) and inside these scripts into object instances containing handlers. HTTP Sessions are also mapped onto object instances that either handle session local requests themselves or contain other objects that handle their own requests. This way URLs address specific parts of a specific applications and the requests are handled inside the local object state/scope of the handler objects.

Adding Websockets to this application model would be extremely more elegant if I could dispatch/handle the initial HTTP request as a regular request (through the Servlet singleton) and then promote the request to a socket class instance inside the local scopes myself. Is that at all possible? And if so, will I have to do everything myself or is it still possible to use most/part of the Jetty Websocket embedding?

Any pointers will be very much appreciated.

Kind regards,

Silvio


Back to the top