Class WebSocketServerProtocolHandler
java.lang.Object
org.jboss.netty.channel.SimpleChannelUpstreamHandler
org.jboss.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler
- All Implemented Interfaces:
ChannelHandler
,ChannelUpstreamHandler
,LifeCycleAwareChannelHandler
public class WebSocketServerProtocolHandler
extends SimpleChannelUpstreamHandler
implements LifeCycleAwareChannelHandler
Handles WebSocket control frames (Close, Ping, Pong) and data frames (Text and Binary) are passed
to the next handler in the pipeline.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWebSocketServerProtocolHandler
(String websocketPath) WebSocketServerProtocolHandler
(String websocketPath, String subprotocols) WebSocketServerProtocolHandler
(String websocketPath, String subprotocols, boolean allowExtensions) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
void
Invoked when an exception was raised by an I/O thread or aChannelHandler
.(package private) static ChannelHandler
(package private) static WebSocketServerHandshaker
void
Invoked when a message object (e.g:ChannelBuffer
) was received from a remote peer.(package private) static void
setHandshaker
(ChannelHandlerContext ctx, WebSocketServerHandshaker handshaker) Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete
-
Field Details
-
websocketPath
-
subprotocols
-
allowExtensions
private final boolean allowExtensions
-
-
Constructor Details
-
WebSocketServerProtocolHandler
-
WebSocketServerProtocolHandler
-
WebSocketServerProtocolHandler
-
-
Method Details
-
afterAdd
- Specified by:
afterAdd
in interfaceLifeCycleAwareChannelHandler
- Throws:
Exception
-
messageReceived
Description copied from class:SimpleChannelUpstreamHandler
Invoked when a message object (e.g:ChannelBuffer
) was received from a remote peer.- Overrides:
messageReceived
in classSimpleChannelUpstreamHandler
- Throws:
Exception
-
exceptionCaught
Description copied from class:SimpleChannelUpstreamHandler
Invoked when an exception was raised by an I/O thread or aChannelHandler
.- Overrides:
exceptionCaught
in classSimpleChannelUpstreamHandler
- Throws:
Exception
-
getHandshaker
-
setHandshaker
-
forbiddenHttpRequestResponder
-
beforeAdd
- Specified by:
beforeAdd
in interfaceLifeCycleAwareChannelHandler
- Throws:
Exception
-
beforeRemove
- Specified by:
beforeRemove
in interfaceLifeCycleAwareChannelHandler
- Throws:
Exception
-
afterRemove
- Specified by:
afterRemove
in interfaceLifeCycleAwareChannelHandler
- Throws:
Exception
-