Class SpdySessionHandler
java.lang.Object
org.jboss.netty.channel.SimpleChannelUpstreamHandler
org.jboss.netty.handler.codec.spdy.SpdySessionHandler
- All Implemented Interfaces:
ChannelDownstreamHandler,ChannelHandler,ChannelUpstreamHandler
public class SpdySessionHandler
extends SimpleChannelUpstreamHandler
implements ChannelDownstreamHandler
Manages streams within a SPDY session.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classNested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChannelFutureListenerprivate static final intprivate static final intprivate final Objectprivate intprivate intprivate intprivate intprivate intprivate final intprivate final AtomicIntegerprivate static final SpdyProtocolExceptionprivate booleanprivate intprivate booleanprivate final booleanprivate final SpdySession -
Constructor Summary
ConstructorsConstructorDescriptionSpdySessionHandler(SpdyVersion spdyVersion, boolean server) Creates a new session handler. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanacceptStream(int streamId, byte priority, boolean remoteSideClosed, boolean localSideClosed) voidInvoked when an exception was raised by an I/O thread or aChannelHandler.private voidhalfCloseStream(int streamId, boolean remote, ChannelFuture future) voidHandles the specified downstream event.private booleanisRemoteInitiatedId(int id) private voidissueSessionError(ChannelHandlerContext ctx, Channel channel, SocketAddress remoteAddress, SpdySessionStatus status) private voidissueStreamError(ChannelHandlerContext ctx, SocketAddress remoteAddress, int streamId, SpdyStreamStatus status) voidInvoked when a message object (e.g:ChannelBuffer) was received from a remote peer.private voidremoveStream(int streamId, ChannelFuture future) private ChannelFuturesendGoAwayFrame(ChannelHandlerContext ctx, Channel channel, SocketAddress remoteAddress, SpdySessionStatus status) private voidvoidsetSessionReceiveWindowSize(int sessionReceiveWindowSize) private voidupdateInitialReceiveWindowSize(int newInitialWindowSize) private voidupdateInitialSendWindowSize(int newInitialWindowSize) private voidupdateSendWindowSize(ChannelHandlerContext ctx, int streamId, int deltaWindowSize) Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete
-
Field Details
-
PROTOCOL_EXCEPTION
-
DEFAULT_WINDOW_SIZE
private static final int DEFAULT_WINDOW_SIZE- See Also:
-
initialSendWindowSize
private volatile int initialSendWindowSize -
initialReceiveWindowSize
private volatile int initialReceiveWindowSize -
initialSessionReceiveWindowSize
private volatile int initialSessionReceiveWindowSize -
spdySession
-
lastGoodStreamId
private volatile int lastGoodStreamId -
DEFAULT_MAX_CONCURRENT_STREAMS
private static final int DEFAULT_MAX_CONCURRENT_STREAMS- See Also:
-
remoteConcurrentStreams
private volatile int remoteConcurrentStreams -
localConcurrentStreams
private volatile int localConcurrentStreams -
flowControlLock
-
pings
-
sentGoAwayFrame
private volatile boolean sentGoAwayFrame -
receivedGoAwayFrame
private volatile boolean receivedGoAwayFrame -
closeSessionFutureListener
-
server
private final boolean server -
minorVersion
private final int minorVersion
-
-
Constructor Details
-
SpdySessionHandler
Creates a new session handler.- Parameters:
spdyVersion- the protocol versionserver-trueif and only if this session handler should handle the server endpoint of the connection.falseif and only if this session handler should handle the client endpoint of the connection.
-
-
Method Details
-
setSessionReceiveWindowSize
public void setSessionReceiveWindowSize(int sessionReceiveWindowSize) -
messageReceived
Description copied from class:SimpleChannelUpstreamHandlerInvoked when a message object (e.g:ChannelBuffer) was received from a remote peer.- Overrides:
messageReceivedin classSimpleChannelUpstreamHandler- Throws:
Exception
-
exceptionCaught
Description copied from class:SimpleChannelUpstreamHandlerInvoked when an exception was raised by an I/O thread or aChannelHandler.- Overrides:
exceptionCaughtin classSimpleChannelUpstreamHandler- Throws:
Exception
-
handleDownstream
Description copied from interface:ChannelDownstreamHandlerHandles the specified downstream event.- Specified by:
handleDownstreamin interfaceChannelDownstreamHandler- Parameters:
ctx- the context object for this handlerevt- the downstream event to process or intercept- Throws:
Exception
-
issueSessionError
private void issueSessionError(ChannelHandlerContext ctx, Channel channel, SocketAddress remoteAddress, SpdySessionStatus status) -
issueStreamError
private void issueStreamError(ChannelHandlerContext ctx, SocketAddress remoteAddress, int streamId, SpdyStreamStatus status) -
isRemoteInitiatedId
private boolean isRemoteInitiatedId(int id) -
updateInitialSendWindowSize
private void updateInitialSendWindowSize(int newInitialWindowSize) -
updateInitialReceiveWindowSize
private void updateInitialReceiveWindowSize(int newInitialWindowSize) -
acceptStream
private boolean acceptStream(int streamId, byte priority, boolean remoteSideClosed, boolean localSideClosed) -
halfCloseStream
-
removeStream
-
updateSendWindowSize
-
sendGoAwayFrame
-
sendGoAwayFrame
private ChannelFuture sendGoAwayFrame(ChannelHandlerContext ctx, Channel channel, SocketAddress remoteAddress, SpdySessionStatus status)
-