Module 

Class TranslatingSuspendableChannel<C extends SuspendableChannel,​W extends SuspendableChannel>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected W channel
      Deprecated.
      The wrapped channel.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected TranslatingSuspendableChannel​(W channel)
      Deprecated.
      Construct a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void awaitReadable()
      Deprecated.
      Block until this channel becomes readable again.
      void awaitReadable​(long time, java.util.concurrent.TimeUnit timeUnit)
      Deprecated.
      Block until this channel becomes readable again, or until the timeout expires.
      void awaitWritable()
      Deprecated.
      Block until this channel becomes writable again.
      void awaitWritable​(long time, java.util.concurrent.TimeUnit timeUnit)
      Deprecated.
      Block until this channel becomes writable again, or until the timeout expires.
      protected void clearReadReady()
      Deprecated.
      Indicate that the channel is no longer definitely immediately readable.
      protected void clearReadRequiresWrite()
      Deprecated.
      Indicate that the channel no longer requires writability for reads to proceed.
      protected void clearWriteReady()
      Deprecated.
      Indicate that the channel is no longer definitely immediately writable.
      protected void clearWriteRequiresRead()
      Deprecated.
      Indicate that the channel no longer requires writability for writes to proceed.
      void close()
      Deprecated.
      Close this channel.
      protected void closeAction​(boolean readShutDown, boolean writeShutDown)
      Deprecated.
      The action to perform when the channel is closed via the close() method.
      boolean flush()
      Deprecated.
      Perform channel flush.
      protected boolean flushAction​(boolean shutDown)
      Deprecated.
      The action to perform when the channel is flushed.
      W getChannel()
      Deprecated.
      Get the channel which is wrapped by this object.
      ChannelListener<? super C> getCloseListener()
      Deprecated.
      Get the close listener.
      ChannelListener.Setter<C> getCloseSetter()
      Deprecated.
      Get the setter which can be used to change the close listener for this channel.
      XnioIoThread getIoThread()
      Deprecated.
      Get the I/O thread associated with this channel.
      <T> T getOption​(Option<T> option)
      Deprecated.
      Get the value of a channel option.
      ChannelListener<? super C> getReadListener()
      Deprecated.
      Get the read listener.
      ChannelListener.Setter<C> getReadSetter()
      Deprecated.
      Get the setter which can be used to change the read listener for this channel.
      XnioExecutor getReadThread()
      Deprecated.
      XnioWorker getWorker()
      Deprecated.
      Get the worker for this channel.
      ChannelListener<? super C> getWriteListener()
      Deprecated.
      Get the write listener.
      ChannelListener.Setter<C> getWriteSetter()
      Deprecated.
      Get the setter which can be used to change the write listener for this channel.
      XnioExecutor getWriteThread()
      Deprecated.
      protected void handleClosed()
      Deprecated.
      Called when the underlying channel is closed.
      protected void handleReadable()
      Deprecated.
      Called when the underlying channel is readable.
      protected void handleWritable()
      Deprecated.
      Called when the underlying channel is writable.
      boolean isOpen()
      Deprecated.
      Determine whether this channel is open.
      boolean isReadResumed()
      Deprecated.
      Determine whether reads are resumed.
      protected boolean isReadShutDown()
      Deprecated.
      Determine whether the channel is shut down for reads.
      protected boolean isWriteComplete()
      Deprecated.
       
      boolean isWriteResumed()
      Deprecated.
      Determine whether writes are resumed.
      protected boolean isWriteShutDown()
      Deprecated.
      Determine whether the channel is shut down for writes.
      protected boolean readRequiresWrite()
      Deprecated.
      Indicate if the channel is not readable until the write handler is called.
      protected void removeReadRequiresExternal()
      Deprecated.
      Indicate that one external read task was completed.
      protected void removeWriteRequiresExternal()
      Deprecated.
      Indicate that one external write task was completed.
      void resumeReads()
      Deprecated.
      Resume reads on this channel.
      void resumeWrites()
      Deprecated.
      Resume writes on this channel.
      protected boolean setClosed()
      Deprecated.
      Set both the channel read and write shut down flags.
      void setCloseListener​(ChannelListener<? super C> closeListener)
      Deprecated.
      Set the close listener.
      <T> T setOption​(Option<T> option, T value)
      Deprecated.
      Set an option for this channel.
      void setReadListener​(ChannelListener<? super C> readListener)
      Deprecated.
      Set the read listener.
      protected void setReadReady()
      Deprecated.
      Indicate that the channel is definitely immediately readable, regardless of the underlying channel state.
      protected void setReadRequiresWrite()
      Deprecated.
      Indicate that the channel will not be readable until the write handler is called.
      protected boolean setReadShutDown()
      Deprecated.
      Set the channel read shut down flag.
      void setWriteListener​(ChannelListener<? super C> writeListener)
      Deprecated.
      Set the write listener.
      protected void setWriteReady()
      Deprecated.
      Indicate that the channel is definitely immediately writable, regardless of the underlying channel state.
      protected void setWriteRequiresRead()
      Deprecated.
      Indicate that the channel will not be writable until the read handler is called.
      protected boolean setWriteShutDown()
      Deprecated.
      Set the channel write shut down flag.
      void shutdownReads()
      Deprecated.
      Perform the read shutdown action if it hasn't been performed already.
      protected void shutdownReadsAction​(boolean writeComplete)
      Deprecated.
      The action to perform when reads are shut down.
      void shutdownWrites()
      Deprecated.
      Perform the write shutdown action if it hasn't been performed already.
      protected void shutdownWritesAction()
      Deprecated.
      The action to perform when writes are requested to be shut down.
      protected void shutdownWritesComplete​(boolean readShutDown)
      Deprecated.
      Notification that the channel has successfully flushed after having shut down writes.
      boolean supportsOption​(Option<?> option)
      Deprecated.
      Determine whether an option is supported on this channel.
      void suspendReads()
      Deprecated.
      Suspend further read notifications on this channel.
      void suspendWrites()
      Deprecated.
      Suspend further write notifications on this channel.
      protected C thisTyped()
      Deprecated.
      Get this channel, cast to the implemented channel type.
      java.lang.String toString()
      Deprecated.
      protected boolean tryAddReadRequiresExternal()
      Deprecated.
      Indicate that read requires an external task to complete.
      protected boolean tryAddWriteRequiresExternal()
      Deprecated.
      Indicate that write requires an external task to complete.
      void wakeupReads()
      Deprecated.
      Resume reads on this channel, and force the read listener to be triggered even if the channel isn't actually readable.
      void wakeupWrites()
      Deprecated.
      Resume writes on this channel, and force the write listener to be triggered even if the channel isn't actually writable.
      protected boolean writeRequiresRead()
      Deprecated.
      Indicate if the channel is not writable until the read handler is called.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • channel

        protected final W extends SuspendableChannel channel
        Deprecated.
        The wrapped channel.
    • Constructor Detail

      • TranslatingSuspendableChannel

        protected TranslatingSuspendableChannel​(W channel)
        Deprecated.
        Construct a new instance.
        Parameters:
        channel - the channel being wrapped
    • Method Detail

      • handleReadable

        protected void handleReadable()
        Deprecated.
        Called when the underlying channel is readable.
      • handleWritable

        protected void handleWritable()
        Deprecated.
        Called when the underlying channel is writable.
      • handleClosed

        protected void handleClosed()
        Deprecated.
        Called when the underlying channel is closed.
      • setReadReady

        protected void setReadReady()
        Deprecated.
        Indicate that the channel is definitely immediately readable, regardless of the underlying channel state.
      • clearReadReady

        protected void clearReadReady()
        Deprecated.
        Indicate that the channel is no longer definitely immediately readable.
      • setReadRequiresWrite

        protected void setReadRequiresWrite()
        Deprecated.
        Indicate that the channel will not be readable until the write handler is called.
      • readRequiresWrite

        protected boolean readRequiresWrite()
        Deprecated.
        Indicate if the channel is not readable until the write handler is called.
      • clearReadRequiresWrite

        protected void clearReadRequiresWrite()
        Deprecated.
        Indicate that the channel no longer requires writability for reads to proceed.
      • tryAddReadRequiresExternal

        protected boolean tryAddReadRequiresExternal()
        Deprecated.
        Indicate that read requires an external task to complete.
        Returns:
        true if the flag was set, false if too many tasks are already outstanding
      • removeReadRequiresExternal

        protected void removeReadRequiresExternal()
        Deprecated.
        Indicate that one external read task was completed. This method should be called once for every time that tryAddReadRequiresExternal() returned true.
      • setReadShutDown

        protected boolean setReadShutDown()
        Deprecated.
        Set the channel read shut down flag.
        Returns:
        true if the channel has fully closed due to this call, false otherwise
      • setWriteReady

        protected void setWriteReady()
        Deprecated.
        Indicate that the channel is definitely immediately writable, regardless of the underlying channel state.
      • clearWriteReady

        protected void clearWriteReady()
        Deprecated.
        Indicate that the channel is no longer definitely immediately writable.
      • setWriteRequiresRead

        protected void setWriteRequiresRead()
        Deprecated.
        Indicate that the channel will not be writable until the read handler is called.
      • writeRequiresRead

        protected boolean writeRequiresRead()
        Deprecated.
        Indicate if the channel is not writable until the read handler is called.
      • clearWriteRequiresRead

        protected void clearWriteRequiresRead()
        Deprecated.
        Indicate that the channel no longer requires writability for writes to proceed.
      • tryAddWriteRequiresExternal

        protected boolean tryAddWriteRequiresExternal()
        Deprecated.
        Indicate that write requires an external task to complete.
        Returns:
        true if the flag was set, false if too many tasks are already outstanding
      • removeWriteRequiresExternal

        protected void removeWriteRequiresExternal()
        Deprecated.
        Indicate that one external write task was completed. This method should be called once for every time that tryAddWriteRequiresExternal() returned true.
      • setWriteShutDown

        protected boolean setWriteShutDown()
        Deprecated.
        Set the channel write shut down flag.
        Returns:
        true if the channel has fully closed due to this call, false otherwise
      • setClosed

        protected boolean setClosed()
        Deprecated.
        Set both the channel read and write shut down flags.
        Returns:
        true if the channel has fully closed (for the first time) due to this call, false otherwise
      • thisTyped

        protected final C thisTyped()
        Deprecated.
        Get this channel, cast to the implemented channel type.
        Returns:
        this
      • suspendReads

        public void suspendReads()
        Deprecated.
        Suspend further read notifications on this channel.
        Specified by:
        suspendReads in interface SuspendableReadChannel
      • resumeReads

        public void resumeReads()
        Deprecated.
        Resume reads on this channel. The read listener will be called as soon as there is data available to be read.
        Specified by:
        resumeReads in interface SuspendableReadChannel
      • isReadResumed

        public boolean isReadResumed()
        Deprecated.
        Description copied from interface: SuspendableReadChannel
        Determine whether reads are resumed.
        Specified by:
        isReadResumed in interface SuspendableReadChannel
        Returns:
        true if reads are resumed, false if reads are suspended
      • wakeupReads

        public void wakeupReads()
        Deprecated.
        Resume reads on this channel, and force the read listener to be triggered even if the channel isn't actually readable.
        Specified by:
        wakeupReads in interface SuspendableReadChannel
      • resumeWrites

        public void resumeWrites()
        Deprecated.
        Resume writes on this channel. The write listener will be called as soon as the channel becomes writable.
        Specified by:
        resumeWrites in interface SuspendableWriteChannel
      • wakeupWrites

        public void wakeupWrites()
        Deprecated.
        Resume writes on this channel, and force the write listener to be triggered even if the channel isn't actually writable.
        Specified by:
        wakeupWrites in interface SuspendableWriteChannel
      • supportsOption

        public boolean supportsOption​(Option<?> option)
        Deprecated.
        Determine whether an option is supported on this channel.
        Specified by:
        supportsOption in interface Configurable
        Parameters:
        option - the option
        Returns:
        true if it is supported
      • getOption

        public <T> T getOption​(Option<T> option)
                        throws java.io.IOException
        Deprecated.
        Get the value of a channel option.
        Specified by:
        getOption in interface Configurable
        Type Parameters:
        T - the type of the option value
        Parameters:
        option - the option to get
        Returns:
        the value of the option, or null if it is not set
        Throws:
        java.io.IOException - if an I/O error occurred when reading the option
      • setOption

        public <T> T setOption​(Option<T> option,
                               T value)
                        throws java.lang.IllegalArgumentException,
                               java.io.IOException
        Deprecated.
        Set an option for this channel. Unsupported options are ignored.
        Specified by:
        setOption in interface Configurable
        Type Parameters:
        T - the type of the option value
        Parameters:
        option - the option to set
        value - the value of the option to set
        Returns:
        the previous option value, if any
        Throws:
        java.lang.IllegalArgumentException - if the value is not acceptable for this option
        java.io.IOException - if an I/O error occurred when modifying the option
      • flush

        public final boolean flush()
                            throws java.io.IOException
        Deprecated.
        Perform channel flush. To change the action taken to flush, subclasses should override flushAction(boolean).
        Specified by:
        flush in interface SuspendableWriteChannel
        Returns:
        true if the flush completed, or false if the operation would block
        Throws:
        java.io.IOException - if an error occurs
      • flushAction

        protected boolean flushAction​(boolean shutDown)
                               throws java.io.IOException
        Deprecated.
        The action to perform when the channel is flushed. By default, this method delegates to the underlying channel. If the shutDown parameter is set, and this method returns true, the underlying channel will be shut down and this method will never be called again (future calls to flush() will flush the underlying channel until it returns true).
        Parameters:
        shutDown - true if the channel's write side has been shut down, false otherwise
        Returns:
        true if the flush succeeded, false if it would block
        Throws:
        java.io.IOException - if an error occurs
      • shutdownWritesComplete

        protected void shutdownWritesComplete​(boolean readShutDown)
                                       throws java.io.IOException
        Deprecated.
        Notification that the channel has successfully flushed after having shut down writes. The underlying channel may not yet be fully flushed at this time.
        Parameters:
        readShutDown - true if the read side was already shut down, false otherwise
        Throws:
        java.io.IOException - if an error occurs
      • shutdownReads

        public void shutdownReads()
                           throws java.io.IOException
        Deprecated.
        Perform the read shutdown action if it hasn't been performed already.
        Specified by:
        shutdownReads in interface SuspendableReadChannel
        Throws:
        java.io.IOException - if an I/O error occurs
      • shutdownReadsAction

        protected void shutdownReadsAction​(boolean writeComplete)
                                    throws java.io.IOException
        Deprecated.
        The action to perform when reads are shut down. By default, this method delegates to the underlying channel.
        Parameters:
        writeComplete -
        Throws:
        java.io.IOException - if an error occurs
      • isReadShutDown

        protected boolean isReadShutDown()
        Deprecated.
        Determine whether the channel is shut down for reads.
        Returns:
        whether the channel is shut down for reads
      • shutdownWrites

        public void shutdownWrites()
                            throws java.io.IOException
        Deprecated.
        Perform the write shutdown action if it hasn't been performed already.
        Specified by:
        shutdownWrites in interface SuspendableWriteChannel
        Throws:
        java.io.IOException - if an I/O error occurs
      • shutdownWritesAction

        protected void shutdownWritesAction()
                                     throws java.io.IOException
        Deprecated.
        The action to perform when writes are requested to be shut down. By default, this method delegates to the underlying channel.
        Throws:
        java.io.IOException - if an error occurs
      • isWriteShutDown

        protected boolean isWriteShutDown()
        Deprecated.
        Determine whether the channel is shut down for writes.
        Returns:
        whether the channel is shut down for writes
      • isWriteComplete

        protected boolean isWriteComplete()
        Deprecated.
      • awaitReadable

        public void awaitReadable()
                           throws java.io.IOException
        Deprecated.
        Block until this channel becomes readable again. This method may return spuriously before the channel becomes readable.
        Specified by:
        awaitReadable in interface SuspendableReadChannel
        Throws:
        java.io.InterruptedIOException - if the operation is interrupted; the thread's interrupt flag will be set as well
        java.io.IOException - if an I/O error occurs
      • awaitReadable

        public void awaitReadable​(long time,
                                  java.util.concurrent.TimeUnit timeUnit)
                           throws java.io.IOException
        Deprecated.
        Block until this channel becomes readable again, or until the timeout expires. This method may return spuriously before the channel becomes readable or the timeout expires.
        Specified by:
        awaitReadable in interface SuspendableReadChannel
        Parameters:
        time - the time to wait
        timeUnit - the time unit
        Throws:
        java.io.InterruptedIOException - if the operation is interrupted; the thread's interrupt flag will be set as well
        java.io.IOException - if an I/O error occurs
      • awaitWritable

        public void awaitWritable()
                           throws java.io.IOException
        Deprecated.
        Block until this channel becomes writable again. This method may return spuriously before the channel becomes writable.
        Specified by:
        awaitWritable in interface SuspendableWriteChannel
        Throws:
        java.io.InterruptedIOException - if the operation is interrupted; the thread's interrupt flag will be set as well
        java.io.IOException - if an I/O error occurs
      • awaitWritable

        public void awaitWritable​(long time,
                                  java.util.concurrent.TimeUnit timeUnit)
                           throws java.io.IOException
        Deprecated.
        Block until this channel becomes writable again, or until the timeout expires. This method may return spuriously before the channel becomes writable or the timeout expires.
        Specified by:
        awaitWritable in interface SuspendableWriteChannel
        Parameters:
        time - the time to wait
        timeUnit - the time unit
        Throws:
        java.io.InterruptedIOException - if the operation is interrupted; the thread's interrupt flag will be set as well
        java.io.IOException - if an I/O error occurs
      • close

        public void close()
                   throws java.io.IOException
        Deprecated.
        Close this channel. This method is idempotent.
        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 CloseableChannel
        Specified by:
        close in interface java.nio.channels.InterruptibleChannel
        Specified by:
        close in interface SuspendableWriteChannel
        Throws:
        java.io.IOException - if an I/O error occurs
      • closeAction

        protected void closeAction​(boolean readShutDown,
                                   boolean writeShutDown)
                            throws java.io.IOException
        Deprecated.
        The action to perform when the channel is closed via the close() method. By default, the underlying channel is closed.
        Parameters:
        readShutDown - if reads were previously shut down
        writeShutDown - if writes were previously shut down
        Throws:
        java.io.IOException - if an error occurs
      • isOpen

        public boolean isOpen()
        Deprecated.
        Determine whether this channel is open. This method will return false if all directions are shut down, even if there is unflushed write data pending.
        Specified by:
        isOpen in interface java.nio.channels.Channel
        Specified by:
        isOpen in interface SuspendableWriteChannel
        Returns:
        true if the channel is open, false otherwise
      • getIoThread

        public XnioIoThread getIoThread()
        Deprecated.
        Get the I/O thread associated with this channel.
        Specified by:
        getIoThread in interface CloseableChannel
        Returns:
        the I/O thread associated with this channel
      • toString

        public java.lang.String toString()
        Deprecated.
        Overrides:
        toString in class java.lang.Object