Top Description Inners Fields Constructors Methods
io.netty.handler.codec.spdy

public Class SpdySessionHandler

extends ChannelDuplexHandler
Class Inheritance
Imports
io.netty.channel.ChannelDuplexHandler, .ChannelFuture, .ChannelFutureListener, .ChannelHandlerContext, .ChannelPromise, io.netty.util.internal.ObjectUtil, java.util.concurrent.atomic.AtomicInteger

Manages streams within a SPDY session.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private ChannelFutureListener
private static final int
private static final int
private int
private int
private volatile int
private int
private int
private final int
private final AtomicInteger
private static final SpdyProtocolException
private boolean
private int
private boolean
private final boolean
private final SpdySession
private static final SpdyProtocolException

Constructor Summary

AccessConstructor and Description
public
SpdySessionHandler(SpdyVersion
the protocol version
version
,
boolean
true if and only if this session handler should handle the server endpoint of the connection. false if and only if this session handler should handle the client endpoint of the connection.
server
)

Creates a new session handler.

Method Summary

Modifier and TypeMethod and Description
private boolean
acceptStream(int streamId, byte priority, boolean remoteSideClosed, boolean localSideClosed)

public void
public void
public void
close(ChannelHandlerContext
the ChannelHandlerContext for which the close operation is made
ctx
,
ChannelPromise
the ChannelPromise to notify once the operation completes
promise
)

Overrides io.netty.channel.ChannelDuplexHandler.close.

Implements io.netty.channel.ChannelOutboundHandler.close.

Calls ChannelHandlerContext#close(ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline.
public void
private void
halfCloseStream(int streamId, boolean remote, ChannelFuture future)

private void
private boolean
private void
private void
private void
removeStream(int streamId, ChannelFuture future)

private void
private ChannelFuture
public void
setSessionReceiveWindowSize(int sessionReceiveWindowSize)

private void
updateInitialReceiveWindowSize(int newInitialWindowSize)

private void
updateInitialSendWindowSize(int newInitialWindowSize)

private void
updateSendWindowSize(final ChannelHandlerContext ctx, int streamId, int deltaWindowSize)

public void
write(ChannelHandlerContext
the ChannelHandlerContext for which the write operation is made
ctx
,
Object
the message to write
msg
,
ChannelPromise
the ChannelPromise to notify once the operation completes
promise
)

Overrides io.netty.channel.ChannelDuplexHandler.write.

Implements io.netty.channel.ChannelOutboundHandler.write.

Calls ChannelHandlerContext#write(Object, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline.
Inherited from io.netty.channel.ChannelDuplexHandler:
bindconnectderegisterdisconnectflushread

Field Detail

closeSessionFutureListenerback to summary
private ChannelFutureListener closeSessionFutureListener
DEFAULT_MAX_CONCURRENT_STREAMSback to summary
private static final int DEFAULT_MAX_CONCURRENT_STREAMS
DEFAULT_WINDOW_SIZEback to summary
private static final int DEFAULT_WINDOW_SIZE
initialReceiveWindowSizeback to summary
private int initialReceiveWindowSize
initialSendWindowSizeback to summary
private int initialSendWindowSize
initialSessionReceiveWindowSizeback to summary
private volatile int initialSessionReceiveWindowSize
lastGoodStreamIdback to summary
private int lastGoodStreamId
localConcurrentStreamsback to summary
private int localConcurrentStreams
minorVersionback to summary
private final int minorVersion
pingsback to summary
private final AtomicInteger pings
PROTOCOL_EXCEPTIONback to summary
private static final SpdyProtocolException PROTOCOL_EXCEPTION
receivedGoAwayFrameback to summary
private boolean receivedGoAwayFrame
remoteConcurrentStreamsback to summary
private int remoteConcurrentStreams
sentGoAwayFrameback to summary
private boolean sentGoAwayFrame
serverback to summary
private final boolean server
spdySessionback to summary
private final SpdySession spdySession
STREAM_CLOSEDback to summary
private static final SpdyProtocolException STREAM_CLOSED

Constructor Detail

SpdySessionHandlerback to summary
public SpdySessionHandler(SpdyVersion version, boolean server)

Creates a new session handler.

Parameters
version:SpdyVersion

the protocol version

server:boolean

true if and only if this session handler should handle the server endpoint of the connection. false if and only if this session handler should handle the client endpoint of the connection.

Method Detail

acceptStreamback to summary
private boolean acceptStream(int streamId, byte priority, boolean remoteSideClosed, boolean localSideClosed)
channelInactiveback to summary
public void channelInactive(ChannelHandlerContext ctx) throws Exception

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelInactive.

Implements io.netty.channel.ChannelInboundHandler.channelInactive.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelInactive.

Calls ChannelHandlerContext#fireChannelInactive() to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Annotations
@Override
channelReadback to summary
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelRead.

Implements io.netty.channel.ChannelInboundHandler.channelRead.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelRead.

Calls ChannelHandlerContext#fireChannelRead(Object) to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Annotations
@Override
closeback to summary
public void close(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception

Overrides io.netty.channel.ChannelDuplexHandler.close.

Implements io.netty.channel.ChannelOutboundHandler.close.

Doc from io.netty.channel.ChannelDuplexHandler.close.

Calls ChannelHandlerContext#close(ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Parameters
ctx:ChannelHandlerContext

Doc from io.netty.channel.ChannelOutboundHandler.close.

the ChannelHandlerContext for which the close operation is made

promise:ChannelPromise

Doc from io.netty.channel.ChannelOutboundHandler.close.

the ChannelPromise to notify once the operation completes

Annotations
@Override
Exceptions
Exception:

Doc from io.netty.channel.ChannelOutboundHandler.close.

thrown if an error occurs

exceptionCaughtback to summary
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception

Overrides io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught.

Implements io.netty.channel.ChannelHandler.exceptionCaught, io.netty.channel.ChannelInboundHandler.exceptionCaught.

Doc from io.netty.channel.ChannelHandler.exceptionCaught.

Gets called if a Throwable was thrown.

Annotations
@Override
halfCloseStreamback to summary
private void halfCloseStream(int streamId, boolean remote, ChannelFuture future)
handleOutboundMessageback to summary
private void handleOutboundMessage(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception
isRemoteInitiatedIdback to summary
private boolean isRemoteInitiatedId(int id)
issueSessionErrorback to summary
private void issueSessionError(ChannelHandlerContext ctx, SpdySessionStatus status)
issueStreamErrorback to summary
private void issueStreamError(ChannelHandlerContext ctx, int streamId, SpdyStreamStatus status)
removeStreamback to summary
private void removeStream(int streamId, ChannelFuture future)
sendGoAwayFrameback to summary
private void sendGoAwayFrame(ChannelHandlerContext ctx, ChannelPromise future)
sendGoAwayFrameback to summary
private ChannelFuture sendGoAwayFrame(ChannelHandlerContext ctx, SpdySessionStatus status)
setSessionReceiveWindowSizeback to summary
public void setSessionReceiveWindowSize(int sessionReceiveWindowSize)
updateInitialReceiveWindowSizeback to summary
private void updateInitialReceiveWindowSize(int newInitialWindowSize)
updateInitialSendWindowSizeback to summary
private void updateInitialSendWindowSize(int newInitialWindowSize)
updateSendWindowSizeback to summary
private void updateSendWindowSize(final ChannelHandlerContext ctx, int streamId, int deltaWindowSize)
writeback to summary
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception

Overrides io.netty.channel.ChannelDuplexHandler.write.

Implements io.netty.channel.ChannelOutboundHandler.write.

Doc from io.netty.channel.ChannelDuplexHandler.write.

Calls ChannelHandlerContext#write(Object, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Parameters
ctx:ChannelHandlerContext

Doc from io.netty.channel.ChannelOutboundHandler.write.

the ChannelHandlerContext for which the write operation is made

msg:Object

Doc from io.netty.channel.ChannelOutboundHandler.write.

the message to write

promise:ChannelPromise

Doc from io.netty.channel.ChannelOutboundHandler.write.

the ChannelPromise to notify once the operation completes

Annotations
@Override
Exceptions
Exception:

Doc from io.netty.channel.ChannelOutboundHandler.write.

thrown if an error occurs

io.netty.handler.codec.spdy back to summary

private final Class SpdySessionHandler.ClosingChannelFutureListener

extends Object
implements ChannelFutureListener
Class Inheritance
  • java.lang.Object
  • io.netty.handler.codec.spdy.SpdySessionHandler.ClosingChannelFutureListener
All Implemented Interfaces
io.netty.channel.ChannelFutureListener, io.netty.util.concurrent.GenericFutureListener, java.util.EventListener

Field Summary

Modifier and TypeField and Description
private final ChannelHandlerContext
private final ChannelPromise

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
operationComplete(ChannelFuture
the source Future which called this callback
sentGoAwayFuture
)

Implements io.netty.util.concurrent.GenericFutureListener.operationComplete.

Invoked when the operation associated with the Future has been completed.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ctxback to summary
private final ChannelHandlerContext ctx
promiseback to summary
private final ChannelPromise promise

Constructor Detail

ClosingChannelFutureListenerback to summary
pack-priv ClosingChannelFutureListener(ChannelHandlerContext ctx, ChannelPromise promise)

Method Detail

operationCompleteback to summary
public void operationComplete(ChannelFuture sentGoAwayFuture) throws Exception

Implements io.netty.util.concurrent.GenericFutureListener.operationComplete.

Doc from io.netty.util.concurrent.GenericFutureListener.operationComplete.

Invoked when the operation associated with the Future has been completed.

Parameters
sentGoAwayFuture:ChannelFuture

the source Future which called this callback

Annotations
@Override