Module 

Interface SuspendableAcceptChannel

  • All Superinterfaces:
    java.lang.AutoCloseable, java.nio.channels.Channel, java.io.Closeable, CloseableChannel, Configurable, java.nio.channels.InterruptibleChannel
    All Known Subinterfaces:
    AcceptingChannel<C>, SimpleAcceptingChannel<C>

    public interface SuspendableAcceptChannel
    extends CloseableChannel
    A suspendable accept channel. This type of channel is associated with a listener which can suspend and resume accepting connections as needed.
    Since:
    3.0
    • Method Detail

      • suspendAccepts

        void suspendAccepts()
        Suspend further read notifications on this channel.
      • resumeAccepts

        void resumeAccepts()
        Resume reads on this channel. The accept listener will be called as soon as there is a connection available to be accepted.
      • isAcceptResumed

        boolean isAcceptResumed()
        Determine whether accepts are resumed.
        Returns:
        true if accepts are resumed, false if accepts are suspended
      • wakeupAccepts

        @Deprecated
        void wakeupAccepts()
        Deprecated.
        Users should instead submit Runnable tasks to the channel thread when this functionality is needed.
        resumeAccepts() Resume accepts} on this channel, and force the accept listener to be triggered even if the channel isn't actually ready.
      • awaitAcceptable

        void awaitAcceptable()
                      throws java.io.IOException
        Block until this channel becomes acceptable again. This method may return spuriously before the channel becomes acceptable.
        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
      • awaitAcceptable

        void awaitAcceptable​(long time,
                             java.util.concurrent.TimeUnit timeUnit)
                      throws java.io.IOException
        Block until this channel becomes acceptable again, or until the timeout expires. This method may return spuriously before the channel becomes acceptable or the timeout expires.
        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
      • getAcceptThread

        @Deprecated
        XnioExecutor getAcceptThread()
        Deprecated.
        The getIoThread() method should be used instead.
        Get an accept thread for this channel. If more than one is configured, any of them may be returned.
        Returns:
        the thread
      • getIoThread

        XnioIoThread getIoThread()
        Get an accept thread for this channel. If more than one is configured, any of them may be returned.
        Specified by:
        getIoThread in interface CloseableChannel
        Returns:
        the thread