public interface MBeanServerConnection
MBeanServer
接口,代表本地MBean服务器,扩展接口。
Modifier and Type | Method and Description |
---|---|
void |
addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
添加一个监听器注册MBean。
|
void |
addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)
添加一个监听器注册MBean。
|
ObjectInstance |
createMBean(String className, ObjectName name)
实例化和注册在MBean服务器的MBean。
|
ObjectInstance |
createMBean(String className, ObjectName name, Object[] params, String[] signature)
实例化和注册在MBean服务器的MBean。
|
ObjectInstance |
createMBean(String className, ObjectName name, ObjectName loaderName)
实例化和注册在MBean服务器的MBean。
|
ObjectInstance |
createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature)
实例化和注册在MBean服务器的MBean。
|
Object |
getAttribute(ObjectName name, String attribute)
获取一个名为MBean的特定属性的值。
|
AttributeList |
getAttributes(ObjectName name, String[] attributes)
获取一个名为MBean的几个属性的值。
|
String |
getDefaultDomain()
返回用于命名的MBean默认域。
|
String[] |
getDomains()
返回内任何MBean目前注册名单。
|
Integer |
getMBeanCount()
返回在MBean服务器注册MBean的数量。
|
MBeanInfo |
getMBeanInfo(ObjectName name)
这种方法发现MBean公开管理的属性和操作。
|
ObjectInstance |
getObjectInstance(ObjectName name)
获取一个给定的MBean的MBean服务器注册的
ObjectInstance 。
|
Object |
invoke(ObjectName name, String operationName, Object[] params, String[] signature)
调用MBean操作。
|
boolean |
isInstanceOf(ObjectName name, String className)
如果指定的MBean是指定类的实例返回true,否则为false。
|
boolean |
isRegistered(ObjectName name)
检查是否一个MBean,其对象的姓名,已经与MBean服务器注册。
|
Set<ObjectInstance> |
queryMBeans(ObjectName name, QueryExp query)
通过MBean服务器控制的MBeans。
|
Set<ObjectName> |
queryNames(ObjectName name, QueryExp query)
获取由MBean服务器控制的MBean的名字。
|
void |
removeNotificationListener(ObjectName name, NotificationListener listener)
从注册MBean移除侦听器。
|
void |
removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
从注册MBean移除侦听器。
|
void |
removeNotificationListener(ObjectName name, ObjectName listener)
从注册MBean移除侦听器。
|
void |
removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)
从注册MBean移除侦听器。
|
void |
setAttribute(ObjectName name, Attribute attribute)
套一个名叫MBean的特定属性的值。
|
AttributeList |
setAttributes(ObjectName name, AttributeList attributes)
套一名叫MBean的几个属性的值。
|
void |
unregisterMBean(ObjectName name)
将从MBean服务器MBean。
|
ObjectInstance createMBean(String className, ObjectName name) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOException
实例化和注册在MBean服务器的MBean。MBean服务器将使用其Default Loader Repository
加载MBean类。对象名称与MBean相关。如果对象名是无效的,必须通过实施MBeanRegistration
MBean接口和从preRegister
方法返回的名称提供它自己的名字。
这种方法相当于createMBean(className, name, (Object[]) null, (String[]) null)
。
className
要实例化MBean类名称。
name
- MBean对象名称。可能是空的。
ObjectInstance
,含有
ObjectName
和新实例化MBean的java类的名称。如果有
ObjectName
是
n
,包含java类的名字是
getMBeanInfo(n)
.getClassName()
。
ReflectionException
-包装
java.lang.ClassNotFoundException
或
java.lang.Exception
时试图调用MBean的构造函数。
InstanceAlreadyExistsException
的MBean已经是MBean服务器的控制下。
MBeanRegistrationException
-
preRegister
(
MBeanRegistration
接口)的MBean方法抛出异常。MBean将不予注册。
RuntimeMBeanException
如果MBean的构造函数或其
preRegister
或
postRegister
方法抛出一个
RuntimeException
。如果
postRegister
(
MBeanRegistration
接口)的MBean方法抛出一个
RuntimeException
,的
createMBean
方法将抛出一个
RuntimeMBeanException
,虽然MBean的创建和注册成功。在这种情况下,MBean将实际上注册即使
createMBean
方法抛出一个异常。注意,
RuntimeMBeanException
也可以被
preRegister
,在这种情况下,MBean将不予注册。
RuntimeErrorException
-如果
postRegister
(
MBeanRegistration
接口)的MBean方法抛出的
Error
,
createMBean
方法将抛出一个
RuntimeErrorException
,虽然MBean的创建和注册成功。在这种情况下,MBean将实际上注册即使
createMBean
方法抛出一个异常。注意,
RuntimeErrorException
也可以被
preRegister
,在这种情况下,MBean将不予注册。
MBeanException
- MBean构造函数抛出了一个异常
NotCompliantMBeanException
这类不符合JMX MBean
RuntimeOperationsException
-包装
java.lang.IllegalArgumentException
:类名传入的参数为空,
ObjectName
传入的参数包含模式或没有
ObjectName
是MBean指定。
IOException
-沟通问题发生到MBean服务器交谈时。
MBeanRegistration
ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException
实例化和注册在MBean服务器的MBean。要使用的类装载器是由它的对象名称标识的。对象名称与MBean相关。如果Loader对象名称是无效的,该类加载器加载的MBean服务器将使用。如果MBean的对象名是无效的,必须通过实施MBeanRegistration
MBean接口和从preRegister
方法返回的名称提供它自己的名字。
这种方法相当于createMBean(className, name, loaderName, (Object[]) null, (String[]) null)
。
className
- MBean类名称被实例化。
name
- MBean对象名称。可能是空的。
loaderName
-类加载器对象的名字被使用。
ObjectInstance
,含有
ObjectName
和新实例化MBean的java类的名称。如果有
ObjectName
是
n
,包含java类的名字是
getMBeanInfo(n)
.getClassName()
。
ReflectionException
-包装
java.lang.ClassNotFoundException
或
java.lang.Exception
时试图调用MBean的构造函数。
InstanceAlreadyExistsException
的MBean已经是MBean服务器的控制下。
MBeanRegistrationException
-
preRegister
(
MBeanRegistration
接口)的MBean方法抛出异常。MBean将不予注册。
RuntimeMBeanException
如果MBean的构造函数或其
preRegister
或
postRegister
方法抛出一个
RuntimeException
。如果
postRegister
(
MBeanRegistration
接口)的MBean方法抛出一个
RuntimeException
,的
createMBean
方法将抛出一个
RuntimeMBeanException
,虽然MBean的创建和注册成功。在这种情况下,MBean将实际上注册即使
createMBean
方法抛出一个异常。注意,
RuntimeMBeanException
也可以被
preRegister
,在这种情况下,MBean将不予注册。
RuntimeErrorException
-如果
postRegister
(
MBeanRegistration
接口)的MBean方法抛出的
Error
,
createMBean
方法将抛出一个
RuntimeErrorException
,虽然MBean的创建和注册成功。在这种情况下,MBean将实际上注册即使
createMBean
方法抛出一个异常。注意,
RuntimeErrorException
也可以被
preRegister
,在这种情况下,MBean将不予注册。
MBeanException
- MBean构造函数抛出了一个异常
NotCompliantMBeanException
这类不符合JMX MBean
InstanceNotFoundException
-指定的类装载器是不是在MBean服务器注册。
RuntimeOperationsException
-包装
java.lang.IllegalArgumentException
:类名传入的参数为空,
ObjectName
传入的参数包含模式或没有
ObjectName
是MBean指定。
IOException
-沟通问题发生到MBean服务器交谈时。
MBeanRegistration
ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOException
Default Loader Repository
加载MBean类。对象名称与MBean相关。如果对象名是无效的,必须通过实施
MBeanRegistration
MBean接口和从
preRegister
方法返回的名称提供它自己的名字。
className
- MBean类名称被实例化。
name
- MBean对象名称。可能是空的。
params
-数组包含要调用的构造函数的参数。
signature
-数组包含要调用构造函数的签名。
ObjectInstance
,含有
ObjectName
和新实例化MBean的java类的名称。如果有
ObjectName
是
n
,包含java类的名字是
getMBeanInfo(n)
.getClassName()
。
ReflectionException
-包装
java.lang.ClassNotFoundException
或
java.lang.Exception
时试图调用MBean的构造函数。
InstanceAlreadyExistsException
的MBean已经是MBean服务器的控制下。
MBeanRegistrationException
-
preRegister
(
MBeanRegistration
接口)的MBean方法抛出异常。MBean将不予注册。
RuntimeMBeanException
如果MBean的构造函数或其
preRegister
或
postRegister
方法抛出一个
RuntimeException
。如果
postRegister
(
MBeanRegistration
接口)的MBean方法抛出一个
RuntimeException
,的
createMBean
方法将抛出一个
RuntimeMBeanException
,虽然MBean的创建和注册成功。在这种情况下,MBean将实际上注册即使
createMBean
方法抛出一个异常。注意,
RuntimeMBeanException
也可以被
preRegister
,在这种情况下,MBean将不予注册。
RuntimeErrorException
-如果
postRegister
(
MBeanRegistration
接口)的MBean方法抛出的
Error
,
createMBean
方法将抛出一个
RuntimeErrorException
,虽然MBean的创建和注册成功。在这种情况下,MBean将实际上注册即使
createMBean
方法抛出一个异常。注意,
RuntimeErrorException
也可以被
preRegister
,在这种情况下,MBean将不予注册。
MBeanException
- MBean构造函数抛出了一个异常
NotCompliantMBeanException
这类不符合JMX MBean
RuntimeOperationsException
-包装
java.lang.IllegalArgumentException
:类名传入的参数为空,
ObjectName
传入的参数包含模式或没有
ObjectName
是MBean指定。
IOException
-沟通问题发生到MBean服务器交谈时。
MBeanRegistration
ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException
实例化和注册在MBean服务器的MBean。要使用的类装载器是由它的对象名称标识的。对象名称与MBean相关。如果未指定的加载对象的名称,该类加载器加载的MBean服务器将使用。如果MBean对象名是无效的,必须通过实施MBeanRegistration
MBean接口和从preRegister
方法返回的名称提供它自己的名字。
className
- MBean类名称被实例化。
name
- MBean对象名称。可能是空的。
params
-数组包含要调用的构造函数的参数。
signature
-数组包含要调用构造函数的签名。
loaderName
-类加载器对象的名字被使用。
ObjectInstance
,含有
ObjectName
和新实例化MBean的java类的名称。如果有
ObjectName
是
n
,包含java类的名字是
getMBeanInfo(n)
.getClassName()
。
ReflectionException
-包装
java.lang.ClassNotFoundException
或
java.lang.Exception
时试图调用MBean的构造函数。
InstanceAlreadyExistsException
的MBean已经是MBean服务器的控制下。
MBeanRegistrationException
-
preRegister
(
MBeanRegistration
接口)的MBean方法抛出异常。MBean将不予注册。
RuntimeMBeanException
的MBean的构造函数或其
preRegister
或
postRegister
方法抛出一个
RuntimeException
。如果
postRegister
(
MBeanRegistration
接口)的MBean方法抛出一个
RuntimeException
,的
createMBean
方法将抛出一个
RuntimeMBeanException
,虽然MBean的创建和注册成功。在这种情况下,MBean将实际上注册即使
createMBean
方法抛出一个异常。注意,
RuntimeMBeanException
也可以被
preRegister
,在这种情况下,MBean将不予注册。
RuntimeErrorException
-如果
postRegister
方法(
MBeanRegistration
接口)的MBean方法抛出的
Error
,
createMBean
方法将抛出一个
RuntimeErrorException
,虽然MBean的创建和注册成功。在这种情况下,MBean将实际上注册即使
createMBean
方法抛出一个异常。注意,
RuntimeErrorException
也可以被
preRegister
,在这种情况下,MBean将不予注册。
MBeanException
- MBean构造函数抛出了一个异常
NotCompliantMBeanException
这类不符合JMX MBean
InstanceNotFoundException
-指定的类装载器是不是在MBean服务器注册。
RuntimeOperationsException
-包装
java.lang.IllegalArgumentException
:类名传入的参数为空,
ObjectName
传入的参数包含模式或没有
ObjectName
是MBean指定。
IOException
-沟通问题发生到MBean服务器交谈时。
MBeanRegistration
void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException, IOException
name
- MBean对象名称未登记。
InstanceNotFoundException
的MBean指定不在MBean服务器注册。
MBeanRegistrationException
- prederegister((
MBeanRegistration
接口)的MBean方法抛出异常。
RuntimeMBeanException
-如果
postDeregister
(
MBeanRegistration
接口)的MBean方法抛出一个
RuntimeException
,的
unregisterMBean
方法将抛出一个
RuntimeMBeanException
,虽然MBean注销成功。在这种情况下,MBean将实际上未注册即使
unregisterMBean
方法抛出一个异常。注意,
RuntimeMBeanException
也可以被
preDeregister
,在这种情况下,MBean将保持注册。
RuntimeErrorException
-如果
postDeregister
(
MBeanRegistration
接口)的MBean方法抛出的
Error
,
unregisterMBean
方法将抛出一个
RuntimeErrorException
,虽然MBean注销成功。在这种情况下,MBean将实际上未注册即使
unregisterMBean
方法抛出一个异常。注意,
RuntimeMBeanException
也可以被
preDeregister
,在这种情况下,MBean将保持注册。
RuntimeOperationsException
-包装
java.lang.IllegalArgumentException
:参数对象名称为空或MBean当你试图注销是
MBeanServerDelegate
MBean。
IOException
-沟通问题发生到MBean服务器交谈时。
MBeanRegistration
ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException, IOException
ObjectInstance
。
name
- MBean对象名称。
ObjectInstance
。所含的
ObjectName
是
name
和包含的类的名字是
getMBeanInfo(name)
.getClassName()
。
InstanceNotFoundException
的MBean指定不在MBean服务器注册。
IOException
-沟通问题发生到MBean服务器交谈时。
Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query) throws IOException
ObjectName
和/或查询表达式匹配指定的MBean,特定的MBean。当对象名称为空或没有域和键属性被指定时,所有对象都将被选择(如果指定了查询)。它返回
ObjectInstance
对象集(含
ObjectName
和java类的名称)为选定的MBeans。
name
-对象名称模式识别的MBean进行检索。如果为空或没有域和关键属性被指定,所有MBeans注册将被收回。
query
-查询表达式适用于选择MBeans。如果没有查询表达式将用于选择MBeans。
ObjectInstance
MBeans。如果没有MBean满足查询,则返回一个空列表。
IOException
-沟通问题发生到MBean服务器交谈时。
Set<ObjectName> queryNames(ObjectName name, QueryExp query) throws IOException
ObjectName
和/或查询表达式匹配指定的MBean的名字,一个特定的MBean名(相当于测试是否一个MBean注册)。当对象名称为空或没有域和键属性被指定时,所有对象都被选择(如果指定了查询)。它返回的MBeans选择objectnames集。
name
-对象名称模式识别的MBean名进行检索。如果为空或没有域和关键属性被指定,所有注册MBean的名字将被收回。
query
-查询表达式适用于选择MBeans。如果没有查询表达式将用于选择MBeans。
IOException
-沟通问题发生到MBean服务器交谈时。
boolean isRegistered(ObjectName name) throws IOException
name
- MBean对象名称进行检查。
RuntimeOperationsException
-包装
java.lang.IllegalArgumentException
:参数对象名称为空。
IOException
-沟通问题发生到MBean服务器交谈时。
Integer getMBeanCount() throws IOException
IOException
-沟通问题发生到MBean服务器交谈时。
Object getAttribute(ObjectName name, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException, IOException
name
-对象名称的MBean的属性进行检索。
attribute
-指定要检索的属性的名称。
AttributeNotFoundException
-属性中指定的MBean无法访问。
MBeanException
包例外MBean的吸气剂扔。
InstanceNotFoundException
的MBean指定不在MBean服务器注册。
ReflectionException
-包装
java.lang.Exception
扔在试图调用setter。
RuntimeOperationsException
-包装
java.lang.IllegalArgumentException
:参数对象名称参数为空或属性为空。
IOException
-沟通问题发生到MBean服务器交谈时。
setAttribute(javax.management.ObjectName, javax.management.Attribute)
AttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, ReflectionException, IOException
获取一个名为MBean的几个属性的值。MBean的对象名称标识。
如果一个或多个属性不能被检索,因为某些原因,他们将从返回的AttributeList
略。来电者应该检查列表的大小为attributes
阵列相同。发现什么问题,防止从一个给定的检索属性,该属性getAttribute
电话。
这里是调用此方法的一个示例,并检查它成功地检索所有请求的属性:
字符串attrnames = []…;AttributeList列表= mbeanserverconnection getattributes(对象,attrnames);如果(列表。size() = = attrnames。长度)系统的输入(“所有属性检索成功”);别的{List<String>
失踪=新ArrayList<String>
(Arrays.asList
(attrnames));为(属性:列表。aslist())删除(A. getname())失踪;系统的输入(“没有检索:“+失踪);}
name
-对象名称的MBean,检索的属性。
attributes
-目录的属性进行检索。
InstanceNotFoundException
的MBean指定不在MBean服务器注册。
ReflectionException
-例外发生在试图调用一个动态MBean的getattributes方法。
RuntimeOperationsException
包装一
java.lang.IllegalArgumentException
:参数对象名称参数为空或属性为空。
IOException
-沟通问题发生到MBean服务器交谈时。
setAttributes(javax.management.ObjectName, javax.management.AttributeList)
void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException, IOException
name
- MBean的属性可以设置名称。
attribute
-属性要设置的识别和可设置的值。
InstanceNotFoundException
的MBean指定不在MBean服务器注册。
AttributeNotFoundException
-属性中指定的MBean无法访问。
InvalidAttributeValueException
为属性指定的值无效。
MBeanException
包例外MBean的setter抛出。
ReflectionException
-包装
java.lang.Exception
扔在试图调用setter。
RuntimeOperationsException
-包装
java.lang.IllegalArgumentException
:参数对象名称参数为空或属性为空。
IOException
-沟通问题发生到MBean服务器交谈时。
getAttribute(javax.management.ObjectName, java.lang.String)
AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException, IOException
套一名叫MBean的几个属性的值。MBean的对象名称标识。
如果一个或多个属性不能被设置,因为某些原因,他们将从返回的AttributeList
略。调用者应该检查输入AttributeList
大小作为输出相同。发现什么问题,防止从一个给定的检索属性,通常可以称为属性setAttribute
,虽然这是没有保证的工作。(例如,两个属性的值可能被拒绝,因为它们是彼此不一致的。设置其中一个可能是允许的。
这里是调用此方法的一个示例,并检查它成功地设置了所有请求的属性:
AttributeList inputattrs =…;outputattrs AttributeList mbeanserverconnection setattributes(=。对象,inputattrs);如果(inputattrs。size() = = outputattrs。size())系统的输入(“所有属性设置成功”);别的{ List<String>
失踪=新z-d158e3b2-b994-4021-8771- c42e651afdbc();为(属性:inputattrs。aslist())添加(A getname())失踪;为(属性:outputattrs。aslist())删除(A. getname())失踪;系统的输入(“没有设置:“+失踪);}
name
-对象名称的MBean的属性来设置。
attributes
-目录属性:属性的识别是集和它们的值被设置为。
InstanceNotFoundException
的MBean指定不在MBean服务器注册。
ReflectionException
-例外发生在试图调用一个动态MBean的getattributes方法。
RuntimeOperationsException
-包装
java.lang.IllegalArgumentException
:参数对象名称参数为空或属性为空。
IOException
-沟通问题发生到MBean服务器交谈时。
getAttributes(javax.management.ObjectName, java.lang.String[])
Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException, IOException
调用MBean操作。
因为一个signature
分化可能超载操作的需要,这是很简单的调用操作尽可能通过MBean proxy。例如,假设你有一个标准的MBean接口这样:
FooMBean的公共接口{public int countmatches(字符串[ ]模式,布尔忽略大小写);}
的countMatches
操作可以调用如下:
字符串mypatterns = []…;int数=(整数)mbeanserverconnection调用(。对象,“countmatches”,新的对象[ ] { mypatterns,真},新的字符串的字符串[ ] [ ] {。类。getname(),布尔。类getname() });
或者,它可以通过一个代理调用如下:
字符串mypatterns = []…;foombean fooproxy = JMX。newmbeanproxy(mbeanserverconnection、对象、FooMBean类);int数= fooproxy countmatches(mypatterns,真的);
name
-对象名称的MBean的方法被调用。
operationName
-操作的名称被调用。
params
-一个数组包含的参数设置操作时调用
signature
-一个数组包含操作的签名,通过
Class.getName()
返回格式中的类名称的数组。该类的对象将使用相同的类装载器是用于装载MBean操作的调用加载。
InstanceNotFoundException
的MBean指定不在MBean服务器注册。
MBeanException
包例外MBean的方法被调用。
ReflectionException
-包装
java.lang.Exception
扔在试图调用的方法。
IOException
-沟通问题发生到MBean服务器交谈时。
String getDefaultDomain() throws IOException
IOException
-沟通问题发生到MBean服务器交谈时。
String[] getDomains() throws IOException
返回内任何MBean目前注册名单。一个字符串中返回的数组的当且仅当至少有一个MBean的对象的getDomain()
等于字符串注册。返回数组中的字符串的顺序没有定义。
IOException
-沟通问题发生到MBean服务器交谈时。
void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, IOException
添加一个监听器注册MBean。通过MBean发出的通知将被转发给听众。
name
-名称的MBean的听众应该增加。
listener
-监听器对象将处理由注册MBean发出的通知。
filter
-滤波对象。如果过滤器为空,则在处理通知之前没有进行过滤。
handback
-上下文被发送到听者的通知时发出的。
InstanceNotFoundException
的MBean提供的名称不符合任何注册MBean。
IOException
-沟通问题发生到MBean服务器交谈时。
removeNotificationListener(ObjectName, NotificationListener)
,
removeNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)
void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, IOException
添加一个监听器注册MBean。
一个由MBean发出的通知将被转发给听者的MBeanServer。如果源的通知是一个MBean对象MBean服务器将取代了MBean的对象。否则源是不变的。
接收通知的侦听器对象是在该方法被调用时注册的一个给定名称的一个。即使它随后未注册,它将继续接收通知。
name
-名称的MBean的听众应该增加。
listener
-监听器将处理由注册MBean发出的通知对象的名称。
filter
-滤波对象。如果过滤器为空,则在处理通知之前没有进行过滤。
handback
-上下文被发送到听者的通知时发出的。
InstanceNotFoundException
-通知监听器MBean名或通知广播员不符合任何注册MBean。
RuntimeOperationsException
-包装
IllegalArgumentException
。MBean的命名
listener
存在但没有实施
NotificationListener
接口。
IOException
-沟通问题发生到MBean服务器交谈时。
removeNotificationListener(ObjectName, ObjectName)
,
removeNotificationListener(ObjectName, ObjectName, NotificationFilter, Object)
void removeNotificationListener(ObjectName name, ObjectName listener) throws InstanceNotFoundException, ListenerNotFoundException, IOException
如果监听器注册超过一次,也许不同的过滤器或回调,这一方法将删除所有的注册。
name
-名称的MBean的听众应该被删除。
listener
-监听器对象名称被删除。
InstanceNotFoundException
-提供MBean名不匹配任何已注册的MBean。
ListenerNotFoundException
-听者不在MBean注册。
IOException
-沟通问题发生到MBean服务器交谈时。
addNotificationListener(ObjectName, ObjectName, NotificationFilter, Object)
void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException, IOException
从注册MBean移除侦听器。
MBean必须完全匹配listener
听众了,filter
,和handback
参数。如果有多于一个这样的侦听器,只有一个被删除。
的filter
和handback
参数可以为null,如果他们在听众被删除是空的。
name
-名称的MBean的听众应该被删除。
listener
-监听器对象名称被删除。
filter
-过滤器,当你添加指定的。
handback
-盖印,指定当听众加入。
InstanceNotFoundException
的MBean提供的名称不符合任何注册MBean。
ListenerNotFoundException
-听者不在MBean注册,或不与给定的滤波器和盖印注册。
IOException
-沟通问题发生到MBean服务器交谈时。
addNotificationListener(ObjectName, ObjectName, NotificationFilter, Object)
void removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException, IOException
从注册MBean移除侦听器。
如果监听器注册超过一次,也许不同的过滤器或回调,这一方法将删除所有的注册。
name
-名称的MBean的听众应该被删除。
listener
-听者被删除。
InstanceNotFoundException
的MBean提供的名称不符合任何注册MBean。
ListenerNotFoundException
-听者不在MBean注册。
IOException
-沟通问题发生到MBean服务器交谈时。
addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)
void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException, IOException
从注册MBean移除侦听器。
MBean必须完全匹配listener
听众了,filter
,和handback
参数。如果有多于一个这样的侦听器,只有一个被删除。
的filter
和handback
参数可以为null,如果他们在听众被删除是空的。
name
-名称的MBean的听众应该被删除。
listener
-听者被删除。
filter
-过滤器,当你添加指定的。
handback
-盖印,指定当听众加入。
InstanceNotFoundException
的MBean提供的名称不符合任何注册MBean。
ListenerNotFoundException
-听者不在MBean注册,或不与给定的滤波器和盖印注册。
IOException
-沟通问题发生到MBean服务器交谈时。
addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)
MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException
name
- MBean名分析
MBeanInfo
允许这个MBean的所有属性和操作的检索实例。
IntrospectionException
-例外发生在反思。
InstanceNotFoundException
-没有发现指定的MBean。
ReflectionException
-例外发生在试图调用一个动态MBean的getmbeaninfo。
IOException
-沟通问题发生到MBean服务器交谈时。
boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException, IOException
如果指定的MBean是指定类的实例返回true,否则为false。
如果name
并不叫MBean,这个方法会InstanceNotFoundException
。
否则,let
X是MBean的命名name
,
L是X的类装载器,
N是X的MBeanInfo
类名。
如果n等于className
,结果是真的。
否则,如果我成功加载className
X是这个类的一个实例,结果是真的。
否则,如果我成功加载N和className
,第二类是分配从第一,结果是真的。
否则,结果是假的。
name
- MBean的
ObjectName
。
className
-类的名字。
InstanceNotFoundException
的MBean指定不在MBean服务器注册。
IOException
-沟通问题发生到MBean服务器交谈时。
Class.isInstance(java.lang.Object)
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.