Package io.undertow.channels
Class DetachableStreamSourceChannel
- java.lang.Object
-
- io.undertow.channels.DetachableStreamSourceChannel
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel,java.nio.channels.InterruptibleChannel,java.nio.channels.ReadableByteChannel,java.nio.channels.ScatteringByteChannel,org.xnio.channels.CloseableChannel,org.xnio.channels.Configurable,org.xnio.channels.StreamSourceChannel,org.xnio.channels.SuspendableReadChannel
public abstract class DetachableStreamSourceChannel extends java.lang.Object implements org.xnio.channels.StreamSourceChannelA stream source channel that can be marked as detached. Once this is marked as detached then calls will no longer be forwarded to the delegate.- Author:
- Stuart Douglas
-
-
Field Summary
Fields Modifier and Type Field Description protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSourceChannel>closeSetterprotected org.xnio.channels.StreamSourceChanneldelegateprotected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSourceChannel>readSetter
-
Constructor Summary
Constructors Constructor Description DetachableStreamSourceChannel(org.xnio.channels.StreamSourceChannel delegate)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidawaitReadable()voidawaitReadable(long time, java.util.concurrent.TimeUnit timeUnit)voidclose()org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSourceChannel>getCloseSetter()org.xnio.XnioIoThreadgetIoThread()<T> TgetOption(org.xnio.Option<T> option)org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSourceChannel>getReadSetter()org.xnio.XnioExecutorgetReadThread()org.xnio.XnioWorkergetWorker()protected abstract booleanisFinished()booleanisOpen()booleanisReadResumed()intread(java.nio.ByteBuffer dst)longread(java.nio.ByteBuffer[] dsts)longread(java.nio.ByteBuffer[] dsts, int offset, int length)voidresumeReads()<T> TsetOption(org.xnio.Option<T> option, T value)voidshutdownReads()booleansupportsOption(org.xnio.Option<?> option)voidsuspendReads()longtransferTo(long position, long count, java.nio.channels.FileChannel target)longtransferTo(long count, java.nio.ByteBuffer throughBuffer, org.xnio.channels.StreamSinkChannel target)voidwakeupReads()
-
-
-
Field Detail
-
delegate
protected final org.xnio.channels.StreamSourceChannel delegate
-
readSetter
protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSourceChannel> readSetter
-
closeSetter
protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSourceChannel> closeSetter
-
-
Method Detail
-
isFinished
protected abstract boolean isFinished()
-
resumeReads
public void resumeReads()
- Specified by:
resumeReadsin interfaceorg.xnio.channels.SuspendableReadChannel
-
transferTo
public long transferTo(long position, long count, java.nio.channels.FileChannel target) throws java.io.IOException- Specified by:
transferToin interfaceorg.xnio.channels.StreamSourceChannel- Throws:
java.io.IOException
-
awaitReadable
public void awaitReadable() throws java.io.IOException- Specified by:
awaitReadablein interfaceorg.xnio.channels.SuspendableReadChannel- Throws:
java.io.IOException
-
suspendReads
public void suspendReads()
- Specified by:
suspendReadsin interfaceorg.xnio.channels.SuspendableReadChannel
-
transferTo
public long transferTo(long count, java.nio.ByteBuffer throughBuffer, org.xnio.channels.StreamSinkChannel target) throws java.io.IOException- Specified by:
transferToin interfaceorg.xnio.channels.StreamSourceChannel- Throws:
java.io.IOException
-
getWorker
public org.xnio.XnioWorker getWorker()
- Specified by:
getWorkerin interfaceorg.xnio.channels.CloseableChannel
-
isReadResumed
public boolean isReadResumed()
- Specified by:
isReadResumedin interfaceorg.xnio.channels.SuspendableReadChannel
-
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
-
supportsOption
public boolean supportsOption(org.xnio.Option<?> option)
- Specified by:
supportsOptionin interfaceorg.xnio.channels.Configurable
-
shutdownReads
public void shutdownReads() throws java.io.IOException- Specified by:
shutdownReadsin interfaceorg.xnio.channels.SuspendableReadChannel- Throws:
java.io.IOException
-
getReadSetter
public org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSourceChannel> getReadSetter()
- Specified by:
getReadSetterin interfaceorg.xnio.channels.StreamSourceChannel- Specified by:
getReadSetterin interfaceorg.xnio.channels.SuspendableReadChannel
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfacejava.nio.channels.Channel
-
read
public long read(java.nio.ByteBuffer[] dsts) throws java.io.IOException- Specified by:
readin interfacejava.nio.channels.ScatteringByteChannel- Throws:
java.io.IOException
-
read
public long read(java.nio.ByteBuffer[] dsts, int offset, int length) throws java.io.IOException- Specified by:
readin interfacejava.nio.channels.ScatteringByteChannel- Throws:
java.io.IOException
-
wakeupReads
public void wakeupReads()
- Specified by:
wakeupReadsin interfaceorg.xnio.channels.SuspendableReadChannel
-
getReadThread
public org.xnio.XnioExecutor getReadThread()
- Specified by:
getReadThreadin interfaceorg.xnio.channels.SuspendableReadChannel
-
awaitReadable
public void awaitReadable(long time, java.util.concurrent.TimeUnit timeUnit) throws java.io.IOException- Specified by:
awaitReadablein interfaceorg.xnio.channels.SuspendableReadChannel- Throws:
java.io.IOException
-
getCloseSetter
public org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSourceChannel> getCloseSetter()
- Specified by:
getCloseSetterin interfaceorg.xnio.channels.CloseableChannel- Specified by:
getCloseSetterin interfaceorg.xnio.channels.StreamSourceChannel- Specified by:
getCloseSetterin interfaceorg.xnio.channels.SuspendableReadChannel
-
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- Throws:
java.io.IOException
-
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
-
read
public int read(java.nio.ByteBuffer dst) throws java.io.IOException- Specified by:
readin interfacejava.nio.channels.ReadableByteChannel- Throws:
java.io.IOException
-
getIoThread
public org.xnio.XnioIoThread getIoThread()
- Specified by:
getIoThreadin interfaceorg.xnio.channels.CloseableChannel
-
-