Class JMXConnectionNotification
- All Implemented Interfaces:
Serializable
Notification emitted when a client connection is opened or
closed or when notifications are lost. These notifications are
sent by connector servers (instances of JMXConnectorServer)
and by connector clients (instances of JMXConnector). For
certain connectors, a session can consist of a sequence of
connections. Connection-opened and connection-closed notifications
will be sent for each one.
The notification type is one of the following:
| Type | Meaning |
|---|---|
jmx.remote.connection.opened |
A new client connection has been opened. |
jmx.remote.connection.closed |
A client connection has been closed. |
jmx.remote.connection.failed |
A client connection has failed unexpectedly. |
jmx.remote.connection.notifs.lost |
A client connection has potentially lost notifications. This notification only appears on the client side. |
The timeStamp of the notification is a time value
(consistent with System.currentTimeMillis()) indicating
when the notification was constructed.
- Since:
- 1.5
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringNotification type string for a connection-closed notification.static final StringNotification type string for a connection-failed notification.static final StringNotification type string for a connection that has possibly lost notifications.static final StringNotification type string for a connection-opened notification.Fields declared in class Notification
sourceModifier and TypeFieldDescriptionprotected ObjectThis field hides theEventObject.sourcefield in the parent class to make it non-transient and therefore part of the serialized form. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe connection ID to which this notification pertains.Methods declared in class Notification
getMessage, getSequenceNumber, getTimeStamp, getType, getUserData, setSequenceNumber, setSource, setTimeStamp, setUserData, toStringModifier and TypeMethodDescriptionGet the notification message.longGet the notification sequence number.longGet the notification timestamp.getType()Get the notification type.Get the user data.voidsetSequenceNumber(long sequenceNumber) Set the notification sequence number.voidSets the source.voidsetTimeStamp(long timeStamp) Set the notification timestamp.voidsetUserData(Object userData) Set the user data.toString()Returns a String representation of this notification.Methods declared in class EventObject
getSourceMethods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Field Details
-
OPENED
Notification type string for a connection-opened notification.
- See Also:
-
CLOSED
Notification type string for a connection-closed notification.
- See Also:
-
FAILED
Notification type string for a connection-failed notification.
- See Also:
-
NOTIFS_LOST
Notification type string for a connection that has possibly lost notifications.
- See Also:
-
-
Constructor Details
-
JMXConnectionNotification
public JMXConnectionNotification(String type, Object source, String connectionId, long sequenceNumber, String message, Object userData) Constructs a new connection notification. Thesourceof 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
ObjectNameunder which it is registered. Otherwise, it is a reference to the connector server object itself, an instance of a subclass ofJMXConnectorServer. - For a connector client, the source is a reference to the
connector client object, an instance of a class implementing
JMXConnector.
- Parameters:
type- the type of the notification. This is usually one of the constantsOPENED,CLOSED,FAILED,NOTIFS_LOST. It is not an error for it to be a different string.source- the connector server or client emitting the notification.connectionId- the ID of the connection within its connector server.sequenceNumber- a non-negative integer. It is expected but not required that this number will be greater than any previoussequenceNumberin a notification from this source.message- an unspecified text message, typically containing a human-readable description of the event. Can be null.userData- an object whose type and meaning is defined by the connector server. Can be null.- Throws:
NullPointerException- iftype,source, orconnectionIdis null.IllegalArgumentException- ifsequenceNumberis negative.
- For a connector server, if it is registered in an MBean
server, the source is the
-
-
Method Details
-
getConnectionId
The connection ID to which this notification pertains.
- Returns:
- the connection ID.
-