Interface Caller<U>

  • Type Parameters:
    U - the type of the use case
    All Known Implementing Classes:
    SinglePublicUseCaseMethodCaller
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface Caller<U>
    A Caller is responsible to invoke the correct method on the use case instance. The Deserializer is used to deserialize the event into the parameters of the method. The Serializer is used to serialized the use case's return value back into a Map.
    • Method Detail

      • call

        Object call​(U useCase,
                    Object event,
                    CallingContext callingContext)
             throws Exception
        Invokes the use case with the data from the event.
        Parameters:
        useCase - the use case instance
        event - the data for the use case
        callingContext - contains objects for serialization or parameter injection
        Returns:
        the serialized return value
        Throws:
        Exception - all exceptions declared by the use case method are rethrown