Package io.fluxcapacitor.common.handling
Class HandlerInvoker.SimpleInvoker
java.lang.Object
io.fluxcapacitor.common.handling.HandlerInvoker.SimpleInvoker
- All Implemented Interfaces:
HandlerInvoker
- Enclosing interface:
HandlerInvoker
A simple invoker backed by a
Callable
, typically used for test utilities or framework-internal logic. Not
associated with any actual handler method.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.fluxcapacitor.common.handling.HandlerInvoker
HandlerInvoker.DelegatingHandlerInvoker, HandlerInvoker.SimpleInvoker
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates 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.invoke
(BiFunction<Object, Object, Object> combiner) Invokes the handler and combines results using the given combiner function.boolean
Indicates whether this handler operates in passive mode (i.e., results will not be published).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.fluxcapacitor.common.handling.HandlerInvoker
andFinally, invoke
-
Constructor Details
-
SimpleInvoker
public SimpleInvoker()
-
-
Method Details
-
getTargetClass
Description copied from interface:HandlerInvoker
The target class that contains the handler method.- Specified by:
getTargetClass
in interfaceHandlerInvoker
- Returns:
- the declaring class of the handler
-
getMethod
Description copied from interface:HandlerInvoker
- Specified by:
getMethod
in interfaceHandlerInvoker
- Returns:
- the executable method
-
getMethodAnnotation
Description copied from interface:HandlerInvoker
Retrieves a specific annotation from the handler method, if present.- Specified by:
getMethodAnnotation
in interfaceHandlerInvoker
- Type Parameters:
A
- the annotation type- Returns:
- the annotation instance, or
null
if not found
-
expectResult
public boolean expectResult()Description copied from interface:HandlerInvoker
Indicates 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:
expectResult
in interfaceHandlerInvoker
- Returns:
true
if the method returns a value;false
if it isvoid
-
isPassive
public boolean isPassive()Description copied from interface:HandlerInvoker
Indicates whether this handler operates in passive mode (i.e., results will not be published).- Specified by:
isPassive
in interfaceHandlerInvoker
- Returns:
true
if passive; otherwisefalse
-
invoke
Description copied from interface:HandlerInvoker
Invokes the handler and combines results using the given combiner function. Used when aggregating results from multiple invokers (e.g.HandlerInvoker.join(List)
).- Specified by:
invoke
in interfaceHandlerInvoker
- Parameters:
combiner
- function to combine multiple results- Returns:
- the combined result
-