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.@FunctionalInterface
public interface ConnectionFactoryFilter<ResolvedAddress,C extends ListenableAsyncCloseable>
ConnectionFactory
instances for the purpose of filtering.Modifier and Type | Method and Description |
---|---|
default ConnectionFactoryFilter<ResolvedAddress,C> |
append(ConnectionFactoryFilter<ResolvedAddress,C> before)
Returns a composed function that first applies the
before function to its input, and then applies
this function to the result. |
ConnectionFactory<ResolvedAddress,C> |
create(ConnectionFactory<ResolvedAddress,C> original)
Decorates the passed
original ConnectionFactory to add the filtering logic. |
static <ResolvedAddress,C extends ListenableAsyncCloseable> |
identity()
Returns a function that always returns its input
ConnectionFactory . |
ConnectionFactory<ResolvedAddress,C> create(ConnectionFactory<ResolvedAddress,C> original)
original
ConnectionFactory
to add the filtering logic.original
- ConnectionFactory
to filter.ConnectionFactory
that contains the filtering logic.default ConnectionFactoryFilter<ResolvedAddress,C> append(ConnectionFactoryFilter<ResolvedAddress,C> before)
before
function to its input, and then applies
this function to the result.
The order of execution of these filters are in order of append. If 3 filters are added as follows:
builder.append(filter1).append(filter2).append(filter3)Calling
ConnectionFactory
wrapped by this filter chain, the order of invocation of these filters will be:
filter1 => filter2 => filter3 => original connection factory
before
- the function to apply before this function is appliedbefore
function and then applies this function.static <ResolvedAddress,C extends ListenableAsyncCloseable> ConnectionFactoryFilter<ResolvedAddress,C> identity()
ConnectionFactory
.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.ConnectionFactory
.