protected InvocableHandlerMethod findHandlerForPayload(Class<? extends Object> payloadClass) { InvocableHandlerMethod result = null; for (InvocableHandlerMethod handler : this.handlers) { if (matchHandlerMethod(payloadClass, handler)) { if (result != null) { boolean resultIsDefault = result.equals(this.defaultHandler); if (!handler.equals(this.defaultHandler) && !resultIsDefault) { throw new KafkaException("Ambiguous methods for payload type: " + payloadClass + ": " + result.getMethod().getName() + " and " + handler.getMethod().getName()); } if (!resultIsDefault) { continue; // otherwise replace the result with the actual match } } result = handler; } } return result != null ? result : this.defaultHandler; }
protected InvocableHandlerMethod findHandlerForPayload(Class<? extends Object> payloadClass) { InvocableHandlerMethod result = null; for (InvocableHandlerMethod handler : this.handlers) { if (matchHandlerMethod(payloadClass, handler)) { if (result != null) { boolean resultIsDefault = result.equals(this.defaultHandler); if (!handler.equals(this.defaultHandler) && !resultIsDefault) { throw new AmqpException("Ambiguous methods for payload type: " + payloadClass + ": " + result.getMethod().getName() + " and " + handler.getMethod().getName()); } if (!resultIsDefault) { continue; // otherwise replace the result with the actual match } } result = handler; } } return result != null ? result : this.defaultHandler; }
protected InvocableHandlerMethod findHandlerForPayload(Class<? extends Object> payloadClass) { InvocableHandlerMethod result = null; for (InvocableHandlerMethod handler : this.handlers) { if (matchHandlerMethod(payloadClass, handler)) { if (result != null) { boolean resultIsDefault = result.equals(this.defaultHandler); if (!handler.equals(this.defaultHandler) && !resultIsDefault) { throw new AmqpException("Ambiguous methods for payload type: " + payloadClass + ": " + result.getMethod().getName() + " and " + handler.getMethod().getName()); } if (!resultIsDefault) { continue; // otherwise replace the result with the actual match } } result = handler; } } return result != null ? result : this.defaultHandler; }