Class HandlerInvoker.DelegatingHandlerInvoker
java.lang.Object
io.fluxzero.common.handling.HandlerInvoker.DelegatingHandlerInvoker
- All Implemented Interfaces:
HandlerDescriptor, HandlerInvoker
- Enclosing interface:
HandlerInvoker
public abstract static class HandlerInvoker.DelegatingHandlerInvoker
extends Object
implements HandlerInvoker
A
HandlerInvoker that delegates all behavior to another instance. This is commonly used to wrap or extend
behavior without altering core logic.-
Nested Class Summary
Nested classes/interfaces inherited from interface HandlerInvoker
HandlerInvoker.DelegatingHandlerInvoker, HandlerInvoker.SimpleInvoker -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether the handler method has a return value.<A extends Annotation>
ARetrieves a specific annotation from the handler method, if present.Class<?> The target class that contains the handler method.booleanIndicates whether this handler operates in passive mode (i.e., results will not be published).booleanWhether a deferred invocation has yet to decide if it will be skipped.booleanmaySkip()Whether this invoker can silently skip after selection, possibly during asynchronous completion.voidonSkipDecision(Runnable callback) Runs a callback when the pending skip decision is available, including a silent refusal.toString()booleanIndicates whether this invocation was deliberately skipped after handler selection.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface HandlerInvoker
andFinally, invoke, invoke
-
Field Details
-
delegate
-
-
Constructor Details
-
DelegatingHandlerInvoker
public DelegatingHandlerInvoker()
-
-
Method Details
-
getTargetClass
Description copied from interface:HandlerInvokerThe target class that contains the handler method.- Specified by:
getTargetClassin interfaceHandlerDescriptor- Specified by:
getTargetClassin interfaceHandlerInvoker- Returns:
- the declaring class of the handler
-
getMethod
Description copied from interface:HandlerInvoker- Specified by:
getMethodin interfaceHandlerDescriptor- Specified by:
getMethodin interfaceHandlerInvoker- Returns:
- the executable method
-
getMethodAnnotation
Description copied from interface:HandlerInvokerRetrieves a specific annotation from the handler method, if present.- Specified by:
getMethodAnnotationin interfaceHandlerDescriptor- Specified by:
getMethodAnnotationin interfaceHandlerInvoker- Type Parameters:
A- the annotation type- Returns:
- the annotation instance, or
nullif not found
-
expectResult
public boolean expectResult()Description copied from interface:HandlerInvokerIndicates whether the handler method has a return value.This is based on the method's signature: if it returns
void, this returnsfalse; otherwise, it returnstrue.- Specified by:
expectResultin interfaceHandlerDescriptor- Specified by:
expectResultin interfaceHandlerInvoker- Returns:
trueif the method returns a value;falseif it isvoid
-
isPassive
public boolean isPassive()Description copied from interface:HandlerInvokerIndicates whether this handler operates in passive mode (i.e., results will not be published).- Specified by:
isPassivein interfaceHandlerDescriptor- Specified by:
isPassivein interfaceHandlerInvoker- Returns:
trueif passive; otherwisefalse
-
maySkip
public boolean maySkip()Description copied from interface:HandlerInvokerWhether this invoker can silently skip after selection, possibly during asynchronous completion. Callers that publish a result must recheckHandlerInvoker.wasSkipped()after the result completes in that case.- Specified by:
maySkipin interfaceHandlerInvoker
-
isSkipPending
public boolean isSkipPending()Description copied from interface:HandlerInvokerWhether a deferred invocation has yet to decide if it will be skipped. Local mirroring must wait for that decision, but may proceed immediately once authorization has allowed the handler to start.- Specified by:
isSkipPendingin interfaceHandlerInvoker
-
onSkipDecision
Description copied from interface:HandlerInvokerRuns a callback when the pending skip decision is available, including a silent refusal. The callback may run on the completing thread; callers own context propagation. Ordinary invokers invoke it immediately.- Specified by:
onSkipDecisionin interfaceHandlerInvoker
-
wasSkipped
public boolean wasSkipped()Description copied from interface:HandlerInvokerIndicates whether this invocation was deliberately skipped after handler selection.- Specified by:
wasSkippedin interfaceHandlerInvoker- Returns:
trueif the underlying handler method was not invoked
-
toString
-