INT-1257, INT-1263 Refactoring Message History (work in progress): MessageHistory's toString() now only returns the name of components that have been visited. Programmatically one can still access the 'type' and 'timestamp' properties as well.

This commit is contained in:
Mark Fisher
2010-08-26 18:58:46 +00:00
parent 49fcba6d57
commit 972f6affc5

View File

@@ -29,6 +29,7 @@ import org.springframework.integration.MessageHeaders;
import org.springframework.integration.context.NamedComponent;
import org.springframework.integration.core.MessageBuilder;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* @author Mark Fisher
@@ -123,7 +124,14 @@ public class MessageHistory implements List<Properties> {
}
public String toString() {
return this.components.toString();
List<String> names = new ArrayList<String>();
for (Properties p : this.components) {
String name = p.getProperty(NAME_PROPERTY);
if (name != null) {
names.add(name);
}
}
return StringUtils.collectionToCommaDelimitedString(names);
}