Class HandlerAdapter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getBean()
      Get the bean from the handler method.
      InvocationResult getInvocationResultFor​(java.lang.Object result, java.lang.Object inboundPayload)
      Build an InvocationResult for the result and inbound payload.
      java.lang.String getMethodAsString​(java.lang.Object payload)
      Get the method signature for the payload type via Method.toGenericString().
      java.lang.reflect.Method getMethodFor​(java.lang.Object payload)
      Get the method for the payload type.
      java.lang.reflect.Type getReturnTypeFor​(java.lang.Object payload)
      Return the return type for the method that will be chosen for this payload.
      InvocationResult invoke​(Message<?> message, java.lang.Object... providedArgs)
      Invoke the appropriate method for the payload.
      boolean isAsyncReplies()
      Return true if any handler method has an async reply type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HandlerAdapter

        public HandlerAdapter​(InvocableHandlerMethod invokerHandlerMethod)
        Construct an instance with the provided method.
        Parameters:
        invokerHandlerMethod - the method.
      • HandlerAdapter

        public HandlerAdapter​(DelegatingInvocableHandler delegatingHandler)
        Construct an instance with the provided delegating handler.
        Parameters:
        delegatingHandler - the handler.
    • Method Detail

      • invoke

        public InvocationResult invoke​(@Nullable
                                       Message<?> message,
                                       java.lang.Object... providedArgs)
                                throws java.lang.Exception
        Invoke the appropriate method for the payload.
        Parameters:
        message - the message.
        providedArgs - additional arguments.
        Returns:
        the invocation result.
        Throws:
        java.lang.Exception - if one occurs.
      • getMethodAsString

        public java.lang.String getMethodAsString​(java.lang.Object payload)
        Get the method signature for the payload type via Method.toGenericString().
        Parameters:
        payload - the payload.
        Returns:
        the method signature.
      • getMethodFor

        public java.lang.reflect.Method getMethodFor​(java.lang.Object payload)
        Get the method for the payload type.
        Parameters:
        payload - the payload.
        Returns:
        the method.
        Since:
        2.2.3
      • getReturnTypeFor

        public java.lang.reflect.Type getReturnTypeFor​(java.lang.Object payload)
        Return the return type for the method that will be chosen for this payload.
        Parameters:
        payload - the payload.
        Returns:
        the return type, or null if no handler found.
        Since:
        2.2.3
      • getBean

        public java.lang.Object getBean()
        Get the bean from the handler method.
        Returns:
        the bean.
      • isAsyncReplies

        public boolean isAsyncReplies()
        Return true if any handler method has an async reply type.
        Returns:
        the asyncReply.
        Since:
        2.2.21
      • getInvocationResultFor

        @Nullable
        public InvocationResult getInvocationResultFor​(java.lang.Object result,
                                                       java.lang.Object inboundPayload)
        Build an InvocationResult for the result and inbound payload.
        Parameters:
        result - the result.
        inboundPayload - the payload.
        Returns:
        the invocation result.
        Since:
        2.1.7