Class ListenerEndpointImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.net.SocketAddress address  
      (package private) java.lang.Object attachment  
      private java.util.concurrent.atomic.AtomicBoolean closed  
      private java.nio.channels.SelectionKey key  
    • Constructor Summary

      Constructors 
      Constructor Description
      ListenerEndpointImpl​(java.nio.channels.SelectionKey key, java.lang.Object attachment, java.net.SocketAddress address)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void close​(CloseMode closeMode)
      Closes this process or endpoint and releases any system resources associated with it.
      java.net.SocketAddress getAddress()
      Returns the socket address of this endpoint.
      boolean isClosed()
      Determines if this endpoint has been closed and is no longer listens for incoming connections.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • key

        private final java.nio.channels.SelectionKey key
      • address

        final java.net.SocketAddress address
      • attachment

        final java.lang.Object attachment
      • closed

        private final java.util.concurrent.atomic.AtomicBoolean closed
    • Constructor Detail

      • ListenerEndpointImpl

        public ListenerEndpointImpl​(java.nio.channels.SelectionKey key,
                                    java.lang.Object attachment,
                                    java.net.SocketAddress address)
    • Method Detail

      • getAddress

        public java.net.SocketAddress getAddress()
        Description copied from interface: ListenerEndpoint
        Returns the socket address of this endpoint.
        Specified by:
        getAddress in interface ListenerEndpoint
        Returns:
        socket address.
      • toString

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

        public boolean isClosed()
        Description copied from interface: ListenerEndpoint
        Determines if this endpoint has been closed and is no longer listens for incoming connections.
        Specified by:
        isClosed in interface ListenerEndpoint
        Returns:
        true if the endpoint has been closed, false otherwise.
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • close

        public void close​(CloseMode closeMode)
        Description copied from interface: ModalCloseable
        Closes this process or endpoint and releases any system resources associated with it. If the endpoint or the process is already closed then invoking this method has no effect.
        Specified by:
        close in interface ModalCloseable
        Parameters:
        closeMode - How to close the receiver.