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 Builder for creating custom
HttpExecutionStrategy. |
static HttpExecutionStrategy |
defaultStrategy()
A special default
HttpExecutionStrategy that provides safe default offloading of actions; the offloading
used is unspecified and dependent upon the usage situation. |
static HttpExecutionStrategy |
difference(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 |
offloadAll()
An
HttpExecutionStrategy that requires full offloading of the request-response path and transport events. |
static HttpExecutionStrategy |
offloadNever()
A special
HttpExecutionStrategy that disables all offloads on the request-response and transport event
paths. |
static HttpExecutionStrategy |
offloadNone()
An
HttpExecutionStrategy that requires no offloads on the request-response path or transport event path. |
public static HttpExecutionStrategy defaultStrategy()
HttpExecutionStrategy that provides safe default offloading of actions; the offloading
used is unspecified and dependent upon the usage situation. It may not be merged with other strategies because
the resulting strategy would lose the defaulting behavior. As an additional safety measure all offload query
methods will return true.HttpExecutionStrategy.public static HttpExecutionStrategy offloadNever()
HttpExecutionStrategy that disables all offloads on the request-response and transport event
paths. This strategy is intended to be used only for client and server builders; it should not be returned by
HttpExecutionStrategyInfluencer.requiredOffloads(), which should return offloadNone() instead.
When merged with another execution strategy the result is always this strategy.HttpExecutionStrategy that disables all request-response path offloads.offloadNone()public static HttpExecutionStrategy offloadNone()
HttpExecutionStrategy that requires no offloads on the request-response path or transport event path.
For HttpExecutionStrategyInfluencers that do not block, the
HttpExecutionStrategyInfluencer.requiredOffloads() method should return this value. Unlike
offloadNever(), this strategy merges normally with other execution strategy instances.HttpExecutionStrategy that requires no request-response path offloads.offloadNever()public static HttpExecutionStrategy offloadAll()
HttpExecutionStrategy that requires full offloading of the request-response path and transport events.
Unlike defaultStrategy(), this strategy merges normally with other execution strategy instances.HttpExecutionStrategy that requires no request-response path offloads.defaultStrategy()public static HttpExecutionStrategies.Builder customStrategyBuilder()
HttpExecutionStrategy.HttpExecutionStrategy.@Nullable public static HttpExecutionStrategy difference(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 entity each provide their own
HttpExecutionStrategy.
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.