1 7 8 9 package javax.management.remote; 10 11 import javax.management.Notification ; 12 import javax.management.ObjectName ; 13 14 61 public class JMXConnectionNotification extends Notification { 62 63 private static final long serialVersionUID = -2331308725952627538L; 64 65 68 public static final String OPENED = "jmx.remote.connection.opened"; 69 70 73 public static final String CLOSED = "jmx.remote.connection.closed"; 74 75 78 public static final String FAILED = "jmx.remote.connection.failed"; 79 80 84 public static final String NOTIFS_LOST = 85 "jmx.remote.connection.notifs.lost"; 86 87 134 public JMXConnectionNotification(String type, 135 Object source, 136 String connectionId, 137 long sequenceNumber, 138 String message, 139 Object userData) { 140 146 super((String ) nonNull(type), 147 nonNull(source), 148 Math.max(0, sequenceNumber), 149 System.currentTimeMillis(), 150 message); 151 if (type == null || source == null || connectionId == null) 152 throw new NullPointerException ("Illegal null argument"); 153 if (sequenceNumber < 0) 154 throw new IllegalArgumentException ("Negative sequence number"); 155 this.connectionId = connectionId; 156 setUserData(userData); 157 } 158 159 private static Object nonNull(Object arg) { 160 if (arg == null) 161 return ""; 162 else 163 return arg; 164 } 165 166 171 public String getConnectionId() { 172 return connectionId; 173 } 174 175 179 private final String connectionId; 180 } 181 | Popular Tags |