Class WebsocketConnectionContext


  • public class WebsocketConnectionContext
    extends pl.morgwai.base.guice.scopes.ServerSideContext<WebsocketConnectionContext>
    Context of a websocket connection (Session).

    A single instance has its lifetime coupled with a given endpoint instance. Specifically, all calls to given endpoint's annotated methods (from @OnOpen, across all calls to @OnMessage and @OnError until and including @OnClose or methods overriding those of Endpoint together with methods of registered MessageHandlers are executed within a single WebsocketConnectionContext.

    See Also:
    corresponding Scope
    • Constructor Detail

      • WebsocketConnectionContext

        protected WebsocketConnectionContext​(pl.morgwai.base.servlet.scopes.WebsocketConnectionWrapper connection,
                                             pl.morgwai.base.guice.scopes.ContextTracker<WebsocketConnectionContext> tracker)
    • Method Detail

      • getConnection

        public javax.websocket.Session getConnection()