Package org.apache.activemq.transport.ws
Interface WSTransport
Interface for a WebSocket Transport which provide hooks that a servlet can
use to pass along WebSocket data and events.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceWS Transport output sink, used to give the WS Transport implementation a way to produce output back to the WS connection without coupling it to the implementation. -
Method Summary
Modifier and TypeMethodDescriptionintvoidonWebSocketBinary(ByteBuffer data) Called from the WebSocket framework when new incoming Binary data is received.voidCalled from the WebSocket framework when the socket has been closed unexpectedly.voidonWebSocketText(String data) Called from the WebSocket framework when new incoming String data is received.voidsetTransportSink(WSTransport.WSTransportSink outputSink) Called to provide the WS with the output data sink.Methods inherited from interface org.apache.activemq.transport.Transport
asyncRequest, getPeerCertificates, getReceiveCounter, getRemoteAddress, getTransportListener, getWireFormat, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, oneway, reconnect, request, request, setPeerCertificates, setTransportListener, updateURIs
-
Method Details
-
getMaxFrameSize
int getMaxFrameSize()- Returns:
- the maximum frame size allowed for this WS Transport.
-
getSubProtocol
String getSubProtocol()- Returns:
- the WS sub-protocol that this transport is supplying.
-
setTransportSink
Called to provide the WS with the output data sink. -
onWebSocketText
Called from the WebSocket framework when new incoming String data is received.- Parameters:
data- The newly received incoming data.- Throws:
IOException- if an error occurs or the socket doesn't support text data.
-
onWebSocketBinary
Called from the WebSocket framework when new incoming Binary data is received.- Parameters:
data- The newly received incoming data.- Throws:
IOException- if an error occurs or the socket doesn't support binary data.
-
onWebSocketClosed
Called from the WebSocket framework when the socket has been closed unexpectedly.- Throws:
IOException- if an error while processing the close.
-