public final class HttpExecutionStrategies
extends Object
HttpExecutionStrategy.| Modifier and Type | Class and Description |
|---|---|
static class |
HttpExecutionStrategies.Builder
A builder to build an
HttpExecutionStrategy. |
| Modifier and Type | Method and Description |
|---|---|
static HttpExecutionStrategies.Builder |
customStrategyBuilder()
A
HttpExecutionStrategy that disables all offloads. |
static HttpExecutionStrategy |
defaultStrategy()
The default
HttpExecutionStrategy. |
static HttpExecutionStrategy |
defaultStrategy(Executor executor)
The default
HttpExecutionStrategy using the passed Executor. |
static HttpExecutionStrategy |
difference(Executor fallback,
HttpExecutionStrategy left,
HttpExecutionStrategy right)
Find the difference between two strategies and provide a resulting strategy if there are differences in between
the strategies.
|
static HttpExecutionStrategy |
noOffloadsStrategy()
A
HttpExecutionStrategy that disables all offloads. |
public static HttpExecutionStrategy defaultStrategy()
HttpExecutionStrategy.HttpExecutionStrategy.public static HttpExecutionStrategy defaultStrategy(Executor executor)
HttpExecutionStrategy using the passed Executor.executor - Executor to use.HttpExecutionStrategy.public static HttpExecutionStrategy noOffloadsStrategy()
HttpExecutionStrategy that disables all offloads.HttpExecutionStrategy that disables all offloads.public static HttpExecutionStrategies.Builder customStrategyBuilder()
HttpExecutionStrategy that disables all offloads.HttpExecutionStrategy that disables all offloads.@Nullable public static HttpExecutionStrategy difference(Executor fallback, HttpExecutionStrategy left, HttpExecutionStrategy right)
HttpExecutionStrategy. This method is useful to reduce duplicating work across these entities if the
caller has already offloaded all the paths required to be offloaded by the callee.
Entities: Entity 1 => Entity 2 => Entity 3
(calls) (calls)
Strategies: No offloads Offload Send Offload Send + Meta
In the above call hierarchy, if Entity 1 uses this method to find the HttpExecutionStrategy to
use for invoking Entity 2, the resulting HttpExecutionStrategy will only offload sending to the
transport. However, if Entity 2 uses this method to find the HttpExecutionStrategy to
use for invoking Entity 3, the resulting HttpExecutionStrategy will only offload receiving of
metadata.
Effectively, using this method will remove redundant offloading when more than one entities provide their own
HttpExecutionStrategy.
fallback - Executor used as fallback while invoking the strategies.left - HttpExecutionStrategy which is already in effect.right - HttpExecutionStrategy which is expected to be used.HttpExecutionStrategy if there are any differences between the two strategies. null if
the two strategies are the same.