public interface RMIConnection extends Closeable, Remote
用于将MBeanServer请求从客户端转发到其在服务器端的MBeanServer实现的RMI对象。 为连接到RMI连接器的每个远程客户端都有一个Remote对象实现此接口。
用户代码通常不涉及此界面。 它被指定为公共API的一部分,以便该API的不同实现将互操作。
为了确保客户端参数在服务器端使用正确的类加载器进行反序列化,客户端参数(如用于调用方法的参数)包含在MarshalledObject中 。 此接口的实现必须首先为操作及其目标获取适当的类加载器,然后使用此类加载器对编组的参数进行反序列化。 除了如上所述, MarshalledObject或MarshalledObject[]参数不能为空; 如果是,行为是未指定的。
JMX Specification, version 1.4 PDF文件中详细介绍了类装载方面。
大多数方法在这个接口中并行方法在MBeanServerConnection界面。 在这里没有指定方法的行为方面,它与相应的MBeanServerConnection方法相同。
String getConnectionId() throws IOException
返回连接ID。 每个与给定RMI连接器服务器的打开连接的字符串不同。
IOException - 如果发生通用通信异常。
RMIConnector.connect
void close()
throws IOException
关闭此连接。 从此方法返回时,实现此接口的RMI对象将被取消导出,因此对其的远程调用将失败。
close在接口
AutoCloseable
close在接口
Closeable
IOException - 如果连接无法关闭,或远程对象无法取消导出,或发送远程关闭请求时发生通信故障。
ObjectInstance createMBean(String className, ObjectName name, Subject delegationSubject) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOException
className - 要实例化的MBean的类名。
name - MBean的对象名称。
可能为null。
delegationSubject - 包含
Subject主体的Subject或
null使用身份验证主体的null。
ObjectInstance ,包含ObjectName和新实例化的MBean的Java类名。
如果包含的ObjectName是n ,则包含的Java类名称为getMBeanInfo(n).getClassName() 。
ReflectionException - 包装一个
java.lang.ClassNotFoundException或
java.lang.Exception ,当尝试调用MBean的构造函数时。
InstanceAlreadyExistsException - MBean已经在MBean服务器的控制之下了。
MBeanRegistrationException - MBean的preRegister ( MBeanRegistration接口)方法已经抛出异常。
MBean将不会被注册。
MBeanException - MBean的构造函数抛出异常。
NotCompliantMBeanException - 此类不是符合JMX的MBean。
RuntimeOperationsException -包装一个
java.lang.IllegalArgumentException :通过className传入参数是空值,则
ObjectName传入的参数包含一个图案或没有
ObjectName被为MBean指定。
SecurityException - 如果客户端或委托主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Subject delegationSubject) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException
className - 要实例化的MBean的类名。
name - MBean的对象名称。
可能为null。
loaderName - 要使用的类加载器的对象名称。
delegationSubject - 包含
Subject主体的Subject或使用
null的null。
ObjectInstance ,包含ObjectName和新实例化的MBean的Java类名。
如果包含的ObjectName是n ,则包含的Java类名称为getMBeanInfo(n).getClassName() 。
ReflectionException - 包装一个
java.lang.ClassNotFoundException或
java.lang.Exception ,当尝试调用MBean的构造函数时。
InstanceAlreadyExistsException - MBean已经在MBean服务器的控制之下了。
MBeanRegistrationException - MBean的preRegister ( MBeanRegistration接口)方法抛出异常。
MBean将不会被注册。
MBeanException - MBean的构造函数抛出异常。
NotCompliantMBeanException - 此类不是符合JMX的MBean。
InstanceNotFoundException - 指定的类加载器未在MBean服务器中注册。
RuntimeOperationsException -包装一个
java.lang.IllegalArgumentException :通过className传入参数是空值,则
ObjectName传入的参数包含一个图案或没有
ObjectName被为MBean指定。
SecurityException - 如果客户端或委托的主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
ObjectInstance createMBean(String className, ObjectName name, MarshalledObject params, String[] signature, Subject delegationSubject) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOException
MBeanServerConnection.createMBean(String, ObjectName, Object[], String[]) 。
Object[]参数包裹在一个MarshalledObject 。
className - 要实例化的MBean的类名。
name - MBean的对象名称。
可能为null。
params - 一个包含要调用的构造函数的参数的数组,封装在一个MarshalledObject 。
封装的数组可以为空,相当于一个空数组。
signature - 包含要调用的构造函数的签名的数组。
可以为null,相当于一个空数组。
delegationSubject - 如果使用
Subject主体,则包含委派主体或
null的Subject。
ObjectInstance ,包含ObjectName和新实例化的MBean的Java类名。
如果包含的ObjectName是n ,则包含的Java类名称为getMBeanInfo(n).getClassName() 。
ReflectionException - 包装一个
java.lang.ClassNotFoundException或
java.lang.Exception ,当尝试调用MBean的构造函数时。
InstanceAlreadyExistsException - MBean已经在MBean服务器的控制之下了。
MBeanRegistrationException - MBean的preRegister ( MBeanRegistration接口)方法抛出异常。
MBean将不会被注册。
MBeanException - MBean的构造函数已抛出异常。
NotCompliantMBeanException - 此类不是符合JMX的MBean。
RuntimeOperationsException -包装一个
java.lang.IllegalArgumentException :通过className传入参数是空值,则
ObjectName传入的参数包含一个模式,或无
ObjectName被为MBean指定。
SecurityException - 如果客户端或委托主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, MarshalledObject params, String[] signature, Subject delegationSubject) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException
MBeanServerConnection.createMBean(String, ObjectName, ObjectName, Object[], String[]) 。
Object[]参数封装在一个MarshalledObject 。
className - 要实例化的MBean的类名。
name - MBean的对象名称。
可能为null。
loaderName - 要使用的类加载器的对象名。
params - 一个包含要调用的构造函数参数的数组,封装在一个MarshalledObject 。
封装的数组可以为空,相当于一个空数组。
signature - 包含要调用的构造函数的签名的数组。
可以为null,相当于一个空数组。
delegationSubject - 包含
Subject主体的Subject或使用
null的null。
ObjectInstance ,包含ObjectName和新实例化的MBean的Java类名。
如果包含的ObjectName是n ,则包含的Java类名称为getMBeanInfo(n).getClassName() 。
ReflectionException - 包装一个
java.lang.ClassNotFoundException或
java.lang.Exception ,当尝试调用MBean的构造函数时。
InstanceAlreadyExistsException - MBean已经在MBean服务器的控制之下了。
MBeanRegistrationException - MBean的preRegister ( MBeanRegistration接口)方法已经抛出异常。
MBean将不会被注册。
MBeanException - MBean的构造函数已经抛出异常。
NotCompliantMBeanException - 此类不是符合JMX的MBean。
InstanceNotFoundException - 指定的类加载器未在MBean服务器中注册。
RuntimeOperationsException -包装一个
java.lang.IllegalArgumentException :通过className传入参数是空值,则
ObjectName传入的参数包含一个模式,或无
ObjectName被为MBean指定。
SecurityException - 如果客户端或委托的主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
void unregisterMBean(ObjectName name, Subject delegationSubject) throws InstanceNotFoundException, MBeanRegistrationException, IOException
name - 要注销的MBean的对象名称。
delegationSubject -该
Subject包含委托principal或
null如果认证主要来代替。
InstanceNotFoundException - 指定的MBean未在MBean服务器中注册。
MBeanRegistrationException - MBean的preDeregister((
MBeanRegistration接口)方法已经抛出异常。
RuntimeOperationsException - 包装一个java.lang.IllegalArgumentException :参数中的对象名称为null或您尝试注销时的MBean是MBeanServerDelegate MBean。
SecurityException - 如果客户端或委托的主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生通用通信异常。
ObjectInstance getObjectInstance(ObjectName name, Subject delegationSubject) throws InstanceNotFoundException, IOException
name - MBean的对象名称。
delegationSubject - 包含
Subject主体的Subject或使用
null的null。
ObjectInstance与name指定的与MBean关联。
包含的ObjectName是name ,包含的类名是getMBeanInfo(name).getClassName() 。
InstanceNotFoundException - 指定的MBean未在MBean服务器中注册。
RuntimeOperationsException - 包裹一个
java.lang.IllegalArgumentException :参数中的对象名称为null。
SecurityException - 如果客户端或委托的主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
Set<ObjectInstance> queryMBeans(ObjectName name, MarshalledObject query, Subject delegationSubject) throws IOException
MBeanServerConnection.queryMBeans(ObjectName, QueryExp) 。
QueryExp被包裹在一个MarshalledObject 。
name - 标识要检索的MBean的对象名称模式。
如果指定了null或没有域和密钥属性,则将检索注册的所有MBean。
query - 要应用于选择MBean的查询表达式,封装到MarshalledObject 。
如果MarshalledObject封装了一个空值,则不会使用查询表达式来选择MBean。
delegationSubject - 如果使用
Subject主体,则包含委派主体或
null的Subject。
ObjectInstance对象。
如果没有MBean满足查询,则返回一个空列表。
SecurityException - 如果客户端或委托主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
Set<ObjectName> queryNames(ObjectName name, MarshalledObject query, Subject delegationSubject) throws IOException
MBeanServerConnection.queryNames(ObjectName, QueryExp) 。
QueryExp被包裹在一个MarshalledObject 。
name - 标识要检索的MBean名称的对象名称模式。
如果指定了null或没有域和键属性,将检索所有注册的MBean的名称。
query - 要应用于选择MBean的查询表达式,封装在MarshalledObject 。
如果MarshalledObject封装了空值,则不会使用查询表达式来选择MBean。
delegationSubject - 包含
Subject主体的Subject或使用
null的null。
SecurityException - 如果客户端或委托的主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
boolean isRegistered(ObjectName name, Subject delegationSubject) throws IOException
name - 要检查的MBean的对象名称。
delegationSubject - 如果使用
Subject主体,则包含委托主体或
null的Subject。
RuntimeOperationsException - 包裹一个
java.lang.IllegalArgumentException :参数中的对象名称为null。
SecurityException - 如果客户端或委托的主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生通用通信异常。
Integer getMBeanCount(Subject delegationSubject) throws IOException
delegationSubject - 包含
Subject主体的Subject或使用
null的null。
SecurityException - 如果客户端或委托主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
Object getAttribute(ObjectName name, String attribute, Subject delegationSubject) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException, IOException
name -
name属性的MBean的对象名称。
attribute - 指定要检索的属性名称的字符串。
delegationSubject - 如果使用
Subject主体,则包含委派主体或
null的Subject。
AttributeNotFoundException - 指定的属性在MBean中无法访问。
MBeanException - 包装MBean的getter抛出的异常。
InstanceNotFoundException - 指定的MBean未在MBean服务器中注册。
ReflectionException - 在尝试调用getter时,引发了一个
java.lang.Exception 。
RuntimeOperationsException - 包装
java.lang.IllegalArgumentException :参数中的对象名称为null或参数中的属性为空。
RuntimeMBeanException - 包装由MBean的getter抛出的运行时异常。
SecurityException - 如果客户端或委托主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
setAttribute(javax.management.ObjectName, java.rmi.MarshalledObject, javax.security.auth.Subject)
AttributeList getAttributes(ObjectName name, String[] attributes, Subject delegationSubject) throws InstanceNotFoundException, ReflectionException, IOException
name -
name属性的MBean的对象名称。
attributes - 要检索的属性的列表。
delegationSubject - 包含
Subject主体的Subject或使用
null的null。
InstanceNotFoundException - 指定的MBean未在MBean服务器中注册。
ReflectionException - 尝试调用动态MBean的getAttributes方法时发生异常。
RuntimeOperationsException - 包装
java.lang.IllegalArgumentException :参数中的对象名称为null或参数中的属性为空。
SecurityException - 如果客户端或委托的主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生通用通信异常。
setAttributes(javax.management.ObjectName, java.rmi.MarshalledObject, javax.security.auth.Subject)
void setAttribute(ObjectName name, MarshalledObject attribute, Subject delegationSubject) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException, IOException
MBeanServerConnection.setAttribute(ObjectName, Attribute) 。
Attribute参数包装在一个MarshalledObject 。
name - 要在其中设置属性的MBean的名称。
attribute - 要设置的属性的标识和要设置的值,封装在
MarshalledObject 。
delegationSubject -该
Subject包含委托principal或
null如果认证主要来代替。
InstanceNotFoundException - 指定的MBean未在MBean服务器中注册。
AttributeNotFoundException - 指定的属性在MBean中无法访问。
InvalidAttributeValueException - 为属性指定的值无效。
MBeanException - 包装由MBean的setter抛出的异常。
ReflectionException - 在尝试调用setter时,引发一个
java.lang.Exception 。
RuntimeOperationsException - 包裹一个
java.lang.IllegalArgumentException :参数中的对象名称为null或参数中的属性为空。
SecurityException - 如果客户端或委托主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
getAttribute(javax.management.ObjectName, java.lang.String, javax.security.auth.Subject)
AttributeList setAttributes(ObjectName name, MarshalledObject attributes, Subject delegationSubject) throws InstanceNotFoundException, ReflectionException, IOException
MBeanServerConnection.setAttributes(ObjectName, AttributeList) 。
AttributeList参数包裹在一个MarshalledObject 。
name - 要在其中设置属性的MBean的对象名称。
attributes - 属性列表:要设置的属性的标识以及要设置的属性,封装到
MarshalledObject 。
delegationSubject - 包含
Subject主体的Subject或使用
null的null。
InstanceNotFoundException - 指定的MBean未在MBean服务器中注册。
ReflectionException - 尝试调用动态MBean的getAttributes方法时发生异常。
RuntimeOperationsException - 包装一个
java.lang.IllegalArgumentException :参数中的对象名称为null或参数中的属性为空。
SecurityException - 如果客户端或委托主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
getAttributes(javax.management.ObjectName, java.lang.String[], javax.security.auth.Subject)
Object invoke(ObjectName name, String operationName, MarshalledObject params, String[] signature, Subject delegationSubject) throws InstanceNotFoundException, MBeanException, ReflectionException, IOException
MBeanServerConnection.invoke(ObjectName, String, Object[], String[]) 。
Object[]参数包裹在一个MarshalledObject 。
name - 要调用该方法的MBean的对象名称。
operationName - 要调用的操作的名称。
params - 一个数组,包含调用操作时要设置的参数,封装到一个MarshalledObject 。
封装的数组可以为空,相当于一个空数组。
signature - 包含操作签名的数组。
将使用与用于加载调用操作的MBean相同的类加载器来加载类对象。
可以为null,相当于一个空数组。
delegationSubject - 包含
Subject主体的Subject或使用
null的null。
InstanceNotFoundException - 指定的MBean未在MBean服务器中注册。
MBeanException - 包装MBean调用方法抛出的异常。
ReflectionException - 在尝试调用该方法时抛出一个
java.lang.Exception 。
SecurityException - 如果客户端或委托的主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
RuntimeOperationsException -包装一个IllegalArgumentException时name或operationName为空。
String getDefaultDomain(Subject delegationSubject) throws IOException
delegationSubject - 如果使用
Subject主体,则包含委托主体或
null的Subject。
SecurityException - 如果客户端或委托主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生通用通信异常。
String[] getDomains(Subject delegationSubject) throws IOException
delegationSubject -该
Subject包含委托principal或
null如果认证主要来代替。
SecurityException - 如果客户端或委托的主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
MBeanInfo getMBeanInfo(ObjectName name, Subject delegationSubject) throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException
name - 要分析的MBean的名称
delegationSubject - 包含
Subject主体的Subject或使用
null的null。
MBeanInfo一个实例允许检索此MBean的所有属性和操作。
IntrospectionException - 内省时发生异常。
InstanceNotFoundException - 未找到
InstanceNotFoundException的MBean。
ReflectionException - 尝试调用动态MBean的getMBeanInfo时发生异常。
SecurityException - 如果客户端或委托主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生通用通信异常。
RuntimeOperationsException - 包装一个
java.lang.IllegalArgumentException :参数中的对象名称为null。
boolean isInstanceOf(ObjectName name, String className, Subject delegationSubject) throws InstanceNotFoundException, IOException
name - MBean的
ObjectName 。
className - 类的名称。
delegationSubject - 包含
Subject主体的Subject或使用
null的null。
InstanceNotFoundException - 指定的MBean未在MBean服务器中注册。
SecurityException - 如果客户端或委托主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生一般通信异常。
RuntimeOperationsException - 包装
java.lang.IllegalArgumentException :参数中的对象名称为空。
void addNotificationListener(ObjectName name, ObjectName listener, MarshalledObject filter, MarshalledObject handback, Subject delegationSubject) throws InstanceNotFoundException, IOException
MBeanServerConnection.addNotificationListener(ObjectName, ObjectName, NotificationFilter, Object) 。
NotificationFilter参数包装在一个MarshalledObject 。
Object (handback)参数也包裹在一个MarshalledObject 。
name - 应在其上添加侦听器的MBean的名称。
listener - 将处理由注册的MBean发出的通知的侦听器的对象名称。
filter - 过滤器对象,封装成一个MarshalledObject 。
如果过滤器封装在MarshalledObject具有空值,不将滤波处理通知之前进行。
handback - 发送通知时发送到侦听器的上下文,封装到
MarshalledObject 。
delegationSubject - 如果使用
Subject主体,则包含委托主体或
null的Subject。
InstanceNotFoundException - 通知侦听器或通知广播者的MBean名称与任何已注册的MBean不匹配。
RuntimeOperationsException - 包裹一个IllegalArgumentException 。
由listener命名的MBean存在但不实现NotificationListener接口,或name或listener为null。
SecurityException - 如果客户端或委托的主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生通用通信异常。
removeNotificationListener(ObjectName, ObjectName, Subject) ,
removeNotificationListener(ObjectName, ObjectName, MarshalledObject, MarshalledObject, Subject)
void removeNotificationListener(ObjectName name, ObjectName listener, Subject delegationSubject) throws InstanceNotFoundException, ListenerNotFoundException, IOException
name - 应删除侦听器的MBean的名称。
listener - 要删除的侦听器的对象名称。
delegationSubject - 如果使用
Subject主体,则包含委派主体或
null的Subject。
InstanceNotFoundException - 提供的MBean名称与任何已注册的MBean不匹配。
ListenerNotFoundException - 监听器未在MBean中注册。
SecurityException - 如果客户端或委托主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生通用通信异常。
RuntimeOperationsException - 当name或listener为空时,包装IllegalArgumentException 。
addNotificationListener(javax.management.ObjectName, javax.management.ObjectName, java.rmi.MarshalledObject, java.rmi.MarshalledObject, javax.security.auth.Subject)
void removeNotificationListener(ObjectName name, ObjectName listener, MarshalledObject filter, MarshalledObject handback, Subject delegationSubject) throws InstanceNotFoundException, ListenerNotFoundException, IOException
MBeanServerConnection.removeNotificationListener(ObjectName, ObjectName, NotificationFilter, Object) 。
NotificationFilter参数包装在一个MarshalledObject 。
Object参数也包裹在一个MarshalledObject 。
name - 要删除侦听器的MBean的名称。
listener - 以前添加到此MBean的侦听器。
filter - 添加侦听器时指定的过滤器,封装在
MarshalledObject 。
handback - 添加侦听器时指定的
MarshalledObject ,封装在
MarshalledObject 。
delegationSubject - 包含
Subject主体的Subject或使用
null的null。
InstanceNotFoundException - 提供的MBean名称与任何已注册的MBean不匹配。
ListenerNotFoundException - 监听器未在MBean中注册,或者未注册给定过滤器和回传。
SecurityException - 如果客户端或委托主题(如果有的话)没有执行此操作的权限。
IOException - 如果发生通用通信异常。
RuntimeOperationsException -包装一个IllegalArgumentException时name或listener为空。
addNotificationListener(javax.management.ObjectName, javax.management.ObjectName, java.rmi.MarshalledObject, java.rmi.MarshalledObject, javax.security.auth.Subject)
Integer[] addNotificationListeners(ObjectName[] names, MarshalledObject[] filters, Subject[] delegationSubjects) throws InstanceNotFoundException, IOException
注册与给定过滤器匹配的给定MBean的通知。 远程客户端随后可以使用fetchNotifications方法检索通知 。
对于每个听众,原始的NotificationListener和handback保留在客户端; 为了使客户端能够识别它们,服务器生成并返回唯一的listenerID 。 该listenerID与Notifications给远程客户端。
如果给定(名称,过滤器)对中的任何一个无法注册,则操作将失败并发生异常,并且不会注册名称或过滤器。
names -
ObjectNames通知的MBean。
filters -所述的编组表示的阵列NotificationFilters 。
此数组的元素可以为空。
delegationSubjects -所述Subjects代表其被添加的监听器。
此数组的元素可以为空。
此外, delegationSubjects参数本身可以为空,这相当于与names和filters数组大小相同的空值数组。
listenerIDs标识本地听众。
该数组与参数的元素数量相同。
IllegalArgumentException - 如果
names或
filters为空,或者如果
names包含空元素,或者如果三个数组都不具有相同的大小。
ClassCastException - 如果
filters某个元素作为
filters NotificationFilter的非空对象进行
NotificationFilter 。
InstanceNotFoundException -如果一个
names不对应任何已注册的MBean。
SecurityException - 如果对于其中一个MBean,客户端或委托主题(如果有的话)没有权限添加侦听器。
IOException - 如果发生一般通信异常。
void removeNotificationListeners(ObjectName name, Integer[] listenerIDs, Subject delegationSubject) throws InstanceNotFoundException, ListenerNotFoundException, IOException
处理removeNotificationListener(ObjectName, NotificationListener)和removeNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)方法。
此方法从MBean服务器中的给定MBean中删除一个或多个NotificationListener 。
该NotificationListeners是由是由返回的ID标识addNotificationListeners(ObjectName[], MarshalledObject[], Subject[])方法。
name -
ObjectName通知的MBean。
listenerIDs - 与要删除的侦听器相对应的ID的列表。
delegationSubject - 包含
Subject主体的Subject或使用
null的null。
InstanceNotFoundException - 如果给定的
name不对应于任何注册的MBean。
ListenerNotFoundException - 如果在服务器端没有找到其中一个侦听器。
如果MBean由于某种原因丢弃了一个侦听器而不是调用MBeanServer.removeNotificationListener,则可能会发生此MBeanServer.removeNotificationListener 。
SecurityException - 如果客户端或委托的主题(如果有的话)没有删除侦听器的权限。
IOException - 如果发生一般通信异常。
IllegalArgumentException - 如果
ObjectName或
listenerIds为空,或者如果
listenerIds包含空元素。
NotificationResult fetchNotifications(long clientSequenceNumber, int maxNotifications, long timeout) throws IOException
从连接器服务器检索通知。 此方法可以阻止,直到有至少一个通知或直到达到指定的超时。 该方法也可以随时返回零通知。
如果序列号不小于clientSequenceNumber ,并且该客户端已经为生成通知的MBean注册了至少一个监听器,则该结果可以包含在结果中,并具有接受该通知的过滤器。 对通知感兴趣的每个监听器由addNotificationListeners(ObjectName[], MarshalledObject[], Subject[])返回的整数ID标识。
clientSequenceNumber - 客户端
clientSequenceNumber的第一个序列号。如果为负,则将其解释为下一个通知将具有的序列号。
maxNotifications - 返回的不同通知的最大数量。
返回的NotificationResult中的TargetedNotification阵列可以具有比此更多的元素,如果相同的通知多次出现。
如果此参数为负,则该行为是未指定的。
timeout - 等待通知到达的最大时间(毫秒)。
这可以是0表示方法不应该等待,如果没有通知,但应该立即返回。
它可以是Long.MAX_VALUE来表示没有超时。
如果此参数为负,则该行为是未指定的。
NotificationResult 。
IOException - 如果发生一般通信异常。
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.