public abstract class StreamSourceFrameChannel extends Object implements org.xnio.channels.StreamSourceChannel
Modifier and Type | Field and Description |
---|---|
protected org.xnio.channels.StreamSourceChannel |
channel |
protected WebSocketFrameType |
type |
protected WebSocketChannel |
wsChannel |
Modifier | Constructor and Description |
---|---|
protected |
StreamSourceFrameChannel(WebSocketChannel.StreamSourceChannelControl streamSourceChannelControl,
org.xnio.channels.StreamSourceChannel channel,
WebSocketChannel wsChannel,
WebSocketFrameType type,
long payloadSize) |
protected |
StreamSourceFrameChannel(WebSocketChannel.StreamSourceChannelControl streamSourceChannelControl,
org.xnio.channels.StreamSourceChannel channel,
WebSocketChannel wsChannel,
WebSocketFrameType type,
long payloadSize,
int rsv,
boolean finalFragment) |
Modifier and Type | Method and Description |
---|---|
void |
awaitReadable() |
void |
awaitReadable(long time,
TimeUnit timeUnit) |
void |
close() |
protected void |
complete()
Is called once the whole frame was read.
|
void |
discard()
Discard the frame, which means all data that would be part of the frame will be discarded.
|
org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSourceChannel> |
getCloseSetter() |
org.xnio.XnioIoThread |
getIoThread() |
<T> T |
getOption(org.xnio.Option<T> option) |
long |
getPayloadSize()
Return the payload size of
-1 if unknown on creation |
org.xnio.ChannelListener.SimpleSetter<? extends StreamSourceFrameChannel> |
getReadSetter() |
org.xnio.XnioExecutor |
getReadThread() |
int |
getRsv()
Return the rsv which is used for extensions.
|
WebSocketFrameType |
getType()
Return the
WebSocketFrameType or null if its not known at the calling time. |
WebSocketChannel |
getWebSocketChannel() |
org.xnio.XnioWorker |
getWorker() |
protected abstract boolean |
isComplete()
Returns
true if the frame was complete. |
boolean |
isFinalFragment()
Flag to indicate if this frame is the final fragment in a message.
|
boolean |
isOpen() |
boolean |
isReadResumed() |
protected void |
queueListener(org.xnio.ChannelListener<StreamSourceFrameChannel> listener) |
int |
read(ByteBuffer dst) |
long |
read(ByteBuffer[] dsts) |
long |
read(ByteBuffer[] dsts,
int offset,
int length) |
protected abstract int |
read0(ByteBuffer dst) |
protected abstract long |
read0(ByteBuffer[] dsts) |
protected abstract long |
read0(ByteBuffer[] dsts,
int offset,
int length) |
void |
resumeReads() |
<T> T |
setOption(org.xnio.Option<T> option,
T value) |
void |
shutdownReads() |
boolean |
supportsOption(org.xnio.Option<?> option) |
void |
suspendReads() |
long |
transferTo(long count,
ByteBuffer throughBuffer,
org.xnio.channels.StreamSinkChannel target) |
long |
transferTo(long position,
long count,
FileChannel target) |
protected abstract long |
transferTo0(long count,
ByteBuffer throughBuffer,
org.xnio.channels.StreamSinkChannel target) |
protected abstract long |
transferTo0(long position,
long count,
FileChannel target) |
void |
wakeupReads() |
protected final WebSocketFrameType type
protected final org.xnio.channels.StreamSourceChannel channel
protected final WebSocketChannel wsChannel
protected StreamSourceFrameChannel(WebSocketChannel.StreamSourceChannelControl streamSourceChannelControl, org.xnio.channels.StreamSourceChannel channel, WebSocketChannel wsChannel, WebSocketFrameType type, long payloadSize)
protected StreamSourceFrameChannel(WebSocketChannel.StreamSourceChannelControl streamSourceChannelControl, org.xnio.channels.StreamSourceChannel channel, WebSocketChannel wsChannel, WebSocketFrameType type, long payloadSize, int rsv, boolean finalFragment)
public long getPayloadSize()
-1
if unknown on creationprotected abstract boolean isComplete()
true
if the frame was complete.public final long read(ByteBuffer[] dsts, int offset, int length) throws IOException
read
in interface ScatteringByteChannel
IOException
protected abstract long read0(ByteBuffer[] dsts, int offset, int length) throws IOException
IOException
ScatteringByteChannel.read(ByteBuffer[], int, int)
public final long read(ByteBuffer[] dsts) throws IOException
read
in interface ScatteringByteChannel
IOException
protected abstract long read0(ByteBuffer[] dsts) throws IOException
IOException
ScatteringByteChannel.read(ByteBuffer[])
public final int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
IOException
protected abstract int read0(ByteBuffer dst) throws IOException
IOException
ReadableByteChannel.read(ByteBuffer)
public final long transferTo(long position, long count, FileChannel target) throws IOException
transferTo
in interface org.xnio.channels.StreamSourceChannel
IOException
protected abstract long transferTo0(long position, long count, FileChannel target) throws IOException
IOException
StreamSourceChannel.transferTo(long, long, FileChannel)
public final long transferTo(long count, ByteBuffer throughBuffer, org.xnio.channels.StreamSinkChannel target) throws IOException
transferTo
in interface org.xnio.channels.StreamSourceChannel
IOException
protected abstract long transferTo0(long count, ByteBuffer throughBuffer, org.xnio.channels.StreamSinkChannel target) throws IOException
IOException
StreamSourceChannel.transferTo(long, ByteBuffer, StreamSinkChannel)
protected void complete() throws IOException
IOException
public WebSocketFrameType getType()
WebSocketFrameType
or null
if its not known at the calling time.public boolean isFinalFragment()
public int getRsv()
public org.xnio.ChannelListener.SimpleSetter<? extends StreamSourceFrameChannel> getReadSetter()
getReadSetter
in interface org.xnio.channels.StreamSourceChannel
getReadSetter
in interface org.xnio.channels.SuspendableReadChannel
public org.xnio.XnioWorker getWorker()
getWorker
in interface org.xnio.channels.CloseableChannel
public org.xnio.XnioIoThread getIoThread()
getIoThread
in interface org.xnio.channels.CloseableChannel
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
close
in interface InterruptibleChannel
close
in interface org.xnio.channels.CloseableChannel
IOException
protected final void queueListener(org.xnio.ChannelListener<StreamSourceFrameChannel> listener)
public void discard() throws IOException
close()
IOException
public void suspendReads()
suspendReads
in interface org.xnio.channels.SuspendableReadChannel
public void resumeReads()
resumeReads
in interface org.xnio.channels.SuspendableReadChannel
public boolean isReadResumed()
isReadResumed
in interface org.xnio.channels.SuspendableReadChannel
public void wakeupReads()
wakeupReads
in interface org.xnio.channels.SuspendableReadChannel
public void shutdownReads() throws IOException
shutdownReads
in interface org.xnio.channels.SuspendableReadChannel
IOException
public void awaitReadable() throws IOException
awaitReadable
in interface org.xnio.channels.SuspendableReadChannel
IOException
public void awaitReadable(long time, TimeUnit timeUnit) throws IOException
awaitReadable
in interface org.xnio.channels.SuspendableReadChannel
IOException
public org.xnio.XnioExecutor getReadThread()
getReadThread
in interface org.xnio.channels.SuspendableReadChannel
public boolean supportsOption(org.xnio.Option<?> option)
supportsOption
in interface org.xnio.channels.Configurable
public <T> T getOption(org.xnio.Option<T> option) throws IOException
getOption
in interface org.xnio.channels.Configurable
IOException
public <T> T setOption(org.xnio.Option<T> option, T value) throws IOException
setOption
in interface org.xnio.channels.Configurable
IOException
public org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSourceChannel> getCloseSetter()
getCloseSetter
in interface org.xnio.channels.CloseableChannel
getCloseSetter
in interface org.xnio.channels.StreamSourceChannel
getCloseSetter
in interface org.xnio.channels.SuspendableReadChannel
public WebSocketChannel getWebSocketChannel()
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.