|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.websocket.StreamInbound
public abstract class StreamInbound
Base implementation of the class used to process WebSocket connections based
on streams. Applications should extend this class to provide application
specific functionality. Applications that wish to operate on a message basis
rather than a stream basis should use MessageInbound
.
Constructor Summary | |
---|---|
StreamInbound()
|
Method Summary | |
---|---|
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. |
AbstractEndpoint.Handler.SocketState |
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 abstract void |
onTextData(Reader r)
This method is called when there is a textual WebSocket message available to process. |
void |
onUpgradeComplete()
|
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) . |
void |
setUpgradeOutbound(UpgradeOutbound upgradeOutbound)
|
void |
setUpgradeProcessor(UpgradeProcessor<?> processor)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreamInbound()
Method Detail |
---|
public int getOutboundByteBufferSize()
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 void setUpgradeOutbound(UpgradeOutbound upgradeOutbound)
setUpgradeOutbound
in interface UpgradeInbound
public final void setUpgradeProcessor(UpgradeProcessor<?> processor)
setUpgradeProcessor
in interface UpgradeInbound
public final WsOutbound getWsOutbound()
public final AbstractEndpoint.Handler.SocketState onData() throws IOException
onData
in interface UpgradeInbound
IOException
public final void onUpgradeComplete()
onUpgradeComplete
in interface UpgradeInbound
protected void onOpen(WsOutbound outbound)
outbound
- The outbound WebSocket connection.protected void onClose(int status)
status
- The status code of the close reason.protected abstract void onBinaryData(InputStream is) throws IOException
is
- The WebSocket message
IOException
- 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 message
IOException
- If a problem occurs processing the message. Any
exception will trigger the closing of the WebSocket
connection.public int getReadTimeout()
getReadTimeout
in interface UpgradeInbound
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |