Class ReturnActionHandler<T>
- java.lang.Object
-
- de.quantummaid.eventmaid.channel.action.ReturnActionHandler<T>
-
- Type Parameters:
T- the type of messages of theChannel
- All Implemented Interfaces:
ActionHandler<Return<T>,T>
public final class ReturnActionHandler<T> extends Object implements ActionHandler<Return<T>,T>
TheActionHandlerimplementation for theReturnAction. This handler will go back through theChannelProcessingFramehistory to obtain the lastCallAction, that was not yet matched with anReturnAction. If found, it will link those two and will return back to the point theCallwas executed. If no not yet consumedCallwas found, aReturnWithoutCallExceptionis thrown.- See Also:
- EventMaid Documentation
-
-
Constructor Summary
Constructors Constructor Description ReturnActionHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandle(Return<T> returnAction, ProcessingContext<T> processingContext)Will lookup the lastCallActionand return from it.static <T> ReturnActionHandler<T>returnActionHandler()Factory method for a newReturnActionHandler.
-
-
-
Method Detail
-
returnActionHandler
public static <T> ReturnActionHandler<T> returnActionHandler()
Factory method for a newReturnActionHandler.- Type Parameters:
T- the type of messages of theChannel- Returns:
- a new
ReturnActionHandler
-
handle
public void handle(Return<T> returnAction, ProcessingContext<T> processingContext)
Will lookup the lastCallActionand return from it.- Specified by:
handlein interfaceActionHandler<Return<T>,T>- Parameters:
returnAction- theReturnActionto be handledprocessingContext- the message- Throws:
ReturnWithoutCallException- if not not yet handledCallcould be found
-
-