1 16 package org.springframework.webflow.execution; 17 18 import java.util.EventObject ; 19 20 import org.springframework.util.Assert; 21 import org.springframework.webflow.core.collection.AttributeMap; 22 import org.springframework.webflow.core.collection.CollectionUtils; 23 24 44 public final class Event extends EventObject { 45 46 49 private final String id; 50 51 54 private final long timestamp = System.currentTimeMillis(); 55 56 59 private final AttributeMap attributes; 60 61 66 public Event(Object source, String id) { 67 this(source, id, null); 68 } 69 70 77 public Event(Object source, String id, AttributeMap attributes) { 78 super(source); 79 Assert.hasText(id, "The event id is required: please set this event's id to a non-blank string identifier"); 80 this.id = id; 81 this.attributes = (attributes != null ? attributes : CollectionUtils.EMPTY_ATTRIBUTE_MAP); 82 } 83 84 88 public String getId() { 89 return id; 90 } 91 92 97 public long getTimestamp() { 98 return timestamp; 99 } 100 101 106 public AttributeMap getAttributes() { 107 return attributes; 108 } 109 110 public String toString() { 111 return getId(); 112 } 113 } | Popular Tags |