ResolvedAddress - The type of a resolved address that can be used for connecting.C - The type of connections created by the ConnectionFactory decorated by this filter.public final class TransportObserverConnectionFactoryFilter<ResolvedAddress,C extends ListenableAsyncCloseable> extends Object implements ConnectionFactoryFilter<ResolvedAddress,C>
ConnectionFactoryFilter that configures a TransportObserver for new connections.| Constructor and Description |
|---|
TransportObserverConnectionFactoryFilter(Function<ResolvedAddress,TransportObserver> observerFactory)
Creates a new instance.
|
TransportObserverConnectionFactoryFilter(TransportObserver observer)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
ConnectionFactory<ResolvedAddress,C> |
create(ConnectionFactory<ResolvedAddress,C> original)
Decorates the passed
original ConnectionFactory to add the filtering logic. |
ExecutionStrategy |
requiredOffloads() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappend, identity, withStrategypublic TransportObserverConnectionFactoryFilter(TransportObserver observer)
observer - TransportObserver to use for new connectionspublic TransportObserverConnectionFactoryFilter(Function<ResolvedAddress,TransportObserver> observerFactory)
observerFactory - a factory to create a TransportObserver for new connections per
ResolvedAddress. May return null to avoid configuring TransportObserver for some
addresses.public ConnectionFactory<ResolvedAddress,C> create(ConnectionFactory<ResolvedAddress,C> original)
ConnectionFactoryFilteroriginal ConnectionFactory to add the filtering logic.create in interface ConnectionFactoryFilter<ResolvedAddress,C extends ListenableAsyncCloseable>original - ConnectionFactory to filter.ConnectionFactory that contains the filtering logic.public ExecutionStrategy requiredOffloads()
ConnectionFactoryFilterIf the returned strategy extends ConnectExecutionStrategy then the connection creation or accept may
be offloaded.
If the returned strategy extends HttpExecutionStrategy then the HTTP execution strategy will be
applied to the connections created.
A utility class provides the ability to combine connect and HTTP execution strategies,
io.servicetalk.http.api.ConnectAndHttpExecutionStrategy.
requiredOffloads in interface ConnectionFactoryFilter<ResolvedAddress,C extends ListenableAsyncCloseable>requiredOffloads in interface ExecutionStrategyInfluencer<ExecutionStrategy>