Class SinglePublicUseCaseMethodCaller<U>
- java.lang.Object
-
- de.quantummaid.eventmaid.usecases.usecaseadapter.usecasecalling.SinglePublicUseCaseMethodCaller<U>
-
-
Constructor Summary
Constructors Constructor Description SinglePublicUseCaseMethodCaller()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectcall(U useCase, Object event, CallingContext callingContext)Invokes the use case with the data from the event.static <U> SinglePublicUseCaseMethodCaller<U>singlePublicUseCaseMethodCaller(Class<U> useCaseClass)Factory method to create a newSinglePublicUseCaseMethodCaller.
-
-
-
Method Detail
-
singlePublicUseCaseMethodCaller
public static <U> SinglePublicUseCaseMethodCaller<U> singlePublicUseCaseMethodCaller(Class<U> useCaseClass)
Factory method to create a newSinglePublicUseCaseMethodCaller.- Type Parameters:
U- the type of the use case- Parameters:
useCaseClass- the class of the use case to call- Returns:
- the newly created
SinglePublicUseCaseMethodCaller - Throws:
IllegalArgumentException- if not suitable method could be found
-
call
public Object call(U useCase, Object event, CallingContext callingContext) throws Exception
Description copied from interface:CallerInvokes the use case with the data from the event.- Specified by:
callin interfaceCaller<U>- Parameters:
useCase- the use case instanceevent- the data for the use casecallingContext- contains objects for serialization or parameter injection- Returns:
- the serialized return value
- Throws:
Exception- all exceptions declared by the use case method are rethrown
-
-