Top Description Fields Constructors Methods
javax.management.remote

public Class JMXConnectionNotification

extends Notification
Class Inheritance
Imports
javax.management.Notification, .ObjectName

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:

JMXConnectionNotification Types
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

Field Summary

Modifier and TypeField and Description
public static final String
CLOSED

Notification type string for a connection-closed notification.

private final String
public static final String
FAILED

Notification type string for a connection-failed notification.

public static final String
NOTIFS_LOST

Notification type string for a connection that has possibly lost notifications.

public static final String
OPENED

Notification type string for a connection-opened notification.

private static final long
Inherited from javax.management.Notification:
source

Constructor Summary

AccessConstructor and Description
public
JMXConnectionNotification(String
the type of the notification. This is usually one of the constants OPENED, CLOSED, FAILED, NOTIFS_LOST. It is not an error for it to be a different string.
type
,
Object
the connector server or client emitting the notification.
source
,
String
the ID of the connection within its connector server.
connectionId
,
long
a non-negative integer. It is expected but not required that this number will be greater than any previous sequenceNumber in a notification from this source.
sequenceNumber
,
String
an unspecified text message, typically containing a human-readable description of the event. Can be null.
message
,
Object
an object whose type and meaning is defined by the connector server. Can be null.
userData
)

Constructs a new connection notification.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the connection ID.
getConnectionId
()

The connection ID to which this notification pertains.

private static Object
Inherited from javax.management.Notification:
getMessagegetSequenceNumbergetTimeStampgetTypegetUserDatasetSequenceNumbersetSourcesetTimeStampsetUserDatatoString

Field Detail

CLOSEDback to summary
public static final String CLOSED

Notification type string for a connection-closed notification.

connectionIdback to summary
private final String connectionId
See Also
getConnectionId()
FAILEDback to summary
public static final String FAILED

Notification type string for a connection-failed notification.

NOTIFS_LOSTback to summary
public static final String NOTIFS_LOST

Notification type string for a connection that has possibly lost notifications.

OPENEDback to summary
public static final String OPENED

Notification type string for a connection-opened notification.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.management.Notification.serialVersionUID.

Constructor Detail

JMXConnectionNotificationback to summary
public JMXConnectionNotification(String type, Object source, String connectionId, long sequenceNumber, String message, Object userData)

Constructs a new connection notification. The 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 ObjectName under which it is registered. Otherwise, it is a reference to the connector server object itself, an instance of a subclass of JMXConnectorServer.
  • For a connector client, the source is a reference to the connector client object, an instance of a class implementing JMXConnector.
Parameters
type:String

the type of the notification. This is usually one of the constants OPENED, CLOSED, FAILED, NOTIFS_LOST. It is not an error for it to be a different string.

source:Object

the connector server or client emitting the notification.

connectionId:String

the ID of the connection within its connector server.

sequenceNumber:long

a non-negative integer. It is expected but not required that this number will be greater than any previous sequenceNumber in a notification from this source.

message:String

an unspecified text message, typically containing a human-readable description of the event. Can be null.

userData:Object

an object whose type and meaning is defined by the connector server. Can be null.

Exceptions
NullPointerException:
if type, source, or connectionId is null.
IllegalArgumentException:
if sequenceNumber is negative.

Method Detail

getConnectionIdback to summary
public String getConnectionId()

The connection ID to which this notification pertains.

Returns:String

the connection ID.

nonNullback to summary
private static Object nonNull(Object arg)