public abstract class AbstractFramedStreamSinkChannel<C extends AbstractFramedChannel<C,R,S>,R extends AbstractFramedStreamSourceChannel<C,R,S>,S extends AbstractFramedStreamSinkChannel<C,R,S>> extends Object implements org.xnio.channels.StreamSinkChannel
STATE_READY_FOR_FLUSH is set, and while this bit is set the buffer
must not be modified.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractFramedStreamSinkChannel(C channel) |
| Modifier and Type | Method and Description |
|---|---|
void |
awaitWritable() |
void |
awaitWritable(long l,
TimeUnit timeUnit) |
void |
close() |
protected org.xnio.Pooled<ByteBuffer> |
createFrameFooter() |
protected org.xnio.Pooled<ByteBuffer> |
createFrameHeader() |
boolean |
flush() |
ByteBuffer |
getBuffer() |
C |
getChannel() |
org.xnio.ChannelListener.Setter<S> |
getCloseSetter() |
org.xnio.XnioIoThread |
getIoThread() |
<T> T |
getOption(org.xnio.Option<T> tOption) |
org.xnio.XnioWorker |
getWorker() |
org.xnio.ChannelListener.Setter<S> |
getWriteSetter() |
org.xnio.XnioExecutor |
getWriteThread() |
protected void |
handleFlushComplete() |
protected boolean |
isActivated() |
protected boolean |
isFinalFrameQueued() |
protected abstract boolean |
isLastFrame() |
boolean |
isOpen() |
boolean |
isReadyForFlush() |
boolean |
isWriteResumed() |
boolean |
isWritesShutdown()
Returns true writes have been shutdown
|
void |
markBroken() |
void |
resumeWrites() |
<T> T |
setOption(org.xnio.Option<T> tOption,
T t) |
void |
shutdownWrites() |
boolean |
supportsOption(org.xnio.Option<?> option) |
void |
suspendWrites() |
long |
transferFrom(FileChannel src,
long position,
long count) |
long |
transferFrom(org.xnio.channels.StreamSourceChannel source,
long count,
ByteBuffer throughBuffer) |
void |
wakeupWrites() |
int |
write(ByteBuffer src) |
long |
write(ByteBuffer[] srcs) |
long |
write(ByteBuffer[] srcs,
int offset,
int length) |
int |
writeFinal(ByteBuffer src) |
long |
writeFinal(ByteBuffer[] srcs) |
long |
writeFinal(ByteBuffer[] srcs,
int offset,
int length) |
protected AbstractFramedStreamSinkChannel(C channel)
public long transferFrom(FileChannel src, long position, long count) throws IOException
transferFrom in interface org.xnio.channels.StreamSinkChannelIOExceptionpublic long transferFrom(org.xnio.channels.StreamSourceChannel source,
long count,
ByteBuffer throughBuffer)
throws IOException
transferFrom in interface org.xnio.channels.StreamSinkChannelIOExceptionpublic void suspendWrites()
suspendWrites in interface org.xnio.channels.SuspendableWriteChannelprotected org.xnio.Pooled<ByteBuffer> createFrameHeader()
protected org.xnio.Pooled<ByteBuffer> createFrameFooter()
public void resumeWrites()
resumeWrites in interface org.xnio.channels.SuspendableWriteChannelpublic boolean isWriteResumed()
isWriteResumed in interface org.xnio.channels.SuspendableWriteChannelpublic void wakeupWrites()
wakeupWrites in interface org.xnio.channels.SuspendableWriteChannelpublic void shutdownWrites()
throws IOException
shutdownWrites in interface org.xnio.channels.SuspendableWriteChannelIOExceptionprotected boolean isFinalFrameQueued()
public void awaitWritable()
throws IOException
awaitWritable in interface org.xnio.channels.SuspendableWriteChannelIOExceptionpublic void awaitWritable(long l,
TimeUnit timeUnit)
throws IOException
awaitWritable in interface org.xnio.channels.SuspendableWriteChannelIOExceptionpublic org.xnio.XnioExecutor getWriteThread()
getWriteThread in interface org.xnio.channels.SuspendableWriteChannelpublic org.xnio.ChannelListener.Setter<S> getWriteSetter()
getWriteSetter in interface org.xnio.channels.StreamSinkChannelgetWriteSetter in interface org.xnio.channels.SuspendableWriteChannelpublic org.xnio.ChannelListener.Setter<S> getCloseSetter()
getCloseSetter in interface org.xnio.channels.CloseableChannelgetCloseSetter in interface org.xnio.channels.StreamSinkChannelgetCloseSetter in interface org.xnio.channels.SuspendableWriteChannelpublic org.xnio.XnioWorker getWorker()
getWorker in interface org.xnio.channels.CloseableChannelpublic org.xnio.XnioIoThread getIoThread()
getIoThread in interface org.xnio.channels.CloseableChannelpublic boolean flush()
throws IOException
flush in interface org.xnio.channels.SuspendableWriteChannelIOExceptionpublic long write(ByteBuffer[] srcs, int offset, int length) throws IOException
write in interface GatheringByteChannelIOExceptionpublic long write(ByteBuffer[] srcs) throws IOException
write in interface GatheringByteChannelIOExceptionpublic int write(ByteBuffer src) throws IOException
write in interface WritableByteChannelIOExceptionpublic long writeFinal(ByteBuffer[] srcs, int offset, int length) throws IOException
writeFinal in interface org.xnio.channels.StreamSinkChannelIOExceptionpublic long writeFinal(ByteBuffer[] srcs) throws IOException
writeFinal in interface org.xnio.channels.StreamSinkChannelIOExceptionpublic int writeFinal(ByteBuffer src) throws IOException
writeFinal in interface org.xnio.channels.StreamSinkChannelIOExceptionprotected abstract boolean isLastFrame()
true If this is the last frame that will be sent on this connectionpublic boolean isReadyForFlush()
public boolean isWritesShutdown()
public boolean isOpen()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface Channelclose in interface InterruptibleChannelclose in interface org.xnio.channels.CloseableChannelclose in interface org.xnio.channels.SuspendableWriteChannelIOExceptionpublic boolean supportsOption(org.xnio.Option<?> option)
supportsOption in interface org.xnio.channels.Configurablepublic <T> T getOption(org.xnio.Option<T> tOption)
throws IOException
getOption in interface org.xnio.channels.ConfigurableIOExceptionpublic <T> T setOption(org.xnio.Option<T> tOption,
T t)
throws IllegalArgumentException,
IOException
setOption in interface org.xnio.channels.ConfigurableIllegalArgumentExceptionIOExceptionpublic ByteBuffer getBuffer()
protected void handleFlushComplete()
public void markBroken()
protected boolean isActivated()
public C getChannel()
Copyright © 2014 JBoss by Red Hat. All rights reserved.