1 19 20 21 package org.apache.cayenne.event; 22 23 import java.util.Collections ; 24 import java.util.EventObject ; 25 import java.util.Map ; 26 27 34 public class CayenneEvent extends EventObject { 35 36 protected Map info; 37 protected transient Object postedBy; 38 protected EventSubject subject; 39 40 public CayenneEvent(Object source) { 41 this(source, null); 42 } 43 44 public CayenneEvent(Object source, Map info) { 45 this(source, source, info); 46 } 47 48 54 public CayenneEvent(Object source, Object postedBy, Map info) { 55 super(source); 56 this.postedBy = postedBy; 57 this.info = info; 58 } 59 60 public Map getInfo() { 61 return info != null ? info : Collections.EMPTY_MAP; 62 } 63 64 67 public EventSubject getSubject() { 68 return subject; 69 } 70 71 74 public void setSubject(EventSubject subject) { 75 this.subject = subject; 76 } 77 78 81 void setSource(Object source) { 82 super.source = source; 83 } 84 85 89 public Object getPostedBy() { 90 return postedBy; 91 } 92 93 public void setPostedBy(Object postedBy) { 94 this.postedBy = postedBy; 95 } 96 } 97 | Popular Tags |