not tracking history for beans that have no explicit id

This commit is contained in:
Mark Fisher
2010-04-30 03:25:38 +00:00
parent 477e8e1a9e
commit fd6a77a9d1
2 changed files with 7 additions and 2 deletions

View File

@@ -22,6 +22,8 @@ import java.util.Iterator;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import org.springframework.util.StringUtils;
/**
* Threadsafe Iterable list of {@link MessageHistoryEvent} instances.
*
@@ -39,7 +41,7 @@ public class MessageHistory implements Iterable<MessageHistoryEvent>, Serializab
* Add a new event with the provided component metadata.
*/
public MessageHistoryEvent addEvent(String name, String type) {
if (name != null) {
if (name != null && !StringUtils.startsWithIgnoreCase(name, "org.springframework")) {
MessageHistoryEvent event = new MessageHistoryEvent(name, type);
this.events.add(event);
return event;

View File

@@ -62,9 +62,12 @@ public class MessageHistoryEvent implements Serializable {
public String toString() {
StringBuilder sb = new StringBuilder();
if (this.type != null) {
sb.append(type + ":");
sb.append(type);
}
if (this.name != null) {
if (this.type != null) {
sb.append(':');
}
sb.append(name);
//sb.append("[" + timestamp + "]");
}