Package org.atmosphere.webtransport
Interface WebTransportProtocol
- All Superinterfaces:
AtmosphereConfigAware
Protocol for converting WebTransport messages into
AtmosphereRequest
objects that can be dispatched through the Atmosphere framework. Plays the
role WebSocketProtocol plays for WebSocket:
an implementation is selected by class name via
ApplicationConfig.WEBTRANSPORT_PROTOCOL and, once
installed, owns the session's message, lifecycle, and error callbacks.
Unlike WebSocket there is no in-tree implementation — when the knob is unset
the WebTransport processor bridges messages to the configured
WebSocketProtocol machinery instead.-
Method Summary
Modifier and TypeMethodDescriptionvoidonClose(WebTransportSession session) Invoked when a WebTransport session is closed.voidInvoked when an error occurs on the WebTransport session.onMessage(WebTransportSession session, byte[] data, int offset, int length) Parse a binary message received on a WebTransport bidirectional stream and convert it to a list ofAtmosphereRequestfor dispatch.onMessage(WebTransportSession session, String data) Parse a text message received on a WebTransport bidirectional stream and convert it to a list ofAtmosphereRequestfor dispatch.voidonOpen(WebTransportSession session) Invoked when a WebTransport session is opened.Methods inherited from interface org.atmosphere.inject.AtmosphereConfigAware
configure
-
Method Details
-
onMessage
Parse a text message received on a WebTransport bidirectional stream and convert it to a list ofAtmosphereRequestfor dispatch.- Parameters:
session- theWebTransportSessiondata- the text message- Returns:
- a list of requests to dispatch, or null to handle dispatch manually
-
onMessage
Parse a binary message received on a WebTransport bidirectional stream and convert it to a list ofAtmosphereRequestfor dispatch.- Parameters:
session- theWebTransportSessiondata- the raw bytesoffset- start offsetlength- number of bytes- Returns:
- a list of requests to dispatch, or null to handle dispatch manually
-
onOpen
Invoked when a WebTransport session is opened.- Parameters:
session- theWebTransportSession
-
onClose
Invoked when a WebTransport session is closed.- Parameters:
session- theWebTransportSession
-
onError
Invoked when an error occurs on the WebTransport session.- Parameters:
session- theWebTransportSessiont- the exception
-