INT-851 Added method name to the "name" property of the MessageHistory.Event for a gateway.

This commit is contained in:
Mark Fisher
2009-12-24 02:37:54 +00:00
parent 65102cc725
commit afb53e166d
3 changed files with 38 additions and 2 deletions

View File

@@ -45,7 +45,7 @@ public class MessageHistory implements Iterable<MessageHistory.Event>, Serializa
public static enum ComponentType {
channel, endpoint;
channel, endpoint, gateway;
}

View File

@@ -44,6 +44,7 @@ import org.springframework.integration.annotation.Headers;
import org.springframework.integration.annotation.Payload;
import org.springframework.integration.core.Message;
import org.springframework.integration.core.MessagingException;
import org.springframework.integration.core.MessageHistory.ComponentType;
import org.springframework.integration.message.InboundMessageMapper;
import org.springframework.integration.message.MessageBuilder;
import org.springframework.integration.message.MessageHandlingException;
@@ -154,7 +155,11 @@ public class ArgumentArrayMessageMapper implements InboundMessageMapper<Object[]
throw new IllegalArgumentException(prefix + " parameters provided for method [" + method +
"], expected " + this.parameterList.size() + " but received " + arguments.length + ".");
}
return this.mapArgumentsToMessage(arguments);
Message<?> message = this.mapArgumentsToMessage(arguments);
if (message != null) {
message.getHeaders().getHistory().add(ComponentType.gateway, this.method.getName());
}
return message;
}
private Object[] mapMessageToArguments(Message<?> message) {