Class 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.StreamSinkChannel
    Stream sink channel. When this channel is considered detached it will no longer forward calls to the delegate
    Author:
    Stuart Douglas
    • Constructor Detail

      • DetachableStreamSinkChannel

        public DetachableStreamSinkChannel​(org.xnio.channels.StreamSinkChannel delegate)
    • Method Detail

      • isFinished

        protected abstract boolean isFinished()
      • suspendWrites

        public void suspendWrites()
        Specified by:
        suspendWrites in interface org.xnio.channels.SuspendableWriteChannel
      • isWriteResumed

        public boolean isWriteResumed()
        Specified by:
        isWriteResumed in interface org.xnio.channels.SuspendableWriteChannel
      • shutdownWrites

        public void shutdownWrites()
                            throws java.io.IOException
        Specified by:
        shutdownWrites in interface org.xnio.channels.SuspendableWriteChannel
        Throws:
        java.io.IOException
      • awaitWritable

        public void awaitWritable()
                           throws java.io.IOException
        Specified by:
        awaitWritable in interface org.xnio.channels.SuspendableWriteChannel
        Throws:
        java.io.IOException
      • awaitWritable

        public void awaitWritable​(long time,
                                  java.util.concurrent.TimeUnit timeUnit)
                           throws java.io.IOException
        Specified by:
        awaitWritable in interface org.xnio.channels.SuspendableWriteChannel
        Throws:
        java.io.IOException
      • getWriteThread

        public org.xnio.XnioExecutor getWriteThread()
        Specified by:
        getWriteThread in interface org.xnio.channels.SuspendableWriteChannel
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface java.nio.channels.Channel
        Specified by:
        isOpen in interface org.xnio.channels.SuspendableWriteChannel
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.nio.channels.Channel
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface org.xnio.channels.CloseableChannel
        Specified by:
        close in interface java.nio.channels.InterruptibleChannel
        Specified by:
        close in interface org.xnio.channels.SuspendableWriteChannel
        Throws:
        java.io.IOException
      • flush

        public boolean flush()
                      throws java.io.IOException
        Specified by:
        flush in interface org.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:
        transferFrom in interface org.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:
        transferFrom in interface org.xnio.channels.StreamSinkChannel
        Throws:
        java.io.IOException
      • getWriteSetter

        public org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel> getWriteSetter()
        Specified by:
        getWriteSetter in interface org.xnio.channels.StreamSinkChannel
        Specified by:
        getWriteSetter in interface org.xnio.channels.SuspendableWriteChannel
      • getCloseSetter

        public org.xnio.ChannelListener.Setter<? extends org.xnio.channels.StreamSinkChannel> getCloseSetter()
        Specified by:
        getCloseSetter in interface org.xnio.channels.CloseableChannel
        Specified by:
        getCloseSetter in interface org.xnio.channels.StreamSinkChannel
        Specified by:
        getCloseSetter in interface org.xnio.channels.SuspendableWriteChannel
      • getWorker

        public org.xnio.XnioWorker getWorker()
        Specified by:
        getWorker in interface org.xnio.channels.CloseableChannel
      • getIoThread

        public org.xnio.XnioIoThread getIoThread()
        Specified by:
        getIoThread in interface org.xnio.channels.CloseableChannel
      • write

        public long write​(java.nio.ByteBuffer[] srcs,
                          int offset,
                          int length)
                   throws java.io.IOException
        Specified by:
        write in interface java.nio.channels.GatheringByteChannel
        Throws:
        java.io.IOException
      • write

        public long write​(java.nio.ByteBuffer[] srcs)
                   throws java.io.IOException
        Specified by:
        write in interface java.nio.channels.GatheringByteChannel
        Throws:
        java.io.IOException
      • writeFinal

        public int writeFinal​(java.nio.ByteBuffer src)
                       throws java.io.IOException
        Specified by:
        writeFinal in interface org.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:
        writeFinal in interface org.xnio.channels.StreamSinkChannel
        Throws:
        java.io.IOException
      • writeFinal

        public long writeFinal​(java.nio.ByteBuffer[] srcs)
                        throws java.io.IOException
        Specified by:
        writeFinal in interface org.xnio.channels.StreamSinkChannel
        Throws:
        java.io.IOException
      • supportsOption

        public boolean supportsOption​(org.xnio.Option<?> option)
        Specified by:
        supportsOption in interface org.xnio.channels.Configurable
      • getOption

        public <T> T getOption​(org.xnio.Option<T> option)
                        throws java.io.IOException
        Specified by:
        getOption in interface org.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:
        setOption in interface org.xnio.channels.Configurable
        Throws:
        java.lang.IllegalArgumentException
        java.io.IOException
      • write

        public int write​(java.nio.ByteBuffer src)
                  throws java.io.IOException
        Specified by:
        write in interface java.nio.channels.WritableByteChannel
        Throws:
        java.io.IOException
      • resumeWrites

        public void resumeWrites()
        Specified by:
        resumeWrites in interface org.xnio.channels.SuspendableWriteChannel
      • wakeupWrites

        public void wakeupWrites()
        Specified by:
        wakeupWrites in interface org.xnio.channels.SuspendableWriteChannel
      • responseDone

        public void responseDone()