public abstract class StreamInbound extends Object
MessageInbound
.Constructor and Description |
---|
StreamInbound() |
Modifier and Type | Method and Description |
---|---|
HttpEvent |
getEvent() |
int |
getOutboundByteBufferSize() |
int |
getOutboundCharBufferSize() |
int |
getReadTimeout()
This default implementation sets the read timeout to infinite and expects
the WebSocket application to close the connection when it is no longer
required.
|
WsOutbound |
getWsOutbound()
Obtain the outbound side of this WebSocket connection used for writing
data to the client.
|
protected abstract void |
onBinaryData(InputStream is)
This method is called when there is a binary WebSocket message available
to process.
|
protected void |
onClose(int status)
Intended to be overridden by sub-classes that wish to be notified
when the outbound connection is closed.
|
void |
onData() |
protected void |
onOpen(WsOutbound outbound)
Intended to be overridden by sub-classes that wish to be notified
when the outbound connection is established.
|
protected void |
onPong(ByteBuffer payload)
Intended to be overridden by sub-classes that wish to be notified
when a pong is received.
|
protected abstract void |
onTextData(Reader r)
This method is called when there is a textual WebSocket message available
to process.
|
void |
onUpgradeComplete() |
void |
setEvent(HttpEvent event) |
void |
setOutboundByteBufferSize(int outboundByteBufferSize)
This only applies to the
WsOutbound instance returned from
getWsOutbound() created by a subsequent call to
#setUpgradeOutbound(UpgradeOutbound) . |
void |
setOutboundCharBufferSize(int outboundCharBufferSize)
This only applies to the
WsOutbound instance returned from
getWsOutbound() created by a subsequent call to
#setUpgradeOutbound(UpgradeOutbound) . |
public int getOutboundByteBufferSize()
public HttpEvent getEvent()
public void setEvent(HttpEvent event)
public void setOutboundByteBufferSize(int outboundByteBufferSize)
WsOutbound
instance returned from
getWsOutbound()
created by a subsequent call to
#setUpgradeOutbound(UpgradeOutbound)
. The current
WsOutbound
instance, if any, is not affected.outboundByteBufferSize
- public int getOutboundCharBufferSize()
public void setOutboundCharBufferSize(int outboundCharBufferSize)
WsOutbound
instance returned from
getWsOutbound()
created by a subsequent call to
#setUpgradeOutbound(UpgradeOutbound)
. The current
WsOutbound
instance, if any, is not affected.outboundCharBufferSize
- public final WsOutbound getWsOutbound()
public final void onData() throws IOException
IOException
public final void onUpgradeComplete()
protected void onOpen(WsOutbound outbound)
outbound
- The outbound WebSocket connection.protected void onClose(int status)
status
- The status code of the close reason.protected void onPong(ByteBuffer payload)
payload
- The payload included in the pong.protected abstract void onBinaryData(InputStream is) throws IOException
is
- The WebSocket messageIOException
- If a problem occurs processing the message. Any
exception will trigger the closing of the WebSocket
connection.protected abstract void onTextData(Reader r) throws IOException
r
- The WebSocket messageIOException
- If a problem occurs processing the message. Any
exception will trigger the closing of the WebSocket
connection.public int getReadTimeout()
Copyright © 2014 JBoss by Red Hat. All Rights Reserved.