org.xnio.channels.ConnectedChannel which can be used to send and receive Frames.
This provides a common base for framed protocols such as websockets and SPDY
| Modifier and Type | Class and Description |
|---|---|
| private class | AbstractFramedChannel.
close listener, just goes through and activates any sub channels to make sure their listeners are invoked |
| private class | AbstractFramedChannel.
|
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBufferPool | |
| private final StreamConnection | |
| private final ChannelListener. | |
| private final List | |
| private static final ChannelListener | |
| private volatile boolean | |
| private volatile long | |
| private final FramePriority | framePriority
Frame priority implementation. |
| private final ReferenceCountedPooled. | |
| private final Deque | heldFrames
Frames that are not yet read to send. |
| private final IdleTimeoutConduit | |
| private final Object | |
| private final int | maxQueuedBuffers
The maximum number of buffers we will queue before suspending reads and waiting for the buffers to be consumed Todo make the configurable |
| private final Deque | newFrames
new frames to be sent. |
| private volatile int | |
| private static final AtomicIntegerFieldUpdater | |
| private boolean | |
| private final List | pendingFrames
List of frames that are ready to send |
| private final int | |
| private final int | |
| private volatile boolean | |
| private volatile ReferenceCountedPooled | |
| private volatile int | |
| private static final AtomicIntegerFieldUpdater | |
| private volatile R | |
| private final ChannelListener. | |
| private volatile boolean | |
| private volatile boolean | |
| private volatile boolean | |
| private volatile boolean | requireExplicitFlush
If this is true then the flush() method must be called to queue writes. |
| private final OptionMap | |
| private final LinkedBlockingDeque | |
| private final Runnable | |
| private volatile int | |
| private static final AtomicIntegerFieldUpdater |
| Access | Constructor and Description |
|---|---|
| protected | AbstractFramedChannel(final StreamConnection
The connectedStreamChannel, ByteBufferPool org. over which the Frames should get send and received.
Be aware that it already must be "upgraded".The bufferPool, FramePriority<C, R, S> framePriority, final PooledByteBuffer readData, OptionMap ByteBufferPool which will be used to acquire ByteBuffer's from.The settings settings)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private ReferenceCountedPooled | |
| pack-priv void | |
| pack-priv void | |
| public void | close()
Implements org. Forcibly closes the |
| protected abstract 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 abstract R | Returns: A new stream source channelThe header data, as returned by frameHeaderData, PooledByteBuffer parseFrame(java.Any additional data for the frame that has already been read. This may not be the complete frame contents frameData)Method that creates the actual stream source channel implementation that is in use. |
| protected IdleTimeoutConduit | |
| private void | |
| public void | |
| protected synchronized void | |
| public ByteBufferPool | |
| public ChannelListener. | getCloseSetter()
Implements org. Get the setter which can be used to change the close listener for this channel. |
| public InetSocketAddress | Returns: the destination address of the ChannelGet the destination address of the Channel. |
| protected FramePriority | |
| public long | |
| public XnioIoThread | getIoThread()
Implements org. Get the I/O thread associated with this channel. |
| public SocketAddress | getLocalAddress()
Implements org. Get the local address that this channel is bound to. |
| public <A extends SocketAddress> A | getLocalAddress(Class<A>
the address type class type)Implements org. Get the local address of a given type, or |
| public <T> T | getOption(Option<T>
the option to get option)Implements org. Get the value of a channel option. |
| public SocketAddress | getPeerAddress()
Implements org. Get the peer address of this channel. |
| public <A extends SocketAddress> A | getPeerAddress(Class<A>
the address type class type)Implements org. Get the peer address of a given type, or |
| protected abstract Collection | |
| public ChannelListener. | getReceiveSetter()
Return the |
| protected OptionMap | |
| public InetSocketAddress | |
| pack-priv StreamSourceChannel | |
| protected StreamConnection | |
| public XnioWorker | getWorker()
Implements org. Get the worker for this channel. |
| protected abstract void | handleBrokenSinkChannel(Throwable e)
Method that is invoked when then write side of a channel is broken. |
| protected abstract void | handleBrokenSourceChannel(Throwable e)
Method that is invoked when the read side of the channel is broken. |
| private void | handleLastFrame(AbstractFramedStreamSourceChannel<C extends AbstractFramedChannel<C, R, S>, R extends AbstractFramedStreamSourceChannel<C, R, S>, S extends AbstractFramedStreamSinkChannel<C, R, S>>
The channel that received the last frame newChannel)Called when the last frame has been received (note that their may still be data from the last frame than needs to be read) |
| protected abstract boolean | Returns: true If the last frame has been receivedReturns true if the protocol specific final frame has been received. |
| protected abstract boolean | |
| public boolean | |
| protected boolean | |
| private boolean | |
| public boolean | |
| public boolean | |
| protected boolean | |
| protected void | |
| protected void | markReadsBroken(Throwable
The possibly null cause cause)Called when a source sub channel fails to fulfil its contract, and leaves the channel in an inconsistent state. |
| protected void | markWritesBroken(Throwable
The possibly null cause cause)Called when a sub channel fails to fulfil its contract, and leaves the channel in an inconsistent state. |
| pack-priv void | |
| protected abstract FrameHeaderData | Returns: The frame header data, ornull if the data was incompleteThe data that has been read from the channel data)Attempts to parse an incoming frame header from the data in the buffer. |
| protected void | queueFrame(final S
The channel channel)Queues a new frame to be sent, and attempts a flush if this is the first frame in the new frame queue. |
| protected synchronized void | |
| public synchronized R | |
| public synchronized void | |
| pack-priv void | |
| pack-priv void | runInIoThread(Runnable
The task to be executed in the IO thread task)Adds the task to the queue and executes the IO thread runner. |
| pack-priv void | runNowOrInIoThread(Runnable
The task to be executed in the IO thread task)Executes the task in IO thread now if the current thread is the IO thread or schedules it calling method runInIoThread. |
| public void | |
| public <T> T | setOption(Option<T>
the option to set option, T the value of the option to set value)Implements org. Set an option for this channel. |
| public void | |
| public boolean | supportsOption(Option<?>
the option option)Implements org. Determine whether an option is supported on this channel. |
| public synchronized void | |
| pack-priv void | |
| public String | |
| pack-priv void | |
| protected ChannelExceptionHandler |