AeroGear Netty SockJS Codec 0.11.0

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

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

public class EventSourceTransport
extends io.netty.channel.ChannelHandlerAdapter

EventSource transport is an streaming transport in that is maintains a persistent connection from the server to the client over which the server can send messages. This is often refered to a Server Side Event (SSE) and the client side. The response for opening such a unidirection channel is done with a simple plain response with a 'Content-Type' of 'text/event-stream'. Subsequent http chunks will contain data that the server whishes to send to the client.


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
static String CONTENT_TYPE_EVENT_STREAM
           
 
Constructor Summary
EventSourceTransport(SockJsConfig config, io.netty.handler.codec.http.HttpRequest request)
           
 
Method Summary
protected  io.netty.handler.codec.http.HttpResponse createResponse(String contentType)
           
 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, channelRead, 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
 

Field Detail

CONTENT_TYPE_EVENT_STREAM

public static final String CONTENT_TYPE_EVENT_STREAM
See Also:
Constant Field Values
Constructor Detail

EventSourceTransport

public EventSourceTransport(SockJsConfig config,
                            io.netty.handler.codec.http.HttpRequest request)
Method Detail

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

createResponse

protected io.netty.handler.codec.http.HttpResponse createResponse(String contentType)

AeroGear Netty SockJS Codec 0.11.0

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