Package com.lucimber.dbus.connection
Class ConnectionStrategyRegistry
java.lang.Object
com.lucimber.dbus.connection.ConnectionStrategyRegistry
Registry for connection strategies that automatically selects the appropriate strategy based on
the socket address type and platform availability.
This registry allows pluggable transport implementations while maintaining a clean abstraction for connection creation.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new registry with the default set of strategies.ConnectionStrategyRegistry
(List<ConnectionStrategy> strategies) Creates a new registry with the specified strategies. -
Method Summary
Modifier and TypeMethodDescriptionfindStrategy
(SocketAddress address) Finds the first available strategy that supports the given socket address.Gets all registered strategies.Gets all available strategies (those that can be used on this platform).void
registerStrategy
(ConnectionStrategy strategy) Registers a new connection strategy.
-
Constructor Details
-
ConnectionStrategyRegistry
public ConnectionStrategyRegistry()Creates a new registry with the default set of strategies. -
ConnectionStrategyRegistry
Creates a new registry with the specified strategies.- Parameters:
strategies
- the initial list of strategies
-
-
Method Details
-
registerStrategy
Registers a new connection strategy.- Parameters:
strategy
- the strategy to register
-
findStrategy
Finds the first available strategy that supports the given socket address.- Parameters:
address
- the socket address to find a strategy for- Returns:
- the strategy if found, empty otherwise
-
getAllStrategies
Gets all registered strategies.- Returns:
- unmodifiable list of all strategies
-
getAvailableStrategies
Gets all available strategies (those that can be used on this platform).- Returns:
- list of available strategies
-