1 22 package org.jboss.kernel.plugins.event; 23 24 import org.jboss.kernel.spi.event.KernelEvent; 25 import org.jboss.util.JBossObject; 26 import org.jboss.util.JBossStringBuilder; 27 28 34 public class AbstractEvent extends JBossObject implements KernelEvent 35 { 36 37 protected Object source; 38 39 40 protected String type; 41 42 43 protected long sequence; 44 45 46 protected long timestamp; 47 48 49 protected Object context; 50 51 60 public AbstractEvent(Object source, String type, long sequence, long timestamp, Object context) 61 { 62 this.source = source; 63 this.type = type; 64 this.sequence = sequence; 65 this.timestamp = timestamp; 66 this.context = context; 67 } 68 69 public Object getContext() 70 { 71 return context; 72 } 73 74 public long getSequence() 75 { 76 return sequence; 77 } 78 79 public Object getSource() 80 { 81 return source; 82 } 83 84 public long getTimestamp() 85 { 86 return timestamp; 87 } 88 89 public String getType() 90 { 91 return type; 92 } 93 94 public void toString(JBossStringBuilder buffer) 95 { 96 buffer.append("source=").append(source); 97 buffer.append(" type=").append(type); 98 buffer.append(" seq=").append(sequence); 99 buffer.append(" time=").append(timestamp); 100 buffer.append(" context=").append(context); 101 } 102 103 public void toShortString(JBossStringBuilder buffer) 104 { 105 buffer.append(type); 106 } 107 } 108 | Popular Tags |