public class SpdyChannel extends AbstractFramedChannel<SpdyChannel,SpdyStreamSourceChannel,SpdyStreamSinkChannel> implements Attachable
| Modifier and Type | Field and Description |
|---|---|
static int | CLOSE_INTERNAL_ERROR |
static int | CLOSE_OK |
static int | CLOSE_PROTOCOL_ERROR |
static int | RST_STATUS_CANCEL |
static int | RST_STATUS_FLOW_CONTROL_ERROR |
static int | RST_STATUS_FRAME_TOO_LARGE |
static int | RST_STATUS_INTERNAL_ERROR |
static int | RST_STATUS_INVALID_STREAM |
static int | RST_STATUS_PROTOCOL_ERROR |
static int | RST_STATUS_REFUSED_STREAM |
static int | RST_STATUS_STREAM_ALREADY_CLOSED |
static int | RST_STATUS_STREAM_IN_USE |
static int | RST_STATUS_UNSUPPORTED_VERSION |
| Constructor and Description |
|---|
SpdyChannel(org.xnio.StreamConnection connectedStreamChannel, ByteBufferPool bufferPool, PooledByteBuffer data, ByteBufferPool heapBufferPool, boolean clientSide, org.xnio.OptionMap options) |
| Modifier and Type | Method and Description |
|---|---|
<T> void | addToAttachmentList(AttachmentKey<AttachmentList<T>> key, T value) Add a value to a list-typed attachment key. |
protected void | closeSubChannels() Method that is called when the channel is being forcibly closed, and all sub stream sink/source channels should also be forcibly closed. |
protected SpdyStreamSourceChannel | createChannel(FrameHeaderData frameHeaderData, PooledByteBuffer frameData) Method that creates the actual stream source channel implementation that is in use. |
SpdySynStreamStreamSinkChannel | createStream(HeaderMap requestHeaders) |
SpdySynStreamStreamSinkChannel | createStream(int associatedStreamId, HeaderMap requestHeaders) |
<T> T | getAttachment(AttachmentKey<T> key) Get an attachment value. |
<T> List<T> | getAttachmentList(AttachmentKey<? extends List<T>> key) Gets a list attachment value. |
int | getSpdyVersion() |
SSLSession | getSslSession() |
protected void | handleBrokenSinkChannel(Throwable e) Method that is invoked when then write side of a channel is broken. |
protected void | handleBrokenSourceChannel(Throwable e) Method that is invoked when the read side of the channel is broken. |
void | handleWindowUpdate(int streamId, int deltaWindowSize) |
boolean | isClient() |
protected boolean | isLastFrameReceived() Returns true if the protocol specific final frame has been received. |
protected boolean | isLastFrameSent() |
boolean | isOpen() |
protected void | lastDataRead() Method than is invoked when read() returns -1. |
protected FrameHeaderData | parseFrame(ByteBuffer data) Attempts to parse an incoming frame header from the data in the buffer. |
<T> T | putAttachment(AttachmentKey<T> key, T value) Set an attachment value. |
<T> T | removeAttachment(AttachmentKey<T> key) Remove an attachment, returning its previous value. |
void | sendGoAway(int status) |
void | sendGoAway(int status, org.xnio.ChannelExceptionHandler<SpdyStreamSinkChannel> exceptionHandler) |
void | sendPing(int id) |
void | sendPing(int id, org.xnio.ChannelExceptionHandler<SpdyStreamSinkChannel> exceptionHandler) |
void | sendRstStream(int streamId, int statusCode) |
void | sendUpdateWindowSize(int streamId, int delta) |
void | updateReceiveFlowControlWindow(int read) |
addCloseTask, close, createIdleTimeoutChannel, flushSenders, getBufferPool, getCloseSetter, getDestinationAddress, getFramePriority, getIdleTimeout, getIoThread, getLocalAddress, getLocalAddress, getOption, getPeerAddress, getPeerAddress, getReceiveSetter, getSourceAddress, getUnderlyingConnection, getWorker, isReadsBroken, isReceivesResumed, isWritesBroken, markReadsBroken, markWritesBroken, queueFrame, recalculateHeldFrames, receive, resumeReceives, setIdleTimeout, setOption, supportsOption, suspendReceives, toString, writeExceptionHandlerpublic static final int CLOSE_OK
public static final int CLOSE_PROTOCOL_ERROR
public static final int CLOSE_INTERNAL_ERROR
public static final int RST_STATUS_PROTOCOL_ERROR
public static final int RST_STATUS_INVALID_STREAM
public static final int RST_STATUS_REFUSED_STREAM
public static final int RST_STATUS_UNSUPPORTED_VERSION
public static final int RST_STATUS_CANCEL
public static final int RST_STATUS_INTERNAL_ERROR
public static final int RST_STATUS_FLOW_CONTROL_ERROR
public static final int RST_STATUS_STREAM_IN_USE
public static final int RST_STATUS_STREAM_ALREADY_CLOSED
public static final int RST_STATUS_FRAME_TOO_LARGE
public SpdyChannel(org.xnio.StreamConnection connectedStreamChannel,
ByteBufferPool bufferPool,
PooledByteBuffer data,
ByteBufferPool heapBufferPool,
boolean clientSide,
org.xnio.OptionMap options) protected SpdyStreamSourceChannel createChannel(FrameHeaderData frameHeaderData, PooledByteBuffer frameData) throws IOException
AbstractFramedChannelcreateChannel in class AbstractFramedChannel<SpdyChannel,SpdyStreamSourceChannel,SpdyStreamSinkChannel>frameHeaderData - The header data, as returned by AbstractFramedChannel.parseFrame(java.nio.ByteBuffer)frameData - Any additional data for the frame that has already been read. This may not be the complete frame contentsIOExceptionprotected FrameHeaderData parseFrame(ByteBuffer data) throws IOException
AbstractFramedChannelparseFrame in class AbstractFramedChannel<SpdyChannel,SpdyStreamSourceChannel,SpdyStreamSinkChannel>data - The data that has been read from the channelnull if the data was incompleteIOException - If the data could not be parsed.protected void lastDataRead()
AbstractFramedChannellastDataRead in class AbstractFramedChannel<SpdyChannel,SpdyStreamSourceChannel,SpdyStreamSinkChannel>public boolean isOpen()
isOpen in interface ChannelisOpen in class AbstractFramedChannel<SpdyChannel,SpdyStreamSourceChannel,SpdyStreamSinkChannel>protected boolean isLastFrameReceived()
AbstractFramedChannelisLastFrameReceived in class AbstractFramedChannel<SpdyChannel,SpdyStreamSourceChannel,SpdyStreamSinkChannel>true If the last frame has been receivedprotected boolean isLastFrameSent()
isLastFrameSent in class AbstractFramedChannel<SpdyChannel,SpdyStreamSourceChannel,SpdyStreamSinkChannel>true If the last frame has been sentprotected void handleBrokenSourceChannel(Throwable e)
AbstractFramedChannelhandleBrokenSourceChannel in class AbstractFramedChannel<SpdyChannel,SpdyStreamSourceChannel,SpdyStreamSinkChannel>protected void handleBrokenSinkChannel(Throwable e)
AbstractFramedChannelhandleBrokenSinkChannel in class AbstractFramedChannel<SpdyChannel,SpdyStreamSourceChannel,SpdyStreamSinkChannel>protected void closeSubChannels()
AbstractFramedChannelcloseSubChannels in class AbstractFramedChannel<SpdyChannel,SpdyStreamSourceChannel,SpdyStreamSinkChannel>public int getSpdyVersion()
public void handleWindowUpdate(int streamId,
int deltaWindowSize)
throws IOException IOExceptionpublic void sendPing(int id)
public void sendPing(int id,
org.xnio.ChannelExceptionHandler<SpdyStreamSinkChannel> exceptionHandler) public void sendGoAway(int status)
public void sendGoAway(int status,
org.xnio.ChannelExceptionHandler<SpdyStreamSinkChannel> exceptionHandler) public void sendUpdateWindowSize(int streamId,
int delta) public SSLSession getSslSession()
public void updateReceiveFlowControlWindow(int read)
public SpdySynStreamStreamSinkChannel createStream(HeaderMap requestHeaders) throws IOException
IOExceptionpublic SpdySynStreamStreamSinkChannel createStream(int associatedStreamId, HeaderMap requestHeaders) throws IOException
IOExceptionpublic boolean isClient()
public <T> T getAttachment(AttachmentKey<T> key)
Attachablenull is returned.getAttachment in interface AttachableT - the value typekey - the attachment keynull if there is nonepublic <T> List<T> getAttachmentList(AttachmentKey<? extends List<T>> key)
AttachablegetAttachmentList in interface AttachableT - the value typekey - the attachment keypublic <T> T putAttachment(AttachmentKey<T> key, T value)
Attachablenull, the attachment key is removed.putAttachment in interface AttachableT - the value typekey - the attachment keyvalue - the new valuenull if there was nonepublic <T> T removeAttachment(AttachmentKey<T> key)
AttachableremoveAttachment in interface AttachableT - the value typekey - the attachment keynull if there was nonepublic <T> void addToAttachmentList(AttachmentKey<AttachmentList<T>> key, T value)
AttachableaddToAttachmentList in interface AttachableT - the list value typekey - the attachment keyvalue - the value to addpublic void sendRstStream(int streamId,
int statusCode) Copyright © 2015 JBoss by Red Hat. All rights reserved.