Package com.lucimber.dbus.netty
Class NettyTcpStrategy
java.lang.Object
com.lucimber.dbus.netty.NettyTcpStrategy
- All Implemented Interfaces:
ConnectionStrategy
Netty-based connection strategy for TCP transport.
This strategy handles connections over TCP/IP sockets using NIO transport with optimizations for D-Bus communication.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnect
(SocketAddress address, ConnectionConfig config, ConnectionContext context) Establishes a connection using this transport strategy.Gets a human-readable name for this transport strategy.boolean
Checks if the required transport capabilities are available on this platform.boolean
supports
(SocketAddress address) Checks if this strategy can handle the given socket address.
-
Constructor Details
-
NettyTcpStrategy
public NettyTcpStrategy()
-
-
Method Details
-
supports
Description copied from interface:ConnectionStrategy
Checks if this strategy can handle the given socket address.- Specified by:
supports
in interfaceConnectionStrategy
- Parameters:
address
- the socket address to check- Returns:
- true if this strategy supports the address type
-
connect
public CompletionStage<ConnectionHandle> connect(SocketAddress address, ConnectionConfig config, ConnectionContext context) Description copied from interface:ConnectionStrategy
Establishes a connection using this transport strategy.- Specified by:
connect
in interfaceConnectionStrategy
- Parameters:
address
- the socket address to connect toconfig
- connection configurationcontext
- connection context providing callbacks and handlers- Returns:
- CompletionStage that completes when connection is established
-
getTransportName
Description copied from interface:ConnectionStrategy
Gets a human-readable name for this transport strategy.- Specified by:
getTransportName
in interfaceConnectionStrategy
- Returns:
- transport name for logging
-
isAvailable
public boolean isAvailable()Description copied from interface:ConnectionStrategy
Checks if the required transport capabilities are available on this platform.- Specified by:
isAvailable
in interfaceConnectionStrategy
- Returns:
- true if this transport can be used on the current platform
-