public class JMXConnectionNotification extends Notification
客户端连接打开或关闭或通知丢失时发出的通知。 这些通知由连接器服务器(JMXConnectorServer的实例 )和连接器客户端(实例为JMXConnector ) 发送 。 对于某些连接器,会话可以由一系列连接组成。 连接打开和连接关闭的通知将被发送给每一个。
通知类型是以下之一:
Type Meaningjmx.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.
该timeStamp的timeStamp是一个时间值(与System.currentTimeMillis()一致 ),指示何时构建通知。
| Modifier and Type | Field and Description |
|---|---|
static String |
CLOSED
连接关闭通知的通知类型字符串。
|
static String |
FAILED
连接失败通知的通知类型字符串。
|
static String |
NOTIFS_LOST
可能丢失通知的连接的通知类型字符串。
|
static String |
OPENED
连接打开通知的通知类型字符串。
|
source| Constructor and Description |
|---|
JMXConnectionNotification(String type, Object source, String connectionId, long sequenceNumber, String message, Object userData)
构造一个新的连接通知。
|
| Modifier and Type | Method and Description |
|---|---|
String |
getConnectionId()
此通知所属的连接ID。
|
getMessage, getSequenceNumber, getTimeStamp, getType, getUserData, setSequenceNumber, setSource, setTimeStamp, setUserData, toStringgetSourcepublic static final String OPENED
连接打开通知的通知类型字符串。
public static final String CLOSED
连接关闭通知的通知类型字符串。
public static final String FAILED
连接失败通知的通知类型字符串。
public static final String NOTIFS_LOST
可能丢失通知的连接的通知类型字符串。
public JMXConnectionNotification(String type, Object source, String connectionId, long sequenceNumber, String message, Object userData)
source取决于是由连接器服务器还是连接器客户端发送:
ObjectName。 否则,它是对连接器服务器对象本身的引用,它是JMXConnectorServer的子类的实例 。 JMXConnector 。 type - 通知的类型。
这通常是一个常量OPENED , CLOSED , FAILED , NOTIFS_LOST 。
它不是一个错误,因为它是一个不同的字符串。
source - 发送通知的连接器服务器或客户端。
connectionId - 其连接器服务器内的连接ID。
sequenceNumber - 非负整数。
预期但不要求该数字将大于此来源的sequenceNumber中之前的任何sequenceNumber 。
message - 未指定的文本消息,通常包含事件的可读描述。
可以为null。
userData - 一种对象,其类型和含义由连接器服务器定义。
可以为null。
NullPointerException如果-
type ,
source ,或
connectionId为null。
IllegalArgumentException - 如果
sequenceNumber为负数。
public String getConnectionId()
此通知所属的连接ID。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.