Interface UseCaseMethodInvoker

  • All Known Implementing Classes:
    SerializingMethodInvoker

    public interface UseCaseMethodInvoker
    Invokes a specific method on the use case.
    • Method Detail

      • invoke

        Object invoke​(Object useCase,
                      Object event,
                      Deserializer requestDeserializer,
                      Serializer responseSerializer,
                      ParameterInjector parameterInjector)
               throws Exception
        Takes the use case instance and the current event to invoke the method on the use case instance. The Deserializer is used to deserialize the event into the parameters of the method. The method's return value is deserialized with the Serializer.
        Parameters:
        useCase - the use case instance
        event - the request message
        requestDeserializer - the Deserializer for the parameters
        responseSerializer - the Serializer for the return value
        parameterInjector - the configured ParameterInjector with all injections
        Returns:
        the serialized return value as Map
        Throws:
        MethodInvocationException - when the method cannot be invoked
        ClassCastException - when the event is not a valid Map of type <String, Object>
        Exception - all exceptions declared by the use case method are rethrown