Class Handler.DelegatingHandler<M>
java.lang.Object
io.fluxzero.common.handling.Handler.DelegatingHandler<M>
- Type Parameters:
M- the message type
- All Implemented Interfaces:
Handler<M>
-
Nested Class Summary
Nested classes/interfaces inherited from interface Handler
Handler.DelegatingHandler<M> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHandlerMethodOrNull(M message) Returns a reusableHandlerMethodcapable of processing the given message, ornullwhen unavailable.Returns the planner used to select and prepare this handler's methods.getHandlerMethodPlanOrNull(M message) Returns a reusable plan for the handler method selected for this message.Class<?> Returns the class of the handler's target object.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Handler
getInvoker, getInvokerOrNull, or
-
Field Details
-
delegate
-
-
Constructor Details
-
DelegatingHandler
public DelegatingHandler()
-
-
Method Details
-
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<M>- Returns:
- the class of the handler's target
-
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<M>- Parameters:
message- the message to be handled- Returns:
- a handler method if this handler can handle the message through a reusable method;
nullotherwise
-
getHandlerMethodPlanOrNull
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<M>- 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<M>- Returns:
- a thread-safe handler method planner, or
nullwhen this handler does not support preparation
-
toString
-