Interface ConnectionStrategy

All Known Implementing Classes:
NettyTcpStrategy, NettyUnixSocketStrategy

public interface ConnectionStrategy
Strategy interface for different D-Bus connection transport types.

This interface defines the strategy pattern for handling different transport mechanisms (Unix domain sockets, TCP, etc.) in an implementation-agnostic way. The strategy encapsulates transport-specific connection logic while remaining independent of any particular networking framework.

  • Method Details

    • supports

      boolean supports(SocketAddress address)
      Checks if this strategy can handle the given socket address.
      Parameters:
      address - the socket address to check
      Returns:
      true if this strategy supports the address type
    • connect

      Establishes a connection using this transport strategy.
      Parameters:
      address - the socket address to connect to
      config - connection configuration
      context - connection context providing callbacks and handlers
      Returns:
      CompletionStage that completes when connection is established
    • getTransportName

      String getTransportName()
      Gets a human-readable name for this transport strategy.
      Returns:
      transport name for logging
    • isAvailable

      boolean isAvailable()
      Checks if the required transport capabilities are available on this platform.
      Returns:
      true if this transport can be used on the current platform