Package io.undertow.channels
Class DetachableStreamSinkChannel
- java.lang.Object
-
- io.undertow.channels.DetachableStreamSinkChannel
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel,java.nio.channels.GatheringByteChannel,java.nio.channels.InterruptibleChannel,java.nio.channels.WritableByteChannel,org.xnio.channels.CloseableChannel,org.xnio.channels.Configurable,org.xnio.channels.StreamSinkChannel,org.xnio.channels.SuspendableWriteChannel
public abstract class DetachableStreamSinkChannel extends java.lang.Object implements org.xnio.channels.StreamSinkChannelStream sink channel. When this channel is considered detached it will no longer forward calls to the delegate- Author:
- Stuart Douglas
-
-
Field Summary
Fields Modifier and Type Field Description protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSinkChannel>closeSetterprotected org.xnio.channels.StreamSinkChanneldelegateprotected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSinkChannel>writeSetter
-
Constructor Summary
Constructors Constructor Description DetachableStreamSinkChannel(org.xnio.channels.StreamSinkChannel delegate)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidawaitWritable()voidawaitWritable(long time, java.util.concurrent.TimeUnit timeUnit)voidclose()booleanflush()org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel>getCloseSetter()org.xnio.XnioIoThreadgetIoThread()<T> TgetOption(org.xnio.Option<T> option)org.xnio.XnioWorkergetWorker()org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel>getWriteSetter()org.xnio.XnioExecutorgetWriteThread()protected abstract booleanisFinished()booleanisOpen()booleanisWriteResumed()voidresponseDone()voidresumeWrites()<T> TsetOption(org.xnio.Option<T> option, T value)voidshutdownWrites()booleansupportsOption(org.xnio.Option<?> option)voidsuspendWrites()longtransferFrom(java.nio.channels.FileChannel src, long position, long count)longtransferFrom(org.xnio.channels.StreamSourceChannel source, long count, java.nio.ByteBuffer throughBuffer)voidwakeupWrites()intwrite(java.nio.ByteBuffer src)longwrite(java.nio.ByteBuffer[] srcs)longwrite(java.nio.ByteBuffer[] srcs, int offset, int length)intwriteFinal(java.nio.ByteBuffer src)longwriteFinal(java.nio.ByteBuffer[] srcs)longwriteFinal(java.nio.ByteBuffer[] srcs, int offset, int length)
-
-
-
Field Detail
-
delegate
protected final org.xnio.channels.StreamSinkChannel delegate
-
writeSetter
protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSinkChannel> writeSetter
-
closeSetter
protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSinkChannel> closeSetter
-
-
Method Detail
-
isFinished
protected abstract boolean isFinished()
-
suspendWrites
public void suspendWrites()
- Specified by:
suspendWritesin interfaceorg.xnio.channels.SuspendableWriteChannel
-
isWriteResumed
public boolean isWriteResumed()
- Specified by:
isWriteResumedin interfaceorg.xnio.channels.SuspendableWriteChannel
-
shutdownWrites
public void shutdownWrites() throws java.io.IOException- Specified by:
shutdownWritesin interfaceorg.xnio.channels.SuspendableWriteChannel- Throws:
java.io.IOException
-
awaitWritable
public void awaitWritable() throws java.io.IOException- Specified by:
awaitWritablein interfaceorg.xnio.channels.SuspendableWriteChannel- Throws:
java.io.IOException
-
awaitWritable
public void awaitWritable(long time, java.util.concurrent.TimeUnit timeUnit) throws java.io.IOException- Specified by:
awaitWritablein interfaceorg.xnio.channels.SuspendableWriteChannel- Throws:
java.io.IOException
-
getWriteThread
public org.xnio.XnioExecutor getWriteThread()
- Specified by:
getWriteThreadin interfaceorg.xnio.channels.SuspendableWriteChannel
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfacejava.nio.channels.Channel- Specified by:
isOpenin interfaceorg.xnio.channels.SuspendableWriteChannel
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.nio.channels.Channel- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceorg.xnio.channels.CloseableChannel- Specified by:
closein interfacejava.nio.channels.InterruptibleChannel- Specified by:
closein interfaceorg.xnio.channels.SuspendableWriteChannel- Throws:
java.io.IOException
-
flush
public boolean flush() throws java.io.IOException- Specified by:
flushin interfaceorg.xnio.channels.SuspendableWriteChannel- Throws:
java.io.IOException
-
transferFrom
public long transferFrom(java.nio.channels.FileChannel src, long position, long count) throws java.io.IOException- Specified by:
transferFromin interfaceorg.xnio.channels.StreamSinkChannel- Throws:
java.io.IOException
-
transferFrom
public long transferFrom(org.xnio.channels.StreamSourceChannel source, long count, java.nio.ByteBuffer throughBuffer) throws java.io.IOException- Specified by:
transferFromin interfaceorg.xnio.channels.StreamSinkChannel- Throws:
java.io.IOException
-
getWriteSetter
public org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel> getWriteSetter()
- Specified by:
getWriteSetterin interfaceorg.xnio.channels.StreamSinkChannel- Specified by:
getWriteSetterin interfaceorg.xnio.channels.SuspendableWriteChannel
-
getCloseSetter
public org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel> getCloseSetter()
- Specified by:
getCloseSetterin interfaceorg.xnio.channels.CloseableChannel- Specified by:
getCloseSetterin interfaceorg.xnio.channels.StreamSinkChannel- Specified by:
getCloseSetterin interfaceorg.xnio.channels.SuspendableWriteChannel
-
getWorker
public org.xnio.XnioWorker getWorker()
- Specified by:
getWorkerin interfaceorg.xnio.channels.CloseableChannel
-
getIoThread
public org.xnio.XnioIoThread getIoThread()
- Specified by:
getIoThreadin interfaceorg.xnio.channels.CloseableChannel
-
write
public long write(java.nio.ByteBuffer[] srcs, int offset, int length) throws java.io.IOException- Specified by:
writein interfacejava.nio.channels.GatheringByteChannel- Throws:
java.io.IOException
-
write
public long write(java.nio.ByteBuffer[] srcs) throws java.io.IOException- Specified by:
writein interfacejava.nio.channels.GatheringByteChannel- Throws:
java.io.IOException
-
writeFinal
public int writeFinal(java.nio.ByteBuffer src) throws java.io.IOException- Specified by:
writeFinalin interfaceorg.xnio.channels.StreamSinkChannel- Throws:
java.io.IOException
-
writeFinal
public long writeFinal(java.nio.ByteBuffer[] srcs, int offset, int length) throws java.io.IOException- Specified by:
writeFinalin interfaceorg.xnio.channels.StreamSinkChannel- Throws:
java.io.IOException
-
writeFinal
public long writeFinal(java.nio.ByteBuffer[] srcs) throws java.io.IOException- Specified by:
writeFinalin interfaceorg.xnio.channels.StreamSinkChannel- Throws:
java.io.IOException
-
supportsOption
public boolean supportsOption(org.xnio.Option<?> option)
- Specified by:
supportsOptionin interfaceorg.xnio.channels.Configurable
-
getOption
public <T> T getOption(org.xnio.Option<T> option) throws java.io.IOException- Specified by:
getOptionin interfaceorg.xnio.channels.Configurable- Throws:
java.io.IOException
-
setOption
public <T> T setOption(org.xnio.Option<T> option, T value) throws java.lang.IllegalArgumentException, java.io.IOException- Specified by:
setOptionin interfaceorg.xnio.channels.Configurable- Throws:
java.lang.IllegalArgumentExceptionjava.io.IOException
-
write
public int write(java.nio.ByteBuffer src) throws java.io.IOException- Specified by:
writein interfacejava.nio.channels.WritableByteChannel- Throws:
java.io.IOException
-
resumeWrites
public void resumeWrites()
- Specified by:
resumeWritesin interfaceorg.xnio.channels.SuspendableWriteChannel
-
wakeupWrites
public void wakeupWrites()
- Specified by:
wakeupWritesin interfaceorg.xnio.channels.SuspendableWriteChannel
-
responseDone
public void responseDone()
-
-