1 23 package com.sun.enterprise.util; 24 25 import java.util.EventObject ; 26 import java.util.Hashtable ; 27 28 31 32 public class NotificationEvent extends EventObject { 33 34 public static String OBJECT_THAT_CHANGED = "ObjectThatChanged"; 35 public static String ATTRIBUTE_THAT_CHANGED = "AttributeThatChanged"; 36 37 private String type = null; 38 protected Hashtable properties = new Hashtable (); 39 40 public NotificationEvent(Object source, String type) { 41 super(source); 42 this.type = type; 43 } 44 45 public NotificationEvent(Object source, String type, String name, Object value) { 46 super(source); 47 this.type = type; 48 this.properties.put(name, value); 49 } 50 51 public NotificationEvent(Object source, String type, Object objectThatChanged) { 52 super(source); 53 this.type = type; 54 this.properties.put(OBJECT_THAT_CHANGED, objectThatChanged); 55 } 56 57 public NotificationEvent(Object source, String type, Object objectThatChanged, Object attribThatChanged) { 58 this(source, type, objectThatChanged); 59 if (attribThatChanged != null) { 60 this.properties.put(ATTRIBUTE_THAT_CHANGED, attribThatChanged); 61 } 62 } 63 64 public String getType() { 65 return this.type; 66 } 67 68 public Object getValue(String name) { 69 return this.properties.get(name); 70 } 71 72 public Object getObjectThatChanged() { 73 return this.properties.get(OBJECT_THAT_CHANGED); 74 } 75 76 public Object getAttributeThatChanged() { 77 return this.properties.get(ATTRIBUTE_THAT_CHANGED); 78 } 79 80 } 81 | Popular Tags |