public class WebSocketServerProtocolHandler extends SimpleChannelUpstreamHandler implements LifeCycleAwareChannelHandler
ChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
private boolean |
allowExtensions |
private java.lang.String |
subprotocols |
private java.lang.String |
websocketPath |
| Constructor and Description |
|---|
WebSocketServerProtocolHandler(java.lang.String websocketPath) |
WebSocketServerProtocolHandler(java.lang.String websocketPath,
java.lang.String subprotocols) |
WebSocketServerProtocolHandler(java.lang.String websocketPath,
java.lang.String subprotocols,
boolean allowExtensions) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterAdd(ChannelHandlerContext ctx) |
void |
afterRemove(ChannelHandlerContext ctx) |
void |
beforeAdd(ChannelHandlerContext ctx) |
void |
beforeRemove(ChannelHandlerContext ctx) |
void |
exceptionCaught(ChannelHandlerContext ctx,
ExceptionEvent e)
Invoked when an exception was raised by an I/O thread or a
ChannelHandler. |
(package private) static ChannelHandler |
forbiddenHttpRequestResponder() |
(package private) static WebSocketServerHandshaker |
getHandshaker(ChannelHandlerContext ctx) |
void |
messageReceived(ChannelHandlerContext ctx,
MessageEvent e)
Invoked when a message object (e.g:
ChannelBuffer) was received
from a remote peer. |
(package private) static void |
setHandshaker(ChannelHandlerContext ctx,
WebSocketServerHandshaker handshaker) |
channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeCompleteprivate final java.lang.String websocketPath
private final java.lang.String subprotocols
private final boolean allowExtensions
public WebSocketServerProtocolHandler(java.lang.String websocketPath)
public WebSocketServerProtocolHandler(java.lang.String websocketPath,
java.lang.String subprotocols)
public WebSocketServerProtocolHandler(java.lang.String websocketPath,
java.lang.String subprotocols,
boolean allowExtensions)
public void afterAdd(ChannelHandlerContext ctx) throws java.lang.Exception
afterAdd in interface LifeCycleAwareChannelHandlerjava.lang.Exceptionpublic void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws java.lang.Exception
SimpleChannelUpstreamHandlerChannelBuffer) was received
from a remote peer.messageReceived in class SimpleChannelUpstreamHandlerjava.lang.Exceptionpublic void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws java.lang.Exception
SimpleChannelUpstreamHandlerChannelHandler.exceptionCaught in class SimpleChannelUpstreamHandlerjava.lang.Exceptionstatic WebSocketServerHandshaker getHandshaker(ChannelHandlerContext ctx)
static void setHandshaker(ChannelHandlerContext ctx, WebSocketServerHandshaker handshaker)
static ChannelHandler forbiddenHttpRequestResponder()
public void beforeAdd(ChannelHandlerContext ctx) throws java.lang.Exception
beforeAdd in interface LifeCycleAwareChannelHandlerjava.lang.Exceptionpublic void beforeRemove(ChannelHandlerContext ctx) throws java.lang.Exception
beforeRemove in interface LifeCycleAwareChannelHandlerjava.lang.Exceptionpublic void afterRemove(ChannelHandlerContext ctx) throws java.lang.Exception
afterRemove in interface LifeCycleAwareChannelHandlerjava.lang.Exception