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 class
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChannelFutureListener
private static final int
private static final int
private final Object
private int
private int
private 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
-
Constructor Summary
ConstructorsConstructorDescriptionSpdySessionHandler
(SpdyVersion spdyVersion, boolean server) Creates a new session handler. -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
acceptStream
(int streamId, byte priority, boolean remoteSideClosed, boolean localSideClosed) void
Invoked when an exception was raised by an I/O thread or aChannelHandler
.private void
halfCloseStream
(int streamId, boolean remote, ChannelFuture future) void
Handles the specified downstream event.private boolean
isRemoteInitiatedId
(int id) private void
issueSessionError
(ChannelHandlerContext ctx, Channel channel, SocketAddress remoteAddress, SpdySessionStatus status) private void
issueStreamError
(ChannelHandlerContext ctx, SocketAddress remoteAddress, int streamId, SpdyStreamStatus status) void
Invoked when a message object (e.g:ChannelBuffer
) was received from a remote peer.private void
removeStream
(int streamId, ChannelFuture future) private ChannelFuture
sendGoAwayFrame
(ChannelHandlerContext ctx, Channel channel, SocketAddress remoteAddress, SpdySessionStatus status) private void
void
setSessionReceiveWindowSize
(int sessionReceiveWindowSize) private void
updateInitialReceiveWindowSize
(int newInitialWindowSize) private void
updateInitialSendWindowSize
(int newInitialWindowSize) private void
updateSendWindowSize
(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
-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 Details
-
setSessionReceiveWindowSize
public void setSessionReceiveWindowSize(int sessionReceiveWindowSize) -
messageReceived
Description copied from class:SimpleChannelUpstreamHandler
Invoked when a message object (e.g:ChannelBuffer
) was received from a remote peer.- Overrides:
messageReceived
in classSimpleChannelUpstreamHandler
- Throws:
Exception
-
exceptionCaught
Description copied from class:SimpleChannelUpstreamHandler
Invoked when an exception was raised by an I/O thread or aChannelHandler
.- Overrides:
exceptionCaught
in classSimpleChannelUpstreamHandler
- Throws:
Exception
-
handleDownstream
Description copied from interface:ChannelDownstreamHandler
Handles the specified downstream event.- Specified by:
handleDownstream
in 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)
-