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
-1if 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()
-1if 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 ScatteringByteChannelIOExceptionprotected abstract long read0(ByteBuffer[] dsts, int offset, int length) throws IOException
IOExceptionScatteringByteChannel.read(ByteBuffer[], int, int)public final long read(ByteBuffer[] dsts) throws IOException
read in interface ScatteringByteChannelIOExceptionprotected abstract long read0(ByteBuffer[] dsts) throws IOException
IOExceptionScatteringByteChannel.read(ByteBuffer[])public final int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelIOExceptionprotected abstract int read0(ByteBuffer dst) throws IOException
IOExceptionReadableByteChannel.read(ByteBuffer)public final long transferTo(long position,
long count,
FileChannel target)
throws IOException
transferTo in interface org.xnio.channels.StreamSourceChannelIOExceptionprotected abstract long transferTo0(long position,
long count,
FileChannel target)
throws IOException
IOExceptionStreamSourceChannel.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.StreamSourceChannelIOExceptionprotected abstract long transferTo0(long count,
ByteBuffer throughBuffer,
org.xnio.channels.StreamSinkChannel target)
throws IOException
IOExceptionStreamSourceChannel.transferTo(long, ByteBuffer, StreamSinkChannel)protected void complete()
throws IOException
IOExceptionpublic 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.StreamSourceChannelgetReadSetter in interface org.xnio.channels.SuspendableReadChannelpublic org.xnio.XnioWorker getWorker()
getWorker in interface org.xnio.channels.CloseableChannelpublic org.xnio.XnioIoThread getIoThread()
getIoThread in interface org.xnio.channels.CloseableChannelpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface Channelclose in interface InterruptibleChannelclose in interface org.xnio.channels.CloseableChannelIOExceptionprotected final void queueListener(org.xnio.ChannelListener<StreamSourceFrameChannel> listener)
public void discard()
throws IOException
close()IOExceptionpublic void suspendReads()
suspendReads in interface org.xnio.channels.SuspendableReadChannelpublic void resumeReads()
resumeReads in interface org.xnio.channels.SuspendableReadChannelpublic boolean isReadResumed()
isReadResumed in interface org.xnio.channels.SuspendableReadChannelpublic void wakeupReads()
wakeupReads in interface org.xnio.channels.SuspendableReadChannelpublic void shutdownReads()
throws IOException
shutdownReads in interface org.xnio.channels.SuspendableReadChannelIOExceptionpublic void awaitReadable()
throws IOException
awaitReadable in interface org.xnio.channels.SuspendableReadChannelIOExceptionpublic void awaitReadable(long time,
TimeUnit timeUnit)
throws IOException
awaitReadable in interface org.xnio.channels.SuspendableReadChannelIOExceptionpublic org.xnio.XnioExecutor getReadThread()
getReadThread in interface org.xnio.channels.SuspendableReadChannelpublic boolean supportsOption(org.xnio.Option<?> option)
supportsOption in interface org.xnio.channels.Configurablepublic <T> T getOption(org.xnio.Option<T> option)
throws IOException
getOption in interface org.xnio.channels.ConfigurableIOExceptionpublic <T> T setOption(org.xnio.Option<T> option,
T value)
throws IOException
setOption in interface org.xnio.channels.ConfigurableIOExceptionpublic org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSourceChannel> getCloseSetter()
getCloseSetter in interface org.xnio.channels.CloseableChannelgetCloseSetter in interface org.xnio.channels.StreamSourceChannelgetCloseSetter in interface org.xnio.channels.SuspendableReadChannelpublic WebSocketChannel getWebSocketChannel()
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.