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 theConnectionFactory
decorated by this filter.
- All Implemented Interfaces:
ConnectionFactoryFilter<ResolvedAddress,C>
public final class TransportObserverConnectionFactoryFilter<ResolvedAddress,C extends ListenableAsyncCloseable> extends java.lang.Object implements ConnectionFactoryFilter<ResolvedAddress,C>
AConnectionFactoryFilter
that configures aTransportObserver
for new connections.
-
-
Constructor Summary
Constructors Constructor Description TransportObserverConnectionFactoryFilter(TransportObserver observer)
Creates a new instance.TransportObserverConnectionFactoryFilter(java.util.function.Function<ResolvedAddress,TransportObserver> observerFactory)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectionFactory<ResolvedAddress,C>
create(ConnectionFactory<ResolvedAddress,C> original)
Decorates the passedoriginal
ConnectionFactory
to add the filtering logic.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.servicetalk.client.api.ConnectionFactoryFilter
append
-
-
-
-
Constructor Detail
-
TransportObserverConnectionFactoryFilter
public TransportObserverConnectionFactoryFilter(TransportObserver observer)
Creates a new instance.- Parameters:
observer
-TransportObserver
to use for new connections
-
TransportObserverConnectionFactoryFilter
public TransportObserverConnectionFactoryFilter(java.util.function.Function<ResolvedAddress,TransportObserver> observerFactory)
Creates a new instance.- Parameters:
observerFactory
- a factory to create aTransportObserver
for new connections perTransportObserverConnectionFactoryFilter
. May returnnull
to avoid configuringTransportObserver
for some addresses.
-
-
Method Detail
-
create
public ConnectionFactory<ResolvedAddress,C> create(ConnectionFactory<ResolvedAddress,C> original)
Description copied from interface:ConnectionFactoryFilter
Decorates the passedoriginal
ConnectionFactory
to add the filtering logic.- Specified by:
create
in interfaceConnectionFactoryFilter<ResolvedAddress,C extends ListenableAsyncCloseable>
- Parameters:
original
-ConnectionFactory
to filter.- Returns:
- Decorated
ConnectionFactory
that contains the filtering logic.
-
-