Interface AsyncHandlerExtensions


public interface AsyncHandlerExtensions
This interface hosts new low level callback methods on AsyncHandler. For now, those methods are in a dedicated interface in order not to break the existing API, but could be merged into one of the existing ones in AHC 2. More additional hooks might come, such as:
  • onConnectionClosed()
  • onBytesSent(long numberOfBytes)
  • onBytesReceived(long numberOfBytes)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Notify the callback when a new connection was successfully opened.
    void
    Notify the callback when a new connection was successfully fetched from the pool.
    void
    Notify the callback after DNS resolution has completed.
    void
    Notify the callback when trying to open a new connection.
    void
    Notify the callback when trying to fetch a connection from the pool.
    void
    Notify the callback every time a request is being retried.
    void
    Notify the callback when a request is about to be written on the wire.
    void
    Notify the callback when the SSL handshake performed to establish an HTTPS connection has been completed.
  • Method Details

    • onOpenConnection

      void onOpenConnection()
      Notify the callback when trying to open a new connection.
    • onConnectionOpen

      void onConnectionOpen()
      Notify the callback when a new connection was successfully opened.
    • onPoolConnection

      void onPoolConnection()
      Notify the callback when trying to fetch a connection from the pool.
    • onConnectionPooled

      void onConnectionPooled()
      Notify the callback when a new connection was successfully fetched from the pool.
    • onSendRequest

      void onSendRequest(Object request)
      Notify the callback when a request is about to be written on the wire. If the original request causes multiple requests to be sent, for example, because of authorization or retry, it will be notified multiple times.
      Parameters:
      request - the real request object (underlying provider model)
    • onRetry

      void onRetry()
      Notify the callback every time a request is being retried.
    • onDnsResolved

      void onDnsResolved(InetAddress address)
      Notify the callback after DNS resolution has completed.
      Parameters:
      address - the resolved address
    • onSslHandshakeCompleted

      void onSslHandshakeCompleted()
      Notify the callback when the SSL handshake performed to establish an HTTPS connection has been completed.