Interface Connection

    • Method Detail

      • addEventListener

        void addEventListener​(java.util.EventListener listener)

        Adds a listener of connection events.

        Parameters:
        listener - the listener to add
      • removeEventListener

        void removeEventListener​(java.util.EventListener listener)

        Removes a listener of connection events.

        Parameters:
        listener - the listener to remove
      • onOpen

        void onOpen()

        Callback method invoked when this connection is opened.

        Creators of the connection implementation are responsible for calling this method.

      • onClose

        void onClose​(java.lang.Throwable cause)

        Callback method invoked when this connection is closed.

        Creators of the connection implementation are responsible for calling this method.

        Parameters:
        cause - The cause of the close or null for a normal close
      • getEndPoint

        EndPoint getEndPoint()
        Returns:
        the EndPoint associated with this Connection.
      • close

        void close()

        Performs a logical close of this connection.

        For simple connections, this may just mean to delegate the close to the associated EndPoint but, for example, SSL connections should write the SSL close message before closing the associated EndPoint.

        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • onIdleExpired

        boolean onIdleExpired()

        Callback method invoked upon an idle timeout event.

        Implementations of this method may return true to indicate that the idle timeout handling should proceed normally, typically failing the EndPoint and causing it to be closed.

        When false is returned, the handling of the idle timeout event is halted immediately and the EndPoint left in the state it was before the idle timeout event.

        Returns:
        true to let the EndPoint handle the idle timeout, false to tell the EndPoint to halt the handling of the idle timeout.
      • getMessagesIn

        long getMessagesIn()
      • getMessagesOut

        long getMessagesOut()
      • getBytesIn

        long getBytesIn()
      • getBytesOut

        long getBytesOut()
      • getCreatedTimeStamp

        long getCreatedTimeStamp()