Class AbstractConnectionClient

All Implemented Interfaces:
Resetable, Channel, ChannelHandler, Client, Endpoint, IdleSensible

public abstract class AbstractConnectionClient extends AbstractClient
  • Method Details

    • increase

      public final void increase()
    • retain

      public final boolean retain()
      Increments the reference count by 1.
    • release

      public boolean release()
      Decreases the reference count by 1 and calls
      invalid @link
      {@link this#destroy
      } if the reference count reaches 0.
    • isAvailable

      public abstract boolean isAvailable()
      connection is available.
      Returns:
      boolean
    • addConnectedListener

      public abstract void addConnectedListener(Runnable func)
      add a listener that will be executed when a connection is established.
      Parameters:
      func - execute function
    • addDisconnectedListener

      public abstract void addDisconnectedListener(Runnable func)
      Add a listener that will be executed when the connection is disconnected.
      Parameters:
      func - execute function
    • addCloseListener

      public abstract void addCloseListener(Runnable func)
      add a listener that will be executed when the connection is closed.
      Parameters:
      func - execute function
    • onConnected

      public abstract void onConnected(Object channel)
      when connected, callback.
      Parameters:
      channel - Channel
    • onGoaway

      public abstract void onGoaway(Object channel)
      when goaway, callback.
      Parameters:
      channel - Channel
    • destroy

      public abstract void destroy()
      This method will be invoked when counter reaches 0, override this method to destroy materials related to the specific resource.
    • getChannel

      public abstract <T> T getChannel(Boolean generalizable)
      if generalizable, return NIOChannel else return Dubbo Channel
      Parameters:
      generalizable - generalizable
      Returns:
      Dubbo Channel or NIOChannel such as NettyChannel
    • getCounter

      public long getCounter()
      Get counter