AeroGear Netty SockJS Codec 0.11.0

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

java.lang.Object
  extended by io.netty.channel.ChannelHandlerAdapter
      extended by org.jboss.aerogear.io.netty.handler.codec.sockjs.transport.JsonpPollingTransport
All Implemented Interfaces:
io.netty.channel.ChannelHandler

public class JsonpPollingTransport
extends io.netty.channel.ChannelHandlerAdapter

JSON Padding (JSONP) Polling is a transport where there is no open connection between the client and the server. Instead the client will issue a new request for polling from and sending data to the SockJS service. This handler is responsible for sending data back to the client. Since JSONP is in use it need to inspect the HTTP request to find the callback method which is identified as a query parameter 'c'. The name of the callback method will be used to wrap the data into a javascript function call which is what will returned to the client.

See Also:
JsonpSendTransport

Nested Class Summary
 
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable, io.netty.channel.ChannelHandler.Skip
 
Constructor Summary
JsonpPollingTransport(SockJsConfig config, io.netty.handler.codec.http.FullHttpRequest request)
           
 
Method Summary
 void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
           
 void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)
           
 
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
bind, channelActive, channelInactive, channelReadComplete, channelRegistered, channelWritabilityChanged, close, connect, disconnect, exceptionCaught, flush, handlerAdded, handlerRemoved, isSharable, read, userEventTriggered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonpPollingTransport

public JsonpPollingTransport(SockJsConfig config,
                             io.netty.handler.codec.http.FullHttpRequest request)
Method Detail

channelRead

public void channelRead(io.netty.channel.ChannelHandlerContext ctx,
                        Object msg)
                 throws Exception
Specified by:
channelRead in interface io.netty.channel.ChannelHandler
Overrides:
channelRead in class io.netty.channel.ChannelHandlerAdapter
Throws:
Exception

write

public void write(io.netty.channel.ChannelHandlerContext ctx,
                  Object msg,
                  io.netty.channel.ChannelPromise promise)
           throws Exception
Specified by:
write in interface io.netty.channel.ChannelHandler
Overrides:
write in class io.netty.channel.ChannelHandlerAdapter
Throws:
Exception

AeroGear Netty SockJS Codec 0.11.0

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