Package org.apache.activemq.transport.ws
Interface WSTransport
-
- All Known Implementing Classes:
AmqpWSTransport
public interface WSTransport extends Transport
Interface for a WebSocket Transport which provide hooks that a servlet can use to pass along WebSocket data and events.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
WSTransport.WSTransportSink
WS 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getMaxFrameSize()
String
getSubProtocol()
void
onWebSocketBinary(ByteBuffer data)
Called from the WebSocket framework when new incoming Binary data is received.void
onWebSocketClosed()
Called from the WebSocket framework when the socket has been closed unexpectedly.void
onWebSocketText(String data)
Called from the WebSocket framework when new incoming String data is received.void
setTransportSink(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 Detail
-
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
void setTransportSink(WSTransport.WSTransportSink outputSink)
Called to provide the WS with the output data sink.
-
onWebSocketText
void onWebSocketText(String data) throws IOException
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
void onWebSocketBinary(ByteBuffer data) throws IOException
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
void onWebSocketClosed() throws IOException
Called from the WebSocket framework when the socket has been closed unexpectedly.- Throws:
IOException
- if an error while processing the close.
-
-