|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
public interface RMIConnection
RMI 对象,用于将 MBeanServer 请求从客户端转发到其位于服务器端的 MBeanServer 实现。连接到 RMI 连接器的每个远程客户端都有一个实现此接口的 Remote 对象。
用户代码不经常引用此接口。它作为公用 API 的一部分指定,便于该 API 的不同实现之间实现互操作。
为确保用正确的类加载器将客户端参数在服务器端反序列化,客户端参数(例如,用于调用方法的参数)包装在 MarshalledObject 方法中。此接口的实现必须首先获得适用于操作及其目标的适当的类加载器,然后用该类加载器反序列化编组的参数。除非另外说明,MarshalledObject 或 MarshalledObject[] 类型的参数必定不为 null;如果参数为 null,则行为不明确。
有关类加载的内容在 JMX Specification, version 1.4 PDF 文档中进行了详细的描述。
此接口中的多数方法与 MBeanServerConnection 接口中的方法相似。这里未指定方法的行为方面,它与相应的 MBeanServerConnection 方法相同。
| 方法详细信息 |
|---|
String getConnectionId()
throws IOException
返回连接 ID。对于每个到给定的 RMI 连接器服务器的开放连接,此字符串都不相同。
IOException - 如果出现通用通信异常。RMIConnector.connect
void close()
throws IOException
关闭此连接。从此方法返回时,不导出实现此接口的 RMI 对象,因此对它的进一步远程调用将失败。
Closeable 中的 closeIOException - 如果无法关闭连接,或 Remote 对象无法被导出,或者在传输远程关闭请求时出现通信故障。
ObjectInstance createMBean(String className,
ObjectName name,
Subject delegationSubject)
throws ReflectionException,
InstanceAlreadyExistsException,
MBeanRegistrationException,
MBeanException,
NotCompliantMBeanException,
IOException
MBeanServerConnection.createMBean(String, ObjectName) 方法。
className - 要实例化的 MBean 的类名称。name - MBean 的对象名。可以为 null。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
ObjectInstance,它包含新实例化的 MBean 的 ObjectName 和 Java 类名。如果所包含的 ObjectName 为 n,则所包含的 Java 类名为 getMBeanInfo(n).getClassName()。
ReflectionException - 在尝试调用 MBean 的构造方法的过程中出现的、包装了 java.lang.ClassNotFoundException 或 java.lang.Exception 的异常。
InstanceAlreadyExistsException - MBean 已处于 MBean 服务器的控制之下。
MBeanRegistrationException - MBean 的 preRegister (MBeanRegistration 接口)方法已抛出异常。不对 MBean 进行注册。
MBeanException - MBean 的构造方法已抛出异常。
NotCompliantMBeanException - 该类不是一个遵守 JMX 的 MBean。
RuntimeOperationsException - 包装了 java.lang.IllegalArgumentException:className 传入的参数为 null,ObjectName 传入的参数包含模式或未为 MBean 指定任何 ObjectName。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。
ObjectInstance createMBean(String className,
ObjectName name,
ObjectName loaderName,
Subject delegationSubject)
throws ReflectionException,
InstanceAlreadyExistsException,
MBeanRegistrationException,
MBeanException,
NotCompliantMBeanException,
InstanceNotFoundException,
IOException
MBeanServerConnection.createMBean(String, ObjectName, ObjectName) 方法。
className - 要实例化的 MBean 的类名称。name - MBean 的对象名。可以为 null。loaderName - 要使用的类加载器的对象名。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
ObjectInstance,它包含新实例化的 MBean 的 ObjectName 和 Java 类名。如果所包含的 ObjectName 为 n,则所包含的 Java 类名为 getMBeanInfo(n).getClassName()。
ReflectionException - 在尝试调用 MBean 的构造方法的过程中出现的、包装了 java.lang.ClassNotFoundException 或 java.lang.Exception 的异常。
InstanceAlreadyExistsException - MBean 已处于 MBean 服务器的控制之下。
MBeanRegistrationException - MBean 的 preRegister (MBeanRegistration 接口)方法已抛出异常。不对 MBean 进行注册。
MBeanException - MBean 的构造方法已抛出异常。
NotCompliantMBeanException - 该类不是一个遵守 JMX 的 MBean。
InstanceNotFoundException - 指定的类加载器未在 MBean 服务器中注册。
RuntimeOperationsException - 包装了 java.lang.IllegalArgumentException:className 传入的参数为 null,ObjectName 传入的参数包含模式或未为 MBean 指定任何 ObjectName。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
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 中。封装的数组可以为 null,其等效于一个空数组。signature - 包含要调用的构造方法的签名的数组。可以为 null,等效于一个空数组。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
ObjectInstance,它包含新实例化的 MBean 的 ObjectName 和 Java 类名。如果所包含的 ObjectName 为 n,则所包含的 Java 类名为 getMBeanInfo(n).getClassName()。
ReflectionException - 在尝试调用 MBean 的构造方法的过程中出现的、包装了 java.lang.ClassNotFoundException 或 java.lang.Exception 的异常。
InstanceAlreadyExistsException - MBean 已处于 MBean 服务器的控制之下。
MBeanRegistrationException - MBean 的 preRegister (MBeanRegistration 接口)方法已抛出异常。不对 MBean 进行注册。
MBeanException - MBean 的构造方法已抛出异常。
NotCompliantMBeanException - 该类不是一个遵守 JMX 的 MBean。
RuntimeOperationsException - 包装了 java.lang.IllegalArgumentException:className 传入的参数为 null,ObjectName 传入的参数包含一个模式,或未为 MBean 指定任何 ObjectName。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
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 中。封装的数组可以为 null,其等效于一个空数组。signature - 包含要调用的构造方法的签名的数组。可以为 null,等效于一个空数组。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
ObjectInstance,它包含新实例化的 MBean 的 ObjectName 和 Java 类名。如果所包含的 ObjectName 为 n,则所包含的 Java 类名为 getMBeanInfo(n).getClassName()。
ReflectionException - 在尝试调用 MBean 的构造方法的过程中出现的、包装了 java.lang.ClassNotFoundException 或 java.lang.Exception 的异常。
InstanceAlreadyExistsException - MBean 已处于 MBean 服务器的控制之下。
MBeanRegistrationException - MBean 的 preRegister (MBeanRegistration 接口)方法已抛出异常。不对 MBean 进行注册。
MBeanException - MBean 的构造方法已抛出异常。
NotCompliantMBeanException - 该类不是一个遵守 JMX 的 MBean。
InstanceNotFoundException - 指定的类加载器未在 MBean 服务器中注册。
RuntimeOperationsException - 包装了 java.lang.IllegalArgumentException:className 传入的参数为 null,ObjectName 传入的参数包含一个模式,或未为 MBean 指定任何 ObjectName。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。
void unregisterMBean(ObjectName name,
Subject delegationSubject)
throws InstanceNotFoundException,
MBeanRegistrationException,
IOException
MBeanServerConnection.unregisterMBean(ObjectName) 方法。
name - 要注册的 MBean 的对象名。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
InstanceNotFoundException - 指定的 MBean 未在 MBean 服务器中注册。
MBeanRegistrationException - MBean 的 preDeregister (MBeanRegistration 接口)方法已抛出异常。
RuntimeOperationsException - 包装了 java.lang.IllegalArgumentException:参数中的对象名为 null 或您尝试注销的 MBean 为 MBeanServerDelegate MBean。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。
ObjectInstance getObjectInstance(ObjectName name,
Subject delegationSubject)
throws InstanceNotFoundException,
IOException
MBeanServerConnection.getObjectInstance(ObjectName) 方法。
name - MBean 的对象名。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
ObjectInstance。所包含的 ObjectName 为 name,所包含的类名称为 getMBeanInfo(name).getClassName()。
InstanceNotFoundException - 指定的 MBean 未在 MBean 服务器中注册。
RuntimeOperationsException - 包装了 java.lang.IllegalArgumentException:参数中的对象名为 null。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
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 封装了一个 null 值,则选择 MBean 时不使用任何查询表达式。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
ObjectInstance 对象集。如果没有任何 MBean 满足此查询,则返回一个空列表。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
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 封装了一个 null 值,则选择 MBean 时不使用任何查询表达式。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。
boolean isRegistered(ObjectName name,
Subject delegationSubject)
throws IOException
MBeanServerConnection.isRegistered(ObjectName) 方法。
name - 要检查的 MBean 的对象名。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
RuntimeOperationsException - 包装了 java.lang.IllegalArgumentException:参数中的对象名为 null。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。
Integer getMBeanCount(Subject delegationSubject)
throws IOException
MBeanServerConnection.getMBeanCount() 方法。
delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。
Object getAttribute(ObjectName name,
String attribute,
Subject delegationSubject)
throws MBeanException,
AttributeNotFoundException,
InstanceNotFoundException,
ReflectionException,
IOException
MBeanServerConnection.getAttribute(ObjectName, String) 方法。
name - 将要从其检索属性的 MBean 的对象名。attribute - 指定要检索的属性名称的字符串。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
AttributeNotFoundException - 指定的属性在 MBean 中无法访问。
MBeanException - 包装了由 MBean 的获取方法抛出的异常。
InstanceNotFoundException - 指定的 MBean 未在 MBean 服务器中注册。
ReflectionException - 包装了尝试调用获取方法时抛出的 java.lang.Exception。
RuntimeOperationsException - 包装了 java.lang.IllegalArgumentException:参数中的对象名为 null,或参数中的属性为 null。
RuntimeMBeanException - 包装了由 MBean 的获取方法抛出的运行时异常。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。setAttribute(javax.management.ObjectName, java.rmi.MarshalledObject, javax.security.auth.Subject)
AttributeList getAttributes(ObjectName name,
String[] attributes,
Subject delegationSubject)
throws InstanceNotFoundException,
ReflectionException,
IOException
MBeanServerConnection.getAttributes(ObjectName, String[]) 方法。
name - 从其检索属性的 MBean 的对象名。attributes - 要检索的属性的列表。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
InstanceNotFoundException - 指定的 MBean 未在 MBean 服务器中注册。
ReflectionException - 尝试调用 Dynamic MBean 的 getAttributes 方法时出现的异常。
RuntimeOperationsException - 包装了 java.lang.IllegalArgumentException:参数中的对象名为 null,或参数中的属性为 null。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
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 - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
InstanceNotFoundException - 指定的 MBean 未在 MBean 服务器中注册。
AttributeNotFoundException - 指定的属性在 MBean 中无法访问。
InvalidAttributeValueException - 为属性指定的值无效。
MBeanException - 包装了由 MBean 的设置方法抛出的异常。
ReflectionException - 包装了尝试调用设置方法时抛出的 java.lang.Exception。
RuntimeOperationsException - 包装了 java.lang.IllegalArgumentException:参数中的对象名为 null,或参数中的属性为 null。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
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 - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
InstanceNotFoundException - 指定的 MBean 未在 MBean 服务器中注册。
ReflectionException - 尝试调用 Dynamic MBean 的 getAttributes 方法时出现的异常。
RuntimeOperationsException - 包装了 java.lang.IllegalArgumentException:参数中的对象名为 null,或参数中的属性为 null。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
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 中。封装的数组可以为 null,其等效于一个空数组。signature - 包含操作的签名的数组。该类对象将使用与加载在其上调用了操作的 MBean 过程中所用的相同的类加载器加载。可以为 null,等效于一个空数组。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
InstanceNotFoundException - 指定的 MBean 未在 MBean 服务器中注册。
MBeanException - 包装了由 MBean 的调用的方法抛出的异常。
ReflectionException - 包装了尝试调用此方法时抛出的 java.lang.Exception。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。
RuntimeOperationsException - 包装了 name 或 operationName 为 null 时抛出的 IllegalArgumentException。
String getDefaultDomain(Subject delegationSubject)
throws IOException
MBeanServerConnection.getDefaultDomain() 方法。
delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。
String[] getDomains(Subject delegationSubject)
throws IOException
MBeanServerConnection.getDomains() 方法。
delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。
MBeanInfo getMBeanInfo(ObjectName name,
Subject delegationSubject)
throws InstanceNotFoundException,
IntrospectionException,
ReflectionException,
IOException
MBeanServerConnection.getMBeanInfo(ObjectName) 方法。
name - 要分析的 MBean 的名称delegationSubject - 包含委托 principal 的 Subject,如果使用了验证委托 principal,则为 null。
MBeanInfo 的实例。
IntrospectionException - 自行推算过程中出现的异常。
InstanceNotFoundException - 未找到指定的 MBean。
ReflectionException - 尝试调用 Dynamic MBean 的 getMBeanInfo 方法时出现的异常。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。
RuntimeOperationsException - 包装了 java.lang.IllegalArgumentException:参数中的对象名为 null。
boolean isInstanceOf(ObjectName name,
String className,
Subject delegationSubject)
throws InstanceNotFoundException,
IOException
MBeanServerConnection.isInstanceOf(ObjectName, String) 方法。
name - MBean 的 ObjectName。className - 类的名称。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
InstanceNotFoundException - 指定的 MBean 未在 MBean 服务器中注册。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。
RuntimeOperationsException - 包装了 java.lang.IllegalArgumentException:参数中的对象名为 null。
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 中的过滤器的值为 null,则在对通知处理之前不执行任何过滤。handback - 通知发出时发送到侦听器的上下文,封装在 MarshalledObject 中。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
InstanceNotFoundException - 通知侦听器或通知广播器的 MBean 名称不与注册的任何 MBean 匹配。
RuntimeOperationsException - 包装了 IllegalArgumentException。存在由 listener 命名的 MBean,但它并不实现 NotificationListener 接口,或者 name 或 listener 为 null。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。removeNotificationListener(ObjectName, ObjectName, Subject),
removeNotificationListener(ObjectName, ObjectName, MarshalledObject, MarshalledObject, Subject)
void removeNotificationListener(ObjectName name,
ObjectName listener,
Subject delegationSubject)
throws InstanceNotFoundException,
ListenerNotFoundException,
IOException
MBeanServerConnection.removeNotificationListener(ObjectName, ObjectName) 方法。
name - 应在其上移除侦听器的 MBean 的名称。listener - 要移除的侦听器的对象名。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
InstanceNotFoundException - 所提供的 MBean 名称不与任何已注册 MBean 匹配。
ListenerNotFoundException - 侦听器未在 MBean 中注册。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。
RuntimeOperationsException - 当 name 或 listener 为 null 时包装了 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 - 添加侦听器时指定的 handback,它封装在 MarshalledObject 中。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
InstanceNotFoundException - 所提供的 MBean 名称不与任何已注册 MBean 匹配。
ListenerNotFoundException - 侦听器未在 MBean 中注册,或者未用给定的过滤器和 handback 注册。
SecurityException - 如果客户端或委托的 Subject(如果有)没有执行此操作的权限。
IOException - 如果出现通用通信异常。
RuntimeOperationsException - 当 name 或 listener 为 null 时包装了 IllegalArgumentException。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 一起转发到远程客户端。
如果给定 (name, filter) 对中有任何一对无法注册,则操作失败并抛出异常,不注册任何名称或过滤器。
names - 标识发出 Notification 的 MBean 的 ObjectNames。filters - NotificationFilters 的编组表示形式的数组。此数组的元素可以为 null。delegationSubjects - 侦听器代表其添加的 Subjects。此数组的元素可以为 null。同样,delegationSubjects 参数本身可以为 null,它表示具有 null 值的数组,数组大小与 names 和 filters 数组大小相同。
listenerIDs 数组。此数组具有与参数个数相同的元素数。
IllegalArgumentException - 如果 names 或 filters 为 null,或者 names 包含 null 元素,或者三个数组的大小不相同。
ClassCastException - 如果 filters 中有一个元素解组为不是 NotificationFilter 的非 null 对象。
InstanceNotFoundException - 如果 names 中有一个不与任何已注册的 MBean 对应。
SecurityException - 如果 MBean 之一、客户端或委托的 Subject(如果有)无权添加侦听器。
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 通过从 addNotificationListeners(ObjectName[], MarshalledObject[], Subject[]) 方法返回的 ID 标识。
name - 标识发出 Notification 的 MBean 的 ObjectName。listenerIDs - 与要移除的侦听器对应的 ID。delegationSubject - 包含委托 principal 的 Subject,如果使用了验证 principal,则为 null。
InstanceNotFoundException - 如果给定的 name 不对应任何已注册的 MBean。
ListenerNotFoundException - 如果有一个侦听器在服务器端无法找到。当 MBean 出于某种原因丢弃了一个侦听器,而未通过调用 MBeanServer.removeNotificationListener 丢弃时,出现该异常。
SecurityException - 如果客户端或委托的 Subject(如果有)没有移除侦听器的权限。
IOException - 如果出现通用通信异常。
IllegalArgumentException - 如果 ObjectName 或 listenerIds 为 null,或者 listenerIds 包含一个 null 元素。
NotificationResult fetchNotifications(long clientSequenceNumber,
int maxNotifications,
long timeout)
throws IOException
检索来自连接器服务器的通知。该方法可能阻塞,直到至少有一个通知,或者直到达到指定的超时时间。该方法还可在任何时间返回零通知。
如果通知的序列号不小于 clientSequenceNumber,并且此客户端已为 MBean 生成通知至少注册了一个侦听器(带一个接收通知的过滤器),则通知可包含在该结果中。对通知感兴趣的各侦听器由从 addNotificationListeners(ObjectName[], MarshalledObject[], Subject[]) 返回的整数型 ID 标识。
clientSequenceNumber - 客户端感兴趣的第一个序列号。如果为负,它表示下一个通知将具有的序列号。maxNotifications - 返回的不同通知的最大数。如果同一个通知出现了多次,则返回的 NotificationResult 中的 TargetedNotification 数组可能包含比此数更多的元素。如果该参数为负,则行为不明确。timeout - 等待通知到达的最长时间,以毫秒为单位。它可以是 0,指示在无通知时该方法不应等待,而应立即返回。它可以为 Long.MAX_VALUE,指示无超时。如果该参数为负,则行为不明确。
NotificationResult。
IOException - 如果出现通用通信异常。
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。