public class HttpClientUpgradeHandler extends HttpObjectAggregator implements ChannelOutboundHandler
限定符和类型 | 类和说明 |
---|---|
static interface |
HttpClientUpgradeHandler.SourceCodec
The source codec that is used in the pipeline initially.
|
static interface |
HttpClientUpgradeHandler.UpgradeCodec
A codec that the source can be upgraded to.
|
static class |
HttpClientUpgradeHandler.UpgradeEvent
User events that are fired to notify about upgrade status.
|
ChannelHandler.Sharable
构造器和说明 |
---|
HttpClientUpgradeHandler(HttpClientUpgradeHandler.SourceCodec sourceCodec,
HttpClientUpgradeHandler.UpgradeCodec upgradeCodec,
int maxContentLength)
Constructs the client upgrade handler.
|
限定符和类型 | 方法和说明 |
---|---|
void |
bind(ChannelHandlerContext ctx,
java.net.SocketAddress localAddress,
ChannelPromise promise)
Called once a bind operation is made.
|
void |
close(ChannelHandlerContext ctx,
ChannelPromise promise)
Called once a close operation is made.
|
void |
connect(ChannelHandlerContext ctx,
java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
ChannelPromise promise)
Called once a connect operation is made.
|
protected void |
decode(ChannelHandlerContext ctx,
HttpObject msg,
java.util.List<java.lang.Object> out)
Decode from one message to an other.
|
void |
deregister(ChannelHandlerContext ctx,
ChannelPromise promise)
Called once a deregister operation is made from the current registered
EventLoop . |
void |
disconnect(ChannelHandlerContext ctx,
ChannelPromise promise)
Called once a disconnect operation is made.
|
void |
flush(ChannelHandlerContext ctx)
Called once a flush operation is made.
|
void |
read(ChannelHandlerContext ctx)
Intercepts
ChannelHandlerContext.read() . |
void |
write(ChannelHandlerContext ctx,
java.lang.Object msg,
ChannelPromise promise)
Called once a write operation is made.
|
aggregate, beginAggregation, closeAfterContinueResponse, finishAggregation, handleOversizedMessage, ignoreContentAfterContinueResponse, isAggregated, isContentLengthInvalid, isContentMessage, isLastContentMessage, isStartMessage, newContinueResponse
acceptInboundMessage, channelInactive, channelReadComplete, ctx, handlerAdded, handlerRemoved, isHandlingOversizedMessage, maxContentLength, maxCumulationBufferComponents, setMaxCumulationBufferComponents
channelRead
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionCaught, handlerAdded, handlerRemoved
public HttpClientUpgradeHandler(HttpClientUpgradeHandler.SourceCodec sourceCodec, HttpClientUpgradeHandler.UpgradeCodec upgradeCodec, int maxContentLength)
sourceCodec
- the codec that is being used initially.upgradeCodec
- the codec that the client would like to upgrade to.maxContentLength
- the maximum length of the aggregated content.public void bind(ChannelHandlerContext ctx, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
bind
在接口中 ChannelOutboundHandler
ctx
- the ChannelHandlerContext
for which the bind operation is madelocalAddress
- the SocketAddress
to which it should boundpromise
- the ChannelPromise
to notify once the operation completesjava.lang.Exception
- thrown if an error occurspublic void connect(ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
connect
在接口中 ChannelOutboundHandler
ctx
- the ChannelHandlerContext
for which the connect operation is maderemoteAddress
- the SocketAddress
to which it should connectlocalAddress
- the SocketAddress
which is used as source on connectpromise
- the ChannelPromise
to notify once the operation completesjava.lang.Exception
- thrown if an error occurspublic void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
disconnect
在接口中 ChannelOutboundHandler
ctx
- the ChannelHandlerContext
for which the disconnect operation is madepromise
- the ChannelPromise
to notify once the operation completesjava.lang.Exception
- thrown if an error occurspublic void close(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
close
在接口中 ChannelOutboundHandler
ctx
- the ChannelHandlerContext
for which the close operation is madepromise
- the ChannelPromise
to notify once the operation completesjava.lang.Exception
- thrown if an error occurspublic void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
EventLoop
.deregister
在接口中 ChannelOutboundHandler
ctx
- the ChannelHandlerContext
for which the close operation is madepromise
- the ChannelPromise
to notify once the operation completesjava.lang.Exception
- thrown if an error occurspublic void read(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelOutboundHandler
ChannelHandlerContext.read()
.read
在接口中 ChannelOutboundHandler
java.lang.Exception
public void write(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
ChannelPipeline
. Those are then ready to be flushed to the actual Channel
once
Channel.flush()
is calledwrite
在接口中 ChannelOutboundHandler
ctx
- the ChannelHandlerContext
for which the write operation is mademsg
- the message to writepromise
- the ChannelPromise
to notify once the operation completesjava.lang.Exception
- thrown if an error occurspublic void flush(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelOutboundHandler
flush
在接口中 ChannelOutboundHandler
ctx
- the ChannelHandlerContext
for which the flush operation is madejava.lang.Exception
- thrown if an error occursprotected void decode(ChannelHandlerContext ctx, HttpObject msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
MessageToMessageDecoder
decode
在类中 MessageAggregator<HttpObject,HttpMessage,HttpContent,FullHttpMessage>
ctx
- the ChannelHandlerContext
which this MessageToMessageDecoder
belongs tomsg
- the message to decode to an other oneout
- the List
to which decoded messages should be addedjava.lang.Exception
- is thrown if an error occurs