Class ConnectionHandler


  • public class ConnectionHandler
    extends java.lang.Object
    • Field Detail

      • state

        protected final org.apache.pulsar.client.impl.HandlerState state
      • backoff

        protected final Backoff backoff
      • lastConnectionClosedTimestamp

        protected volatile long lastConnectionClosedTimestamp
      • connection

        protected org.apache.pulsar.client.impl.ConnectionHandler.Connection connection
    • Constructor Detail

      • ConnectionHandler

        protected ConnectionHandler​(org.apache.pulsar.client.impl.HandlerState state,
                                    Backoff backoff,
                                    org.apache.pulsar.client.impl.ConnectionHandler.Connection connection)
    • Method Detail

      • grabCnx

        protected void grabCnx()
      • reconnectLater

        protected void reconnectLater​(java.lang.Throwable exception)
      • connectionClosed

        public void connectionClosed​(ClientCnx cnx)
      • resetBackoff

        protected void resetBackoff()
      • setClientCnx

        protected void setClientCnx​(ClientCnx clientCnx)
      • switchClientCnx

        protected long switchClientCnx​(ClientCnx clientCnx)
        Update the ClientCnx for the class, then increment and get the epoch value. Note that the epoch value is currently only used by the ProducerImpl.
        Parameters:
        clientCnx - - the new ClientCnx
        Returns:
        the epoch value to use for this pair of ClientCnx and ProducerImpl
      • getEpoch

        public long getEpoch()