1 22 package org.jboss.monitor; 23 24 import javax.management.Notification ; 25 import javax.management.ObjectName ; 26 import java.util.Map ; 27 import java.util.HashMap ; 28 29 36 public class JBossMonitorNotification extends Notification 37 { 38 public static final String NOTIFICATION_TYPE = "JBOSS_MONITOR_NOTIFICATION"; 39 public static final String OBSERVED_OBJECT = "OBSERVED_OBJECT"; 40 public static final String MONITOR_OBJECT_NAME = "MONITOR_OBJECT_NAME"; 41 public static final String MONITOR_NAME = "MONITOR_NAME"; 42 public static final String ATTRIBUTE = "ATTRIBUTE"; 43 44 45 protected final ObjectName observedObject; 46 protected final ObjectName monitorObjectName; 47 protected final String monitorName; 48 protected final String attribute; 49 50 public JBossMonitorNotification(String monitorName, ObjectName monitorObjectName, ObjectName observedObject, 51 String attribute, long sequenceNumber) 52 { 53 super(NOTIFICATION_TYPE, monitorObjectName, sequenceNumber); 54 this.observedObject = observedObject; 55 this.attribute = attribute; 56 this.monitorName = monitorName; 57 this.monitorObjectName = monitorObjectName; 58 } 59 60 public ObjectName getObservedObject() 61 { 62 return observedObject; 63 } 64 65 public ObjectName getMonitorObjectName() 66 { 67 return monitorObjectName; 68 } 69 70 public String getMonitorName() 71 { 72 return monitorName; 73 } 74 75 public String getAttribute() 76 { 77 return attribute; 78 } 79 80 86 public Map substitutionMap() 87 { 88 HashMap map = new HashMap (); 89 map.put(OBSERVED_OBJECT, observedObject.toString()); 90 map.put(MONITOR_OBJECT_NAME, monitorObjectName.toString()); 91 map.put(MONITOR_NAME, monitorName); 92 map.put(ATTRIBUTE, attribute); 93 return map; 94 } 95 } 96 | Popular Tags |