AeroGear Netty SockJS Codec 0.11.0

org.jboss.aerogear.io.netty.handler.codec.sockjs.transport
Class XhrSendTransport

java.lang.Object
  extended by io.netty.channel.ChannelHandlerAdapter
      extended by io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpRequest>
          extended by org.jboss.aerogear.io.netty.handler.codec.sockjs.transport.AbstractSendTransport
              extended by org.jboss.aerogear.io.netty.handler.codec.sockjs.transport.XhrSendTransport
All Implemented Interfaces:
io.netty.channel.ChannelHandler

public class XhrSendTransport
extends AbstractSendTransport

XMLHttpRequest (XHR) streaming transport is a transport where a persistent connection is maintained between the server and the client, over which the server can send HTTP chunks. This handler is responsible the send part the xhr-polling transport, which is sending data to the target SockJS service.

See Also:
XhrPollingTransport

Nested Class Summary
 
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable, io.netty.channel.ChannelHandler.Skip
 
Field Summary
 
Fields inherited from class org.jboss.aerogear.io.netty.handler.codec.sockjs.transport.AbstractSendTransport
config
 
Constructor Summary
XhrSendTransport(SockJsConfig config)
           
 
Method Summary
 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.
 String toString()
           
 
Methods inherited from class org.jboss.aerogear.io.netty.handler.codec.sockjs.transport.AbstractSendTransport
messageReceived, respond
 
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, wait, wait, wait
 

Constructor Detail

XhrSendTransport

public XhrSendTransport(SockJsConfig config)
Method Detail

respond

public void respond(io.netty.channel.ChannelHandlerContext ctx,
                    io.netty.handler.codec.http.FullHttpRequest request)
             throws Exception
Description copied from class: AbstractSendTransport
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.

Specified by:
respond in class AbstractSendTransport
Parameters:
ctx - the current ChannelHandlerContext.
request - the http request.
Throws:
Exception - if a failure occurs while trying to respond.

toString

public String toString()
Overrides:
toString in class Object

AeroGear Netty SockJS Codec 0.11.0

Copyright © 2014 JBoss by Red Hat. All Rights Reserved.