org.jboss.aerogear.io.netty.handler.codec.sockjs.transport
Class HtmlFileTransport
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
org.jboss.aerogear.io.netty.handler.codec.sockjs.transport.HtmlFileTransport
- All Implemented Interfaces:
- io.netty.channel.ChannelHandler
public class HtmlFileTransport
- extends io.netty.channel.ChannelHandlerAdapter
A streaming transport for SockJS.
This transport is intended to be used in an iframe, where the src of
the iframe will have the an url looking something like this:
http://server/echo/serverId/sessionId/htmlfile?c=callback
The server will respond with a html snipped containing a html header
and a script element. When data is available on the server this classes
write method will write a script to the connection that will invoke the
callback.
| Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler |
io.netty.channel.ChannelHandler.Sharable, io.netty.channel.ChannelHandler.Skip |
|
Method Summary |
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
|
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, 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 |
HtmlFileTransport
public HtmlFileTransport(SockJsConfig config,
io.netty.handler.codec.http.HttpRequest request)
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
createResponse
protected io.netty.handler.codec.http.HttpResponse createResponse(String contentType)
Copyright © 2014 JBoss by Red Hat. All Rights Reserved.