1 8 package org.mmbase.core.event; 9 10 import java.io.Serializable ; 11 12 import org.mmbase.module.core.MMBase; 13 14 21 public abstract class Event implements Serializable , org.mmbase.util.PublicCloneable { 22 23 24 public static final int TYPE_UNSPECIFIED = -1; 25 public static final int TYPE_NEW = 0; 26 public static final int TYPE_CHANGE = 1; 27 public static final int TYPE_DELETE = 2; 28 29 protected int eventType = TYPE_UNSPECIFIED; 30 protected String machine; 31 32 36 public String getMachine() { 37 return machine; 38 } 39 public boolean isLocal() { 40 return MMBase.getMMBase().getMachineName().equals(machine); 41 } 42 43 44 48 public int getType() { 49 return eventType; 50 } 51 52 56 public Event(String machine, int type) { 57 this.machine = machine == null ? 58 MMBase.getMMBase().getMachineName() : 59 machine; 60 this.eventType = type; 61 } 62 63 public Event(String machine) { 64 this(machine, TYPE_UNSPECIFIED); 65 } 66 67 public Object clone(){ 68 Object clone = null; 69 try { 70 clone = super.clone(); 71 } catch (CloneNotSupportedException e) {} 72 return clone; 73 } 74 75 } 76 | Popular Tags |