Class WebSocketEndpoint

java.lang.Object
dev.relism.flash.websocket.WebSocketEndpoint
All Implemented Interfaces:
WebSocketHandler

public abstract class WebSocketEndpoint extends Object implements WebSocketHandler
Base class for class-based WebSocket endpoints registered via @Ws or app.ws(path, endpoint). Lifecycle: bind() once at boot → onOpen / onMessage* / onClose | onError per connection. No relation to RequestHandler — HTTP and WS lifecycles are fully separate.
  • Constructor Details

    • WebSocketEndpoint

      public WebSocketEndpoint()
  • Method Details

    • bind

      public final void bind(FlashContext ctx)
      Called once by framework at boot. Do not call from user code.
    • onInit

      protected void onInit()
      Override to resolve and cache services before first connection.
    • require

      protected <T> T require(Class<T> type)
    • find

      protected <T> Optional<T> find(Class<T> type)