Class HandlerInterceptor.PreparedInterceptedHandler
- All Implemented Interfaces:
Handler<DeserializingMessage>
- Enclosing interface:
HandlerInterceptor
-
Nested Class Summary
Nested classes/interfaces inherited from interface Handler
Handler.DelegatingHandler<M> -
Constructor Summary
ConstructorsConstructorDescriptionPreparedInterceptedHandler(Handler<DeserializingMessage> delegate, HandlerInterceptor interceptor) -
Method Summary
Modifier and TypeMethodDescriptionReturns a reusableHandlerMethodcapable of processing the given message, ornullwhen unavailable.Returns the planner used to select and prepare this handler's methods.Returns a reusable plan for the handler method selected for this message.getInvoker(DeserializingMessage message) Returns aHandlerInvokercapable of processing the given message, if available.getInvokerOrNull(DeserializingMessage message) Returns aHandlerInvokercapable of processing the given message, ornullwhen unavailable.Class<?> Returns the class of the handler's target object.toString()
-
Constructor Details
-
PreparedInterceptedHandler
public PreparedInterceptedHandler(Handler<DeserializingMessage> delegate, HandlerInterceptor interceptor)
-
-
Method Details
-
getInvoker
Description copied from interface:HandlerReturns aHandlerInvokercapable of processing the given message, if available.- Specified by:
getInvokerin interfaceHandler<DeserializingMessage>- Parameters:
message- the message to be handled- Returns:
- an optional
HandlerInvokerif this handler can handle the message; otherwiseOptional.empty()
-
getInvokerOrNull
Description copied from interface:HandlerReturns aHandlerInvokercapable of processing the given message, ornullwhen unavailable.This is a lower-allocation counterpart to
Handler.getInvoker(Object)for internal hot paths. Implementations that can resolve an invoker without creating anOptionalshould override this method.- Specified by:
getInvokerOrNullin interfaceHandler<DeserializingMessage>- Parameters:
message- the message to be handled- Returns:
- an invoker if this handler can handle the message;
nullotherwise
-
getHandlerMethodOrNull
Description copied from interface:HandlerReturns a reusableHandlerMethodcapable of processing the given message, ornullwhen unavailable.This is an optional lower-allocation path for handlers whose target and method plan can be reused across messages. Implementations that cannot expose a stable method should return
nulland rely onHandler.getInvokerOrNull(Object).- Specified by:
getHandlerMethodOrNullin interfaceHandler<DeserializingMessage>- Parameters:
message- the message to be handled- Returns:
- a handler method if this handler can handle the message through a reusable method;
nullotherwise
-
getHandlerMethodPlanOrNull
public HandlerMethodPlan<DeserializingMessage> getHandlerMethodPlanOrNull(DeserializingMessage message) Description copied from interface:HandlerReturns a reusable plan for the handler method selected for this message.The default asks
Handler.getHandlerMethodPlanner()to prepare the plan. Anullresult means that this handler cannot safely prepare the invocation, so the caller should useHandler.getInvokerOrNull(Object)orHandler.getHandlerMethodOrNull(Object)instead.- Specified by:
getHandlerMethodPlanOrNullin interfaceHandler<DeserializingMessage>- Parameters:
message- the message to match- Returns:
- the prepared invocation plan, or
nullwhen preparation is unsupported or no method matches
-
getHandlerMethodPlanner
Description copied from interface:HandlerReturns the planner used to select and prepare this handler's methods.The returned planner may be cached and invoked concurrently. The default returns
null, which keeps implementations that only support regular per-message matching fully compatible.- Specified by:
getHandlerMethodPlannerin interfaceHandler<DeserializingMessage>- Returns:
- a thread-safe handler method planner, or
nullwhen this handler does not support preparation
-
getTargetClass
Description copied from interface:HandlerReturns the class of the handler's target object. This may be used for reflective operations, logging, or framework-level behavior.- Specified by:
getTargetClassin interfaceHandler<DeserializingMessage>- Returns:
- the class of the handler's target
-
toString
-