Class HttpUploadServerHandler
- java.lang.Object
-
- org.jboss.netty.channel.SimpleChannelUpstreamHandler
-
- org.jboss.netty.example.http.upload.HttpUploadServerHandler
-
- All Implemented Interfaces:
ChannelHandler,ChannelUpstreamHandler
public class HttpUploadServerHandler extends SimpleChannelUpstreamHandler
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Field Summary
Fields Modifier and Type Field Description private HttpPostRequestDecoderdecoderprivate static HttpDataFactoryfactoryprivate booleanreadingChunksprivate HttpRequestrequestprivate java.lang.StringBuilderresponseContent
-
Constructor Summary
Constructors Constructor Description HttpUploadServerHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchannelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)Invoked when aChannelwas closed and all its related resources were released.voidexceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)Invoked when an exception was raised by an I/O thread or aChannelHandler.voidmessageReceived(ChannelHandlerContext ctx, MessageEvent e)Invoked when a message object (e.g:ChannelBuffer) was received from a remote peer.private voidreadHttpDataAllReceive(Channel channel)Example of reading all InterfaceHttpData from finished transferprivate voidreadHttpDataChunkByChunk()Example of reading request by chunk and getting values from chunk to chunkprivate voidwriteHttpData(InterfaceHttpData data)private voidwriteMenu(MessageEvent e)private voidwriteResponse(Channel channel)-
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelBound, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete
-
-
-
-
Field Detail
-
factory
private static final HttpDataFactory factory
-
responseContent
private final java.lang.StringBuilder responseContent
-
decoder
private HttpPostRequestDecoder decoder
-
request
private HttpRequest request
-
readingChunks
private boolean readingChunks
-
-
Method Detail
-
channelClosed
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
Description copied from class:SimpleChannelUpstreamHandlerInvoked when aChannelwas closed and all its related resources were released.- Overrides:
channelClosedin classSimpleChannelUpstreamHandler
-
messageReceived
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws java.lang.Exception
Description copied from class:SimpleChannelUpstreamHandlerInvoked when a message object (e.g:ChannelBuffer) was received from a remote peer.- Overrides:
messageReceivedin classSimpleChannelUpstreamHandler- Throws:
java.lang.Exception
-
readHttpDataAllReceive
private void readHttpDataAllReceive(Channel channel)
Example of reading all InterfaceHttpData from finished transfer
-
readHttpDataChunkByChunk
private void readHttpDataChunkByChunk()
Example of reading request by chunk and getting values from chunk to chunk
-
writeHttpData
private void writeHttpData(InterfaceHttpData data)
-
writeResponse
private void writeResponse(Channel channel)
-
writeMenu
private void writeMenu(MessageEvent e)
-
exceptionCaught
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
Description copied from class:SimpleChannelUpstreamHandlerInvoked when an exception was raised by an I/O thread or aChannelHandler.- Overrides:
exceptionCaughtin classSimpleChannelUpstreamHandler
-
-