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 HttpPostRequestDecoder
decoder
private static HttpDataFactory
factory
private boolean
readingChunks
private HttpRequest
request
private java.lang.StringBuilder
responseContent
-
Constructor Summary
Constructors Constructor Description HttpUploadServerHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
Invoked when aChannel
was closed and all its related resources were released.void
exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
Invoked when an exception was raised by an I/O thread or aChannelHandler
.void
messageReceived(ChannelHandlerContext ctx, MessageEvent e)
Invoked when a message object (e.g:ChannelBuffer
) was received from a remote peer.private void
readHttpDataAllReceive(Channel channel)
Example of reading all InterfaceHttpData from finished transferprivate void
readHttpDataChunkByChunk()
Example of reading request by chunk and getting values from chunk to chunkprivate void
writeHttpData(InterfaceHttpData data)
private void
writeMenu(MessageEvent e)
private void
writeResponse(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:SimpleChannelUpstreamHandler
Invoked when aChannel
was closed and all its related resources were released.- Overrides:
channelClosed
in classSimpleChannelUpstreamHandler
-
messageReceived
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws java.lang.Exception
Description copied from class:SimpleChannelUpstreamHandler
Invoked when a message object (e.g:ChannelBuffer
) was received from a remote peer.- Overrides:
messageReceived
in 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:SimpleChannelUpstreamHandler
Invoked when an exception was raised by an I/O thread or aChannelHandler
.- Overrides:
exceptionCaught
in classSimpleChannelUpstreamHandler
-
-