public JMXConnectionNotification(String type, Object source, String connectionId, long sequenceNumber, String message, Object userData)Constructs a new connection notification. The {@link
#getSource() source} of the notification depends on whether it
is being sent by a connector server or a connector client:
- For a connector server, if it is registered in an MBean
server, the source is the {@link ObjectName} under which it is
registered. Otherwise, it is a reference to the connector
server object itself, an instance of a subclass of {@link
JMXConnectorServer}.
- For a connector client, the source is a reference to the
connector client object, an instance of a class implementing
{@link JMXConnector}.
/* We don't know whether the parent class (Notification) will
throw an exception if the type or source is null, because
JMX 1.2 doesn't specify that. So we make sure it is not
null, in case it would throw the wrong exception
(e.g. IllegalArgumentException instead of
NullPointerException). Likewise for the sequence number. */
super((String) nonNull(type),
nonNull(source),
Math.max(0, sequenceNumber),
System.currentTimeMillis(),
message);
if (type == null || source == null || connectionId == null)
throw new NullPointerException("Illegal null argument");
if (sequenceNumber < 0)
throw new IllegalArgumentException("Negative sequence number");
this.connectionId = connectionId;
setUserData(userData);
|