Package io.servicetalk.client.api
Class TransportObserverConnectionFactoryFilter<ResolvedAddress,C extends ListenableAsyncCloseable>
java.lang.Object
io.servicetalk.client.api.TransportObserverConnectionFactoryFilter<ResolvedAddress,C>
- Type Parameters:
ResolvedAddress- The type of a resolved address that can be used for connecting.C- The type of connections created by theConnectionFactorydecorated by this filter.
- All Implemented Interfaces:
ConnectionFactoryFilter<ResolvedAddress,,C> ExecutionStrategyInfluencer<ExecutionStrategy>
public final class TransportObserverConnectionFactoryFilter<ResolvedAddress,C extends ListenableAsyncCloseable>
extends Object
implements ConnectionFactoryFilter<ResolvedAddress,C>
A
ConnectionFactoryFilter that configures a TransportObserver for new connections.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance.TransportObserverConnectionFactoryFilter(Function<ResolvedAddress, TransportObserver> observerFactory) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptioncreate(ConnectionFactory<ResolvedAddress, C> original) Decorates the passedoriginalConnectionFactoryto add the filtering logic.Return anExecutionStrategythat describes the offloads required by the influencer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.servicetalk.client.api.ConnectionFactoryFilter
append
-
Constructor Details
-
TransportObserverConnectionFactoryFilter
Creates a new instance.- Parameters:
observer-TransportObserverto use for new connections
-
TransportObserverConnectionFactoryFilter
public TransportObserverConnectionFactoryFilter(Function<ResolvedAddress, TransportObserver> observerFactory) Creates a new instance.- Parameters:
observerFactory- a factory to create aTransportObserverfor new connections perTransportObserverConnectionFactoryFilter. May returnnullto avoid configuringTransportObserverfor some addresses.
-
-
Method Details
-
create
Description copied from interface:ConnectionFactoryFilterDecorates the passedoriginalConnectionFactoryto add the filtering logic.- Specified by:
createin interfaceConnectionFactoryFilter<ResolvedAddress,C extends ListenableAsyncCloseable> - Parameters:
original-ConnectionFactoryto filter.- Returns:
- Decorated
ConnectionFactorythat contains the filtering logic.
-
requiredOffloads
Description copied from interface:ConnectionFactoryFilterReturn anExecutionStrategythat describes the offloads required by the influencer.If the returned strategy extends
ConnectExecutionStrategythen the connection creation or accept may be offloaded.If the returned strategy extends
HttpExecutionStrategythen 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.- Specified by:
requiredOffloadsin interfaceConnectionFactoryFilter<ResolvedAddress,C extends ListenableAsyncCloseable> - Specified by:
requiredOffloadsin interfaceExecutionStrategyInfluencer<ResolvedAddress>- Returns:
- the
ExecutionStrategyrequired by the influencer.
-