/** * Return the method that will be invoked for this payload. * @param payload the payload. * @return the method. * @since 2.0 */ public Method getMethodFor(Object payload) { return getHandlerForPayload(payload.getClass()).getMethod(); }
/** * Return the method that will be invoked for this payload. * @param payload the payload. * @return the method. * @since 2.0 */ public Method getMethodFor(Object payload) { return getHandlerForPayload(payload.getClass()).getMethod(); }
/** * Return a string representation of the method that will be invoked for this payload. * @param payload the payload. * @return the method name. */ public String getMethodNameFor(Object payload) { InvocableHandlerMethod handlerForPayload = null; try { handlerForPayload = getHandlerForPayload(payload.getClass()); } catch (Exception e) { // NOSONAR } return handlerForPayload == null ? "no match" : handlerForPayload.getMethod().toGenericString(); }
/** * Return a string representation of the method that will be invoked for this payload. * @param payload the payload. * @return the method name. */ public String getMethodNameFor(Object payload) { InvocableHandlerMethod handlerForPayload = null; try { handlerForPayload = getHandlerForPayload(payload.getClass()); } catch (Exception e) { // NOSONAR } return handlerForPayload == null ? "no match" : handlerForPayload.getMethod().toGenericString(); }
/** * Invoke the method with the given message. * @param message the message. * @param providedArgs additional arguments. * @return the result of the invocation. * @throws Exception raised if no suitable argument resolver can be found, * or the method raised an exception. */ public InvocationResult invoke(Message<?> message, Object... providedArgs) throws Exception { // NOSONAR Class<? extends Object> payloadClass = message.getPayload().getClass(); InvocableHandlerMethod handler = getHandlerForPayload(payloadClass); Object result = handler.invoke(message, providedArgs); if (message.getHeaders().get(AmqpHeaders.REPLY_TO) == null) { Expression replyTo = this.handlerSendTo.get(handler); if (replyTo != null) { return new InvocationResult(result, replyTo, handler.getMethod().getGenericReturnType()); } } return new InvocationResult(result, null, handler.getMethod().getGenericReturnType()); }
/** * Invoke the method with the given message. * @param message the message. * @param providedArgs additional arguments. * @return the result of the invocation. * @throws Exception raised if no suitable argument resolver can be found, * or the method raised an exception. */ public InvocationResult invoke(Message<?> message, Object... providedArgs) throws Exception { // NOSONAR Class<? extends Object> payloadClass = message.getPayload().getClass(); InvocableHandlerMethod handler = getHandlerForPayload(payloadClass); Object result = handler.invoke(message, providedArgs); if (message.getHeaders().get(AmqpHeaders.REPLY_TO) == null) { Expression replyTo = this.handlerSendTo.get(handler); if (replyTo != null) { return new InvocationResult(result, replyTo, handler.getMethod().getGenericReturnType()); } } return new InvocationResult(result, null, handler.getMethod().getGenericReturnType()); }