Interface KeyedParameterResolver<M>
- Type Parameters:
M- message type accepted by the resolver
- All Superinterfaces:
ParameterResolver<M>
- All Known Implementing Classes:
PayloadParameterResolver, TriggerParameterResolver
The key must fully describe every message-dependent fact used to decide whether this resolver matches or rejects
the parameter. The returned KeyedParameterResolver.Resolution.resolver() must be thread-safe and reusable for every message that
produces an equal key; it must never capture the representative message or a value obtained from it. Returning
null from getCacheKey(Object) disables caching for that message.
Resolved parameter values themselves are never cached. Handler matching only caches the resolution recipe and applies its value resolver to the current message.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordCached outcome of evaluating one resolver for one handler parameter. -
Method Summary
Modifier and TypeMethodDescriptiongetCacheKey(M value) Returns an immutable, equality-stable and preferably low-cardinality applicability key.default booleanisCacheKeyRelevant(Parameter parameter, Annotation methodAnnotation) Returns whether this resolver's key can affect applicability for the supplied parameter.resolveForKey(Parameter parameter, Annotation methodAnnotation, M value, Object cacheKey) Computes a reusable resolution recipe for the supplied key.Methods inherited from interface ParameterResolver
determinesSpecificity, matches, mayApply, prepare, resolve, specificityPriority, test
-
Method Details
-
getCacheKey
-
isCacheKeyRelevant
Returns whether this resolver's key can affect applicability for the supplied parameter.Returning
falsepromises thatresolveForKey(Parameter, Annotation, M, Object)always returnsKeyedParameterResolver.Resolution.unmatched()for this parameter. This lets handler-level selection caches omit irrelevant resolver keys. -
resolveForKey
KeyedParameterResolver.Resolution<M> resolveForKey(Parameter parameter, Annotation methodAnnotation, M value, Object cacheKey) Computes a reusable resolution recipe for the supplied key.- Parameters:
parameter- handler method parametermethodAnnotation- handler method annotationvalue- representative message for the keycacheKey- key returned bygetCacheKey(Object)- Returns:
- reusable resolution outcome
-