Interface HandlerMethodPlanner<M>
- Type Parameters:
M- the message type used by the handling pipeline
This is an advanced extension point for handler matchers and parameter resolvers. A planner must account for
every input property that can affect method selection, argument resolution, or handler specificity. If it cannot do
so safely, it should return null from getCacheKey(Object) or return
HandlerMethodPreparation.unsupported(); Fluxzero will then use normal per-message handler selection.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ObjectgetCacheKey(HandlerInput<M> input) Returns the complete key without creating the message when the planner supports lazy input.getCacheKey(M message) Returns a key containing every message property that can affect the result ofprepare(Object).default booleanisNoMatchPayloadClassKey(HandlerInput<M> input) Returns whether the payload's runtime class alone completely determines a non-match for this input.default booleanisPayloadClassKey(HandlerInput<M> input) Returns whether the payload's runtime class alone completely determines a successful preparation for this input.default HandlerMethodPreparation<M> prepare(HandlerInput<M> input) Selects and prepares a handler method without creating the message when the planner supports lazy input.Selects a handler method for the representative message and prepares its invocation.default HandlerMethodApplicability<M> prepareApplicability(HandlerInput<M> input) Determines whether a handler applies without creating the complete message when the planner supports lazy input.default HandlerMethodApplicability<M> prepareApplicability(M message) Determines whether a handler applies to the message and returns the complete key needed to reuse that decision.
-
Method Details
-
prepareApplicability
Determines whether a handler applies to the message and returns the complete key needed to reuse that decision.- Parameters:
message- a representative message- Returns:
- the prepared applicability, or an unsupported result when it cannot be cached safely
-
prepareApplicability
Determines whether a handler applies without creating the complete message when the planner supports lazy input.- Parameters:
input- a representative handler input- Returns:
- the prepared applicability, or an unsupported result when it cannot be cached safely
-
getCacheKey
Returns a key containing every message property that can affect the result ofprepare(Object).Keys are compared using
Object.equals(Object)and must remain stable after they are returned. Equal keys must always produce an equivalent match decision and invocation plan.- Parameters:
message- a representative message- Returns:
- a complete reusable key, or
nullwhen this message cannot be cached safely
-
getCacheKey
Returns the complete key without creating the message when the planner supports lazy input.The default implementation delegates to
getCacheKey(Object)and therefore creates the message.- Parameters:
input- a representative handler input- Returns:
- a complete reusable key, or
nullwhen this input cannot be cached safely
-
prepare
Selects a handler method for the representative message and prepares its invocation.- Parameters:
message- a representative message- Returns:
- a prepared plan, a definitive non-match, or an unsupported result
-
prepare
Selects and prepares a handler method without creating the message when the planner supports lazy input.The default implementation delegates to
prepare(Object)and therefore creates the message.- Parameters:
input- a representative handler input- Returns:
- a prepared plan, a definitive non-match, or an unsupported result
-
isPayloadClassKey
Returns whether the payload's runtime class alone completely determines a successful preparation for this input.- Returns:
trueif the prepared match may be reused for every payload of the same runtime class
-
isNoMatchPayloadClassKey
Returns whether the payload's runtime class alone completely determines a non-match for this input.- Returns:
trueif the non-match may be reused for every payload of the same runtime class
-