org.jboss.aerogear.io.netty.handler.codec.sockjs.transport
Class AbstractSendTransport
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpRequest>
org.jboss.aerogear.io.netty.handler.codec.sockjs.transport.AbstractSendTransport
- All Implemented Interfaces:
- io.netty.channel.ChannelHandler
- Direct Known Subclasses:
- JsonpSendTransport, XhrSendTransport
public abstract class AbstractSendTransport
- extends io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpRequest>
A common base class for SockJS transports that send messages to a SockJS service.
| Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler |
io.netty.channel.ChannelHandler.Sharable, io.netty.channel.ChannelHandler.Skip |
|
Method Summary |
void |
messageReceived(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest request)
|
abstract void |
respond(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest request)
Allows concrete subclasses to very how they will respond after a message has been sent
to the target SockJS service. |
protected void |
respond(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpVersion httpVersion,
io.netty.handler.codec.http.HttpResponseStatus status,
String message)
|
| Methods inherited from class io.netty.channel.SimpleChannelInboundHandler |
acceptInboundMessage, channelRead |
| Methods inherited from class io.netty.channel.ChannelHandlerAdapter |
bind, channelActive, channelInactive, channelReadComplete, channelRegistered, channelWritabilityChanged, close, connect, disconnect, exceptionCaught, flush, handlerAdded, handlerRemoved, isSharable, read, userEventTriggered, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
config
protected final SockJsConfig config
AbstractSendTransport
protected AbstractSendTransport(SockJsConfig config)
messageReceived
public void messageReceived(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest request)
throws Exception
- Specified by:
messageReceived in class io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpRequest>
- Throws:
Exception
respond
public abstract void respond(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest request)
throws Exception
- Allows concrete subclasses to very how they will respond after a message has been sent
to the target SockJS service.
Different transport protocols require different responses, for example jsonp_send requires an
OK response while xhr_send NO_CONTENT.
- Parameters:
ctx - the current ChannelHandlerContext.request - the http request.
- Throws:
Exception - if a failure occurs while trying to respond.
respond
protected void respond(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpVersion httpVersion,
io.netty.handler.codec.http.HttpResponseStatus status,
String message)
Copyright © 2014 JBoss by Red Hat. All Rights Reserved.