Package io.undertow.channels
Class DetachableStreamSinkChannel
java.lang.Object
io.undertow.channels.DetachableStreamSinkChannel
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,GatheringByteChannel
,InterruptibleChannel
,WritableByteChannel
,org.xnio.channels.CloseableChannel
,org.xnio.channels.Configurable
,org.xnio.channels.StreamSinkChannel
,org.xnio.channels.SuspendableWriteChannel
public abstract class DetachableStreamSinkChannel
extends Object
implements org.xnio.channels.StreamSinkChannel
Stream sink channel. When this channel is considered detached it will no longer forward
calls to the delegate
- Author:
- Stuart Douglas
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSinkChannel>
protected final org.xnio.channels.StreamSinkChannel
protected org.xnio.ChannelListener.SimpleSetter<DetachableStreamSinkChannel>
Fields inherited from interface org.xnio.channels.Configurable
EMPTY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
awaitWritable
(long time, TimeUnit timeUnit) void
close()
boolean
flush()
org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel>
org.xnio.XnioIoThread
<T> T
getOption
(org.xnio.Option<T> option) org.xnio.XnioWorker
org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel>
org.xnio.XnioExecutor
protected abstract boolean
boolean
isOpen()
boolean
void
void
<T> T
setOption
(org.xnio.Option<T> option, T value) void
boolean
supportsOption
(org.xnio.Option<?> option) void
long
transferFrom
(FileChannel src, long position, long count) long
transferFrom
(org.xnio.channels.StreamSourceChannel source, long count, ByteBuffer throughBuffer) void
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)
-
Field Details
-
delegate
protected final org.xnio.channels.StreamSinkChannel delegate -
writeSetter
-
closeSetter
-
-
Constructor Details
-
DetachableStreamSinkChannel
public DetachableStreamSinkChannel(org.xnio.channels.StreamSinkChannel delegate)
-
-
Method Details
-
isFinished
protected abstract boolean isFinished() -
suspendWrites
public void suspendWrites()- Specified by:
suspendWrites
in interfaceorg.xnio.channels.SuspendableWriteChannel
-
isWriteResumed
public boolean isWriteResumed()- Specified by:
isWriteResumed
in interfaceorg.xnio.channels.SuspendableWriteChannel
-
shutdownWrites
- Specified by:
shutdownWrites
in interfaceorg.xnio.channels.SuspendableWriteChannel
- Throws:
IOException
-
awaitWritable
- Specified by:
awaitWritable
in interfaceorg.xnio.channels.SuspendableWriteChannel
- Throws:
IOException
-
awaitWritable
- Specified by:
awaitWritable
in interfaceorg.xnio.channels.SuspendableWriteChannel
- Throws:
IOException
-
getWriteThread
public org.xnio.XnioExecutor getWriteThread()- Specified by:
getWriteThread
in interfaceorg.xnio.channels.SuspendableWriteChannel
-
isOpen
public boolean isOpen() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.xnio.channels.CloseableChannel
- Specified by:
close
in interfaceInterruptibleChannel
- Specified by:
close
in interfaceorg.xnio.channels.SuspendableWriteChannel
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceorg.xnio.channels.SuspendableWriteChannel
- Throws:
IOException
-
transferFrom
- Specified by:
transferFrom
in interfaceorg.xnio.channels.StreamSinkChannel
- Throws:
IOException
-
transferFrom
public long transferFrom(org.xnio.channels.StreamSourceChannel source, long count, ByteBuffer throughBuffer) throws IOException - Specified by:
transferFrom
in interfaceorg.xnio.channels.StreamSinkChannel
- Throws:
IOException
-
getWriteSetter
public org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel> getWriteSetter()- Specified by:
getWriteSetter
in interfaceorg.xnio.channels.StreamSinkChannel
- Specified by:
getWriteSetter
in interfaceorg.xnio.channels.SuspendableWriteChannel
-
getCloseSetter
public org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel> getCloseSetter()- Specified by:
getCloseSetter
in interfaceorg.xnio.channels.CloseableChannel
- Specified by:
getCloseSetter
in interfaceorg.xnio.channels.StreamSinkChannel
- Specified by:
getCloseSetter
in interfaceorg.xnio.channels.SuspendableWriteChannel
-
getWorker
public org.xnio.XnioWorker getWorker()- Specified by:
getWorker
in interfaceorg.xnio.channels.CloseableChannel
-
getIoThread
public org.xnio.XnioIoThread getIoThread()- Specified by:
getIoThread
in interfaceorg.xnio.channels.CloseableChannel
-
write
- Specified by:
write
in interfaceGatheringByteChannel
- Throws:
IOException
-
write
- Specified by:
write
in interfaceGatheringByteChannel
- Throws:
IOException
-
writeFinal
- Specified by:
writeFinal
in interfaceorg.xnio.channels.StreamSinkChannel
- Throws:
IOException
-
writeFinal
- Specified by:
writeFinal
in interfaceorg.xnio.channels.StreamSinkChannel
- Throws:
IOException
-
writeFinal
- Specified by:
writeFinal
in interfaceorg.xnio.channels.StreamSinkChannel
- Throws:
IOException
-
supportsOption
public boolean supportsOption(org.xnio.Option<?> option) - Specified by:
supportsOption
in interfaceorg.xnio.channels.Configurable
-
getOption
- Specified by:
getOption
in interfaceorg.xnio.channels.Configurable
- Throws:
IOException
-
setOption
public <T> T setOption(org.xnio.Option<T> option, T value) throws IllegalArgumentException, IOException - Specified by:
setOption
in interfaceorg.xnio.channels.Configurable
- Throws:
IllegalArgumentException
IOException
-
write
- Specified by:
write
in interfaceWritableByteChannel
- Throws:
IOException
-
resumeWrites
public void resumeWrites()- Specified by:
resumeWrites
in interfaceorg.xnio.channels.SuspendableWriteChannel
-
wakeupWrites
public void wakeupWrites()- Specified by:
wakeupWrites
in interfaceorg.xnio.channels.SuspendableWriteChannel
-
responseDone
public void responseDone()
-