- 所有父级接口:
MBeanServerConnection
- 所有已知的子接口:
MBeanServerForwarder
这是在代理端进行 MBean 操作的接口。它包含创建、注册和删除 MBean 所需的方法以及已注册 MBean 的访问方法。这是 JMX 基础结构的核心组件。
用户代码通常不实现此接口。相反,实现此接口的对象是使用 MBeanServerFactory
类中的一种方法获得的。
添加到 MBean 服务的每个 MBean 都变得可管理:它的属性和操作可以通过连接到该 MBean 服务的连接器/适配器远程访问。 Java 对象不能在 MBean 服务中注册,除非它是符合 JMX 的 MBean。
当 MBean 在 MBean 服务中注册或取消注册时,将发出 MBeanServerNotification
通知。要将对象注册为 MBeanServerNotifications 的监听器,您应该调用 MBean 服务方法 addNotificationListener
和 ObjectName
ObjectName
的 MBeanServerDelegate
。这个 ObjectName
是:JMImplementation:type=MBeanServerDelegate
.
从 MBeanServerFactory
类的 createMBeanServer
或 newMBeanServer
方法获得的对象对其方法应用安全检查,如下所示。
首先,如果没有安全管理器(System.getSecurityManager()
为空),则此接口的实现可以自由地不进行任何检查。
假设有一个安全管理器,或者实施选择无论如何都要进行检查,则检查的详细信息如下。在下文中,除非另有说明,className
是 MBeanInfo.getClassName()
为目标 MBean 返回的字符串。
如果安全检查失败,该方法将抛出 SecurityException
。
对于可以抛出 InstanceNotFoundException
的方法,无论权限如何,都会为不存在的 MBean 抛出此异常。这是因为不存在的 MBean 没有 className
。
对于
invoke
方法,调用者的权限必须隐含MBeanPermission(className, operationName, name, "invoke")
。对于
getAttribute
方法,调用者的权限必须隐含MBeanPermission(className, attribute, name, "getAttribute")
。对于
getAttributes
方法,调用者的权限必须隐含MBeanPermission(className, null, name, "getAttribute")
。此外,对于AttributeList
中的每个属性 a,如果调用者的权限不暗示MBeanPermission(className, a, name, "getAttribute")
,则 MBean 服务的行为就好像该属性不在提供的列表中一样。对于
setAttribute
方法,调用者的权限必须隐含MBeanPermission(className, attrName, name, "setAttribute")
,其中attrName
是attribute.getName()
。对于
setAttributes
方法,调用者的权限必须隐含MBeanPermission(className, null, name, "setAttribute")
。此外,对于AttributeList
中的每个属性 a,如果调用者的权限不暗示MBeanPermission(className, a, name, "setAttribute")
,则 MBean 服务的行为就好像该属性不在提供的列表中一样。对于
addNotificationListener
方法,调用者的权限必须隐含MBeanPermission(className, null, name, "addNotificationListener")
。对于
removeNotificationListener
方法,调用者的权限必须隐含MBeanPermission(className, null, name, "removeNotificationListener")
。对于
getMBeanInfo
方法,调用者的权限必须隐含MBeanPermission(className, null, name, "getMBeanInfo")
。对于
getObjectInstance
方法,调用者的权限必须隐含MBeanPermission(className, null, name, "getObjectInstance")
。对于
isInstanceOf
方法,调用者的权限必须隐含MBeanPermission(className, null, name, "isInstanceOf")
。对于
queryMBeans
方法,调用者的权限必须隐含MBeanPermission(null, null, null, "queryMBeans")
。此外,对于匹配name
的每个 MBean n,如果调用者的权限不暗示MBeanPermission(className, null, n, "queryMBeans")
,则 MBean 服务的行为就好像该 MBean 不存在一样。某些查询元素在 MBean 服务上执行操作。如果调用者没有给定 MBean 所需的权限,则该 MBean 将不会包含在查询结果中。受影响的标准查询元素是
Query.attr(String)
、Query.attr(String,String)
和Query.classattr()
。对于
queryNames
方法,检查与queryMBeans
相同,只是在MBeanPermission
对象中使用"queryNames"
而不是"queryMBeans"
。请注意,"queryMBeans"
权限意味着相应的"queryNames"
权限。对于
getDomains
方法,调用者的权限必须隐含MBeanPermission(null, null, null, "getDomains")
。此外,对于每个域d在返回的数组中,如果调用者的权限不暗示MBeanPermission(null, null, new ObjectName("d:x=x"), "getDomains")
,则从数组中删除该域。在这里,x=x
是任何键=值对,需要满足 ObjectName 的构造方法但不相关。对于
getClassLoader
方法,调用者的权限必须隐含MBeanPermission(className, null, loaderName, "getClassLoader")
。对于
getClassLoaderFor
方法,调用者的权限必须暗示MBeanPermission(className, null, mbeanName, "getClassLoaderFor")
。对于
getClassLoaderRepository
方法,调用者的权限必须隐含MBeanPermission(null, null, null, "getClassLoaderRepository")
。对于已弃用的
deserialize
方法,所需的权限与替换它们的方法相同。对于
instantiate
方法,调用者的权限必须隐含MBeanPermission(className, null, null, "instantiate")
,其中className
是要实例化的类的名称。对于
registerMBean
方法,调用者的权限必须隐含MBeanPermission(className, null, name, "registerMBean")
。如果
MBeanPermission
检查成功,则通过检查其ProtectionDomain
暗示MBeanTrustPermission("register")
来验证 MBean 的类。最后,如果
name
参数为空,则使用MBeanRegistration.preRegister
返回的ObjectName
进行另一个MBeanPermission
检查。对于
createMBean
方法,调用者的权限必须暗示等效的instantiate
后跟registerMBean
所需的权限。对于
unregisterMBean
方法,调用者的权限必须隐含MBeanPermission(className, null, name, "unregisterMBean")
。
- 自从:
- 1.5
-
方法总结
修饰符和类型方法描述void
addNotificationListener
(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) 向已注册的 MBean 添加监听。void
addNotificationListener
(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) 向已注册的 MBean 添加监听。createMBean
(String className, ObjectName name) 在 MBean 服务中实例化和注册 MBean。createMBean
(String className, ObjectName name, Object[] params, String[] signature) 在 MBean 服务中实例化和注册 MBean。createMBean
(String className, ObjectName name, ObjectName loaderName) 在 MBean 服务中实例化和注册 MBean。createMBean
(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) 在 MBean 服务中实例化和注册 MBean。default ObjectInputStream
deserialize
(String className, byte[] data) 已弃用。default ObjectInputStream
deserialize
(String className, ObjectName loaderName, byte[] data) 已弃用。使用getClassLoader
获取反序列化的类加载器。default ObjectInputStream
deserialize
(ObjectName name, byte[] data) 已弃用。使用getClassLoaderFor
获取适当的类加载器以进行反序列化。getAttribute
(ObjectName name, String attribute) 获取命名 MBean 的特定属性的值。getAttributes
(ObjectName name, String[] attributes) 检索命名 MBean 的多个属性的值。getClassLoader
(ObjectName loaderName) 返回命名为ClassLoader
。getClassLoaderFor
(ObjectName mbeanName) 返回用于加载指定 MBean 类的ClassLoader
。返回此 MBeanServer 的 ClassLoaderRepository。返回用于命名 MBean 的默认域。String[]
返回当前注册了任何 MBean 的域列表。返回在 MBean 服务中注册的 MBean 数。getMBeanInfo
(ObjectName name) 此方法发现 MBean 为管理而公开的属性和操作。getObjectInstance
(ObjectName name) 获取在 MBean 服务上注册的给定 MBean 的ObjectInstance
。instantiate
(String className) 使用在 MBean 服务的Class Loader Repository
中注册的所有类加载器的列表实例化一个对象。instantiate
(String className, Object[] params, String[] signature) 使用在 MBean 服务Class Loader Repository
中注册的所有类加载器的列表实例化一个对象。instantiate
(String className, ObjectName loaderName) 使用由其ObjectName
指定的类 Loader 实例化一个对象。instantiate
(String className, ObjectName loaderName, Object[] params, String[] signature) 实例化一个对象。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 服务。queryMBeans
(ObjectName name, QueryExp query) 获取由 MBean 服务控制的 MBean。queryNames
(ObjectName name, QueryExp query) 获取由 MBean 服务控制的 MBean 的名称。registerMBean
(Object object, ObjectName name) 将预先存在的对象作为 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 的特定属性的值。setAttributes
(ObjectName name, AttributeList attributes) 设置命名 MBean 的几个属性的值。void
unregisterMBean
(ObjectName name) 从 MBean 服务注销 MBean。
-
方法详情
-
createMBean
ObjectInstance createMBean(String className, ObjectName name) throws ReflectionException , InstanceAlreadyExistsException , MBeanRegistrationException , MBeanException , NotCompliantMBeanException 在 MBean 服务中实例化和注册 MBean。 MBean 服务将使用它的
Default Loader Repository
来加载 MBean 的类。对象名称与 MBean 相关联。如果给定的对象名称为空,则 MBean 必须通过实现MBeanRegistration
接口并从preRegister
方法返回名称来提供自己的名称。此方法等效于
createMBean(className, name, (Object[]) null, (String[]) null)
。如果此方法成功创建了 MBean,则会发送通知,如 多于 所述。
- 指定者:
createMBean
在接口MBeanServerConnection
中- 参数:
className
- 要实例化的 MBean 的类名。name
- MBean 的对象名称。可能为空。- 返回:
-
一个
ObjectInstance
,包含ObjectName
和新实例化的 MBean 的 Java 类名。如果包含的ObjectName
是n
,则包含的 Java 类名称是
。getMBeanInfo(n)
.getClassName() - 抛出:
RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:传入参数的 className 为 null,传入参数ObjectName
包含模式或未为 MBean 指定ObjectName
。RuntimeMBeanException
- 如果 MBean 的构造函数或其preRegister
或postRegister
方法抛出RuntimeException
。如果 MBean 的postRegister
(MBeanRegistration
接口)方法抛出一个RuntimeException
,createMBean
方法将抛出一个RuntimeMBeanException
,尽管 MBean 创建和注册成功。在这种情况下,即使createMBean
方法抛出异常,MBean 也会实际注册。请注意,RuntimeMBeanException
也可以由preRegister
抛出,在这种情况下,MBean 将不会被注册。RuntimeErrorException
- 如果 MBean 的postRegister
(MBeanRegistration
接口)方法抛出Error
,则createMBean
方法将抛出RuntimeErrorException
,尽管 MBean 创建和注册成功。在这种情况下,即使createMBean
方法抛出异常,MBean 也会实际注册。请注意,RuntimeErrorException
也可以由preRegister
抛出,在这种情况下,MBean 将不会被注册。ReflectionException
- 包装在尝试调用 MBean 的构造函数时发生的java.lang.ClassNotFoundException
或java.lang.Exception
。InstanceAlreadyExistsException
- MBean 已在 MBean 服务的控制之下。MBeanRegistrationException
- MBean 的preRegister
(MBeanRegistration
接口)方法抛出异常。 MBean 将不会被注册。MBeanException
- MBean 的构造函数抛出异常NotCompliantMBeanException
- 此类不是符合 JMX 的 MBean- 参见:
-
createMBean
ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException , InstanceAlreadyExistsException , MBeanRegistrationException , MBeanException , NotCompliantMBeanException , InstanceNotFoundException 在 MBean 服务中实例化和注册 MBean。要使用的类加载器由其对象名称标识。对象名称与 MBean 相关联。如果加载器的对象名称为空,则将使用加载 MBean 服务的 ClassLoader。如果给定的 MBean 对象名称为 null,则 MBean 必须通过实现
MBeanRegistration
接口并从preRegister
方法返回名称来提供自己的名称。此方法等效于
createMBean(className, name, loaderName, (Object[]) null, (String[]) null)
。如果此方法成功创建了 MBean,则会发送通知,如 多于 所述。
- 指定者:
createMBean
在接口MBeanServerConnection
中- 参数:
className
- 要实例化的 MBean 的类名。name
- MBean 的对象名称。可能为空。loaderName
- 要使用的类加载器的对象名称。- 返回:
-
一个
ObjectInstance
,包含ObjectName
和新实例化的 MBean 的 Java 类名。如果包含的ObjectName
是n
,则包含的 Java 类名称是
。getMBeanInfo(n)
.getClassName() - 抛出:
RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:传入参数的 className 为 null,传入参数ObjectName
包含模式或未为 MBean 指定ObjectName
。RuntimeMBeanException
- 如果 MBean 的构造函数或其preRegister
或postRegister
方法抛出RuntimeException
。如果 MBean 的postRegister
(MBeanRegistration
接口)方法抛出一个RuntimeException
,createMBean
方法将抛出一个RuntimeMBeanException
,尽管 MBean 创建和注册成功。在这种情况下,即使createMBean
方法抛出异常,MBean 也会实际注册。请注意,RuntimeMBeanException
也可以由preRegister
抛出,在这种情况下,MBean 将不会被注册。RuntimeErrorException
- 如果 MBean 的postRegister
(MBeanRegistration
接口)方法抛出Error
,则createMBean
方法将抛出RuntimeErrorException
,尽管 MBean 创建和注册成功。在这种情况下,即使createMBean
方法抛出异常,MBean 也会实际注册。请注意,RuntimeErrorException
也可以由preRegister
抛出,在这种情况下,MBean 将不会被注册。ReflectionException
- 包装在尝试调用 MBean 的构造函数时发生的java.lang.ClassNotFoundException
或java.lang.Exception
。InstanceAlreadyExistsException
- MBean 已在 MBean 服务的控制之下。MBeanRegistrationException
- MBean 的preRegister
(MBeanRegistration
接口)方法抛出异常。 MBean 将不会被注册。MBeanException
- MBean 的构造函数抛出异常NotCompliantMBeanException
- 此类不是符合 JMX 的 MBeanInstanceNotFoundException
- 指定的类加载器未在 MBean 服务中注册。- 参见:
-
createMBean
ObjectInstance createMBean(String className, ObjectName name, Object [] params, String [] signature) throws ReflectionException , InstanceAlreadyExistsException , MBeanRegistrationException , MBeanException , NotCompliantMBeanException 在 MBean 服务中实例化和注册 MBean。 MBean 服务将使用它的Default Loader Repository
来加载 MBean 的类。对象名称与 MBean 相关联。如果给定的对象名称为空,则 MBean 必须通过实现MBeanRegistration
接口并从preRegister
方法返回名称来提供自己的名称。如果此方法成功创建了 MBean,则会发送通知,如 多于 所述。
- 指定者:
createMBean
在接口MBeanServerConnection
中- 参数:
className
- 要实例化的 MBean 的类名。name
- MBean 的对象名称。可能为空。params
- 包含要调用的构造函数参数的数组。signature
- 包含要调用的构造函数签名的数组。- 返回:
-
一个
ObjectInstance
,包含ObjectName
和新实例化的 MBean 的 Java 类名。如果包含的ObjectName
是n
,则包含的 Java 类名称是
。getMBeanInfo(n)
.getClassName() - 抛出:
RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:传入参数的 className 为 null,传入参数ObjectName
包含模式或未为 MBean 指定ObjectName
。RuntimeMBeanException
- 如果 MBean 的构造函数或其preRegister
或postRegister
方法抛出RuntimeException
。如果 MBean 的postRegister
(MBeanRegistration
接口)方法抛出一个RuntimeException
,createMBean
方法将抛出一个RuntimeMBeanException
,尽管 MBean 创建和注册成功。在这种情况下,即使createMBean
方法抛出异常,MBean 也会实际注册。请注意,RuntimeMBeanException
也可以由preRegister
抛出,在这种情况下,MBean 将不会被注册。RuntimeErrorException
- 如果 MBean 的postRegister
(MBeanRegistration
接口)方法抛出Error
,则createMBean
方法将抛出RuntimeErrorException
,尽管 MBean 创建和注册成功。在这种情况下,即使createMBean
方法抛出异常,MBean 也会实际注册。请注意,RuntimeErrorException
也可以由preRegister
抛出,在这种情况下,MBean 将不会被注册。ReflectionException
- 包装在尝试调用 MBean 的构造函数时发生的java.lang.ClassNotFoundException
或java.lang.Exception
。InstanceAlreadyExistsException
- MBean 已在 MBean 服务的控制之下。MBeanRegistrationException
- MBean 的preRegister
(MBeanRegistration
接口)方法抛出异常。 MBean 将不会被注册。MBeanException
- MBean 的构造函数抛出异常NotCompliantMBeanException
- 此类不是符合 JMX 的 MBean- 参见:
-
createMBean
ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object [] params, String [] signature) throws ReflectionException , InstanceAlreadyExistsException , MBeanRegistrationException , MBeanException , NotCompliantMBeanException , InstanceNotFoundException 在 MBean 服务中实例化和注册 MBean。要使用的类加载器由其对象名称标识。对象名称与 MBean 相关联。如果未指定加载程序的对象名称,将使用加载 MBean 服务的 ClassLoader。如果给定的 MBean 对象名称为 null,则 MBean 必须通过实现
MBeanRegistration
接口并从preRegister
方法返回名称来提供自己的名称。如果此方法成功创建了 MBean,则会发送通知,如 多于 所述。
- 指定者:
createMBean
在接口MBeanServerConnection
中- 参数:
className
- 要实例化的 MBean 的类名。name
- MBean 的对象名称。可能为空。loaderName
- 要使用的类加载器的对象名称。params
- 包含要调用的构造函数参数的数组。signature
- 包含要调用的构造函数签名的数组。- 返回:
-
一个
ObjectInstance
,包含ObjectName
和新实例化的 MBean 的 Java 类名。如果包含的ObjectName
是n
,则包含的 Java 类名称是
。getMBeanInfo(n)
.getClassName() - 抛出:
RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:传入参数的 className 为 null,传入参数ObjectName
包含模式或未为 MBean 指定ObjectName
。RuntimeMBeanException
- MBean 的构造函数或其preRegister
或postRegister
方法抛出RuntimeException
。如果 MBean 的postRegister
(MBeanRegistration
接口)方法抛出一个RuntimeException
,createMBean
方法将抛出一个RuntimeMBeanException
,尽管 MBean 创建和注册成功。在这种情况下,即使createMBean
方法抛出异常,MBean 也会实际注册。请注意,RuntimeMBeanException
也可能由preRegister
抛出,在这种情况下,MBean 将不会被注册。RuntimeErrorException
- 如果 MBean 的postRegister
方法(MBeanRegistration
接口)方法抛出Error
,那么createMBean
方法将抛出RuntimeErrorException
,尽管 MBean 创建和注册成功。在这种情况下,即使createMBean
方法抛出异常,MBean 也会实际注册。请注意,RuntimeErrorException
也可以由preRegister
抛出,在这种情况下,MBean 将不会被注册。ReflectionException
- 包装在尝试调用 MBean 的构造函数时发生的java.lang.ClassNotFoundException
或java.lang.Exception
。InstanceAlreadyExistsException
- MBean 已在 MBean 服务的控制之下。MBeanRegistrationException
- MBean 的preRegister
(MBeanRegistration
接口)方法抛出异常。 MBean 将不会被注册。MBeanException
- MBean 的构造函数抛出异常NotCompliantMBeanException
- 此类不是符合 JMX 的 MBeanInstanceNotFoundException
- 指定的类加载器未在 MBean 服务中注册。- 参见:
-
registerMBean
ObjectInstance registerMBean(Object object, ObjectName name) throws InstanceAlreadyExistsException , MBeanRegistrationException , NotCompliantMBeanException 将预先存在的对象作为 MBean 注册到 MBean 服务。如果给定的对象名称为空,则 MBean 必须通过实现
MBeanRegistration
接口并从preRegister
方法返回名称来提供自己的名称。如果此方法成功注册了一个 MBean,则会按照 多于 所述发送通知。
- 参数:
object
- 要注册为 MBean 的 MBean。name
- MBean 的对象名称。可能为空。- 返回:
-
一个
ObjectInstance
,包含ObjectName
和新注册的 MBean 的 Java 类名。如果包含的ObjectName
是n
,则包含的 Java 类名称是
。getMBeanInfo(n)
.getClassName() - 抛出:
InstanceAlreadyExistsException
- MBean 已在 MBean 服务的控制之下。MBeanRegistrationException
- MBean 的preRegister
(MBeanRegistration
接口)方法抛出异常。 MBean 将不会被注册。RuntimeMBeanException
- 如果 MBean 的postRegister
(MBeanRegistration
接口)方法抛出RuntimeException
,则registerMBean
方法将抛出RuntimeMBeanException
,尽管 MBean 注册成功。在这种情况下,即使registerMBean
方法抛出异常,MBean 也会实际注册。请注意,RuntimeMBeanException
也可能由preRegister
抛出,在这种情况下,MBean 将不会被注册。RuntimeErrorException
- 如果 MBean 的postRegister
(MBeanRegistration
接口)方法抛出Error
,则registerMBean
方法将抛出RuntimeErrorException
,尽管 MBean 注册成功。在这种情况下,即使registerMBean
方法抛出异常,MBean 也会实际注册。请注意,RuntimeErrorException
也可以由preRegister
抛出,在这种情况下,MBean 将不会被注册。NotCompliantMBeanException
- 此对象不是 JMX 兼容的 MBeanRuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:传入参数的对象为空或未指定对象名称。- 参见:
-
unregisterMBean
从 MBean 服务注销 MBean。 MBean 由其对象名称标识。一旦调用了该方法,就不能再通过其对象名访问 MBean。如果此方法成功注销了 MBean,则会按照 多于 所述发送通知。
- 指定者:
unregisterMBean
在接口MBeanServerConnection
中- 参数:
name
- 要取消注册的 MBean 的对象名称。- 抛出:
RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:参数中的对象名称为空,或者您尝试注销时所在的 MBean 是MBeanServerDelegate
MBean。RuntimeMBeanException
- 如果 MBean 的postDeregister
(MBeanRegistration
接口)方法抛出RuntimeException
,则unregisterMBean
方法将抛出RuntimeMBeanException
,尽管 MBean 注销成功。在这种情况下,即使unregisterMBean
方法抛出异常,MBean 实际上也会被注销。请注意,RuntimeMBeanException
也可以由preDeregister
抛出,在这种情况下,MBean 将保持注册状态。RuntimeErrorException
- 如果 MBean 的postDeregister
(MBeanRegistration
接口)方法抛出Error
,则unregisterMBean
方法将抛出RuntimeErrorException
,尽管 MBean 注销成功。在这种情况下,即使unregisterMBean
方法抛出异常,MBean 实际上也会被注销。请注意,RuntimeMBeanException
也可以由preDeregister
抛出,在这种情况下,MBean 将保持注册状态。InstanceNotFoundException
- 指定的 MBean 未在 MBean 服务中注册。MBeanRegistrationException
- MBean 的 preDeregister (MBeanRegistration
interface) 方法抛出异常。- 参见:
-
getObjectInstance
从接口MBeanServerConnection
复制的描述获取在 MBean 服务上注册的给定 MBean 的ObjectInstance
。- 指定者:
getObjectInstance
在接口MBeanServerConnection
中- 参数:
name
- MBean 的对象名称。- 返回:
-
与指定的 MBean 关联的
ObjectInstance
name.包含的ObjectName
是name
,包含的类名是
。getMBeanInfo(name)
.getClassName() - 抛出:
InstanceNotFoundException
- 指定的 MBean 未在 MBean 服务中注册。
-
queryMBeans
获取由 MBean 服务控制的 MBean。此方法允许获取以下任何内容:所有 MBean,一组由ObjectName
上的模式匹配指定的 MBean 和/或查询表达式,一个特定的 MBean。当对象名称为 null 或未指定域和键属性时,将选择所有对象(如果指定了查询,则将进行过滤)。它为选定的 MBean 返回一组ObjectInstance
对象(包含ObjectName
和 Java 类名称)。- 指定者:
queryMBeans
在接口MBeanServerConnection
中- 参数:
name
- 标识要检索的 MBean 的对象名称模式。如果指定为空或未指定域和键属性,则将检索所有已注册的 MBean。query
- 用于选择 MBean 的查询表达式。如果为 null,将不会应用查询表达式来选择 MBean。- 返回:
-
包含所选 MBean 的
ObjectInstance
对象的集合。如果没有 MBean 满足查询,则返回一个空列表。
-
queryNames
获取由 MBean 服务控制的 MBean 的名称。此方法可以获取以下任何内容:所有 MBean 的名称、由ObjectName
和/或查询表达式上的模式匹配指定的一组 MBean 的名称、特定的 MBean 名称(相当于测试 MBean 是否是挂号的)。当对象名称为 null 或未指定域和键属性时,将选择所有对象(如果指定了查询,则会过滤)。它返回所选 MBean 的 ObjectNames 集。- 指定者:
queryNames
在接口MBeanServerConnection
中- 参数:
name
- 标识要检索的 MBean 名称的对象名称模式。如果指定为空或未指定域和键属性,将检索所有已注册 MBean 的名称。query
- 用于选择 MBean 的查询表达式。如果为 null,将不会应用查询表达式来选择 MBean。- 返回:
- 包含所选 MBean 的对象名称的集合。如果没有 MBean 满足查询,则返回一个空列表。
-
isRegistered
从接口MBeanServerConnection
复制的描述检查由其对象名称标识的 MBean 是否已注册到 MBean 服务。- 指定者:
isRegistered
在接口MBeanServerConnection
中- 参数:
name
- 要检查的 MBean 的对象名称。- 返回:
- 如果 MBean 已在 MBean 服务中注册,则为 True,否则为 false。
- 抛出:
RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:参数中的对象名称为空。
-
getMBeanCount
Integer getMBeanCount()返回在 MBean 服务中注册的 MBean 数。- 指定者:
getMBeanCount
在接口MBeanServerConnection
中- 返回:
- 已注册的 MBean 数,包装在一个 Integer 中。如果调用者的权限受到限制,这个数字可能会大于调用者可以访问的 MBean 的数量。
-
getAttribute
Object getAttribute(ObjectName name, String attribute) throws MBeanException , AttributeNotFoundException , InstanceNotFoundException , ReflectionException 从接口MBeanServerConnection
复制的描述获取命名 MBean 的特定属性的值。 MBean 由其对象名称标识。- 指定者:
getAttribute
在接口MBeanServerConnection
中- 参数:
name
- 要从中检索属性的 MBean 的对象名称。attribute
- 一个字符串,指定要检索的属性的名称。- 返回:
- 检索到的属性的值。
- 抛出:
RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:参数中的对象名称为空或参数中的属性为空。MBeanException
- 包装由 MBean 的 getter 抛出的异常。AttributeNotFoundException
- 指定的属性在 MBean 中不可访问。InstanceNotFoundException
- 指定的 MBean 未在 MBean 服务中注册。ReflectionException
- 包装在尝试调用 setter 时抛出的java.lang.Exception
。- 参见:
-
getAttributes
AttributeList getAttributes(ObjectName name, String [] attributes) throws InstanceNotFoundException , ReflectionException 从接口MBeanServerConnection
复制的描述检索命名 MBean 的多个属性的值。 MBean 由其对象名称标识。
如果由于某种原因无法检索一个或多个属性,它们将从返回的
AttributeList
中省略。调用者应检查列表的大小是否与attributes
数组相同。要发现是什么问题阻止了给定属性的检索,请为该属性调用getAttribute
。下面是调用此方法并检查它是否成功检索所有请求的属性的示例:
String[] attrNames = ...; AttributeList list = mbeanServerConnection.getAttributes(objectName, attrNames); if (list.size() == attrNames.length) System.out.println("All attributes were retrieved successfully"); else {
List<String>
missing = newArrayList<String>
(Arrays.asList
(attrNames)); for (Attribute a : list.asList()) missing.remove(a.getName()); System.out.println("Did not retrieve: " + missing); }- 指定者:
getAttributes
在接口MBeanServerConnection
中- 参数:
name
- 从中检索属性的 MBean 的对象名称。attributes
- 要检索的属性列表。- 返回:
- 检索到的属性的列表。
- 抛出:
RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:参数中的对象名称为空或参数中的属性为空。InstanceNotFoundException
- 指定的 MBean 未在 MBean 服务中注册。ReflectionException
- 尝试调用 Dynamic MBean 的 getAttributes 方法时发生异常。- 参见:
-
setAttribute
void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException , AttributeNotFoundException , InvalidAttributeValueException , MBeanException , ReflectionException 从接口MBeanServerConnection
复制的描述设置命名 MBean 的特定属性的值。 MBean 由其对象名称标识。- 指定者:
setAttribute
在接口MBeanServerConnection
中- 参数:
name
- 要在其中设置属性的 MBean 的名称。attribute
- 要设置的属性的标识及其要设置的值。- 抛出:
RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:参数中的对象名称为空或参数中的属性为空。InstanceNotFoundException
- 指定的 MBean 未在 MBean 服务中注册。AttributeNotFoundException
- 指定的属性在 MBean 中不可访问。InvalidAttributeValueException
- 为属性指定的值无效。MBeanException
- 包装由 MBean 的设置器抛出的异常。ReflectionException
- 包装在尝试调用 setter 时抛出的java.lang.Exception
。- 参见:
-
setAttributes
AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException , ReflectionException 从接口MBeanServerConnection
复制的描述设置命名 MBean 的几个属性的值。 MBean 由其对象名称标识。
如果由于某种原因无法设置一个或多个属性,则返回的
AttributeList
中将省略它们。调用者应检查输入AttributeList
是否与输出大小相同。要发现是什么问题阻止了给定属性的检索,通常可以为该属性调用setAttribute
,尽管这不能保证有效。 (例如,两个属性的值可能已被拒绝,因为它们彼此不一致。可能允许单独设置其中一个。)下面是调用此方法并检查它是否成功设置了所有请求的属性的示例:
AttributeList inputAttrs = ...; AttributeList outputAttrs = mbeanServerConnection.setAttributes(objectName, inputAttrs); if (inputAttrs.size() == outputAttrs.size()) System.out.println("All attributes were set successfully"); else {
List<String>
missing = newArrayList<String>
(); for (Attribute a : inputAttrs.asList()) missing.add(a.getName()); for (Attribute a : outputAttrs.asList()) missing.remove(a.getName()); System.out.println("Did not set: " + missing); }- 指定者:
setAttributes
在接口MBeanServerConnection
中- 参数:
name
- 要在其中设置属性的 MBean 的对象名称。attributes
- 属性列表:要设置的属性的标识及其要设置的值。- 返回:
- 已设置的属性列表及其新值。
- 抛出:
RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:参数中的对象名称为空或参数中的属性为空。InstanceNotFoundException
- 指定的 MBean 未在 MBean 服务中注册。ReflectionException
- 尝试调用 Dynamic MBean 的 getAttributes 方法时发生异常。- 参见:
-
invoke
Object invoke(ObjectName name, String operationName, Object [] params, String [] signature) throws InstanceNotFoundException , MBeanException , ReflectionException 从接口MBeanServerConnection
复制的描述在 MBean 上调用操作。
由于需要
signature
来区分可能重载的操作,因此在可能的情况下通过 MBean代理 调用操作要简单得多。例如,假设您有一个像这样的 Standard MBean 接口:public interface FooMBean { public int countMatches(String[] patterns, boolean ignoreCase); }
countMatches
操作可以调用如下:String[] myPatterns = ...; int count = (Integer) mbeanServerConnection.invoke( objectName, "countMatches", new Object[] {myPatterns, true}, new String[] {String[].class.getName(), boolean.class.getName()});
或者,它可以通过代理调用,如下所示:
String[] myPatterns = ...; FooMBean fooProxy = JMX.newMBeanProxy( mbeanServerConnection, objectName, FooMBean.class); int count = fooProxy.countMatches(myPatterns, true);
- 指定者:
invoke
在接口MBeanServerConnection
中- 参数:
name
- 要在其上调用方法的 MBean 的对象名称。operationName
- 要调用的操作的名称。params
- 包含调用操作时要设置的参数的数组signature
- 包含操作签名的数组,由Class.getName()
返回的格式的类名数组。将使用与用于加载调用操作的 MBean 的类加载器相同的类加载器来加载类对象。- 返回:
- 操作返回的对象,表示对指定的 MBean 调用操作的结果。
- 抛出:
InstanceNotFoundException
- 指定的 MBean 未在 MBean 服务中注册。MBeanException
- 包装由 MBean 的调用方法抛出的异常。ReflectionException
- 包装在尝试调用该方法时抛出的java.lang.Exception
。
-
getDefaultDomain
String getDefaultDomain()从接口MBeanServerConnection
复制的描述返回用于命名 MBean 的默认域。如果用户未指定域,则默认域名用作 MBean 的 ObjectName 中的域部分。- 指定者:
getDefaultDomain
在接口MBeanServerConnection
中- 返回:
- 默认域。
-
getDomains
String [] getDomains()从接口MBeanServerConnection
复制的描述返回当前注册了任何 MBean 的域列表。当且仅当至少有一个 MBean 使用
getDomain()
等于该字符串的 ObjectName 注册时,字符串才会出现在返回的数组中。未定义返回数组中字符串的顺序。- 指定者:
getDomains
在接口MBeanServerConnection
中- 返回:
- 域列表。
-
addNotificationListener
void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException 向已注册的 MBean 添加监听。 MBean 发出的通知将转发给监听。
如果通知源是对 MBean 对象的引用,则 MBean 服务将用该 MBean 的 ObjectName 替换它。否则源不变。- 指定者:
addNotificationListener
在接口MBeanServerConnection
中- 参数:
name
- 应在其上添加监听器的 MBean 的名称。listener
- 将处理已注册 MBean 发出的通知的监听器对象。filter
- 过滤器对象。如果 filter 为 null,则在处理通知之前不会执行任何过滤。handback
- 发出通知时要发送给监听器的上下文。- 抛出:
InstanceNotFoundException
- 提供的 MBean 名称与任何已注册的 MBean 都不匹配。- 参见:
-
addNotificationListener
void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException 向已注册的 MBean 添加监听。
MBean 发出的通知将由 MBeanServer 转发给监听。如果通知源是对 MBean 对象的引用,则 MBean 服务将用该 MBean 的 ObjectName 替换它。否则源不变。
接收通知的监听对象是在调用此方法时使用给定名称注册的对象。即使随后取消注册,它也会继续收到通知。
- 指定者:
addNotificationListener
在接口MBeanServerConnection
中- 参数:
name
- 应在其上添加监听器的 MBean 的名称。listener
- 将处理已注册 MBean 发出的通知的监听器的对象名称。filter
- 过滤器对象。如果 filter 为 null,则在处理通知之前不会执行任何过滤。handback
- 发出通知时要发送给监听器的上下文。- 抛出:
RuntimeOperationsException
- 包装一个IllegalArgumentException
。listener
命名的 MBean 存在但未实现NotificationListener
接口。InstanceNotFoundException
- 通知监听器或通知广播器的 MBean 名称与任何已注册的 MBean 都不匹配。- 参见:
-
removeNotificationListener
void removeNotificationListener(ObjectName name, ObjectName listener) throws InstanceNotFoundException , ListenerNotFoundException 从接口MBeanServerConnection
复制的描述从已注册的 MBean 中删除监听。如果监听注册了不止一次,可能使用不同的过滤器或回调,此方法将删除所有这些注册。
- 指定者:
removeNotificationListener
在接口MBeanServerConnection
中- 参数:
name
- 应删除监听器的 MBean 的名称。listener
- 要删除的监听器的对象名称。- 抛出:
InstanceNotFoundException
- 提供的 MBean 名称与任何已注册的 MBean 都不匹配。ListenerNotFoundException
- 监听器未在 MBean 中注册。- 参见:
-
removeNotificationListener
void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException , ListenerNotFoundException 从接口MBeanServerConnection
复制的描述从已注册的 MBean 中删除监听。
MBean 必须具有与给定的
listener
、filter
和handback
参数完全匹配的监听器。如果有多个这样的监听器,则只删除一个。当且仅当它们在要删除的监听器中为空时,
filter
和handback
参数可以为空。- 指定者:
removeNotificationListener
在接口MBeanServerConnection
中- 参数:
name
- 应删除监听器的 MBean 的名称。listener
- 要删除的监听器的对象名称。filter
- 添加监听器时指定的过滤器。handback
- 添加监听器时指定的交接。- 抛出:
InstanceNotFoundException
- 提供的 MBean 名称与任何已注册的 MBean 都不匹配。ListenerNotFoundException
- 监听器未在 MBean 中注册,或者未向给定的过滤器和 handback 注册。- 参见:
-
removeNotificationListener
void removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException , ListenerNotFoundException 从接口MBeanServerConnection
复制的描述从已注册的 MBean 中删除监听。
如果监听注册了不止一次,可能使用不同的过滤器或回调,此方法将删除所有这些注册。
- 指定者:
removeNotificationListener
在接口MBeanServerConnection
中- 参数:
name
- 应删除监听器的 MBean 的名称。listener
- 要删除的监听器。- 抛出:
InstanceNotFoundException
- 提供的 MBean 名称与任何已注册的 MBean 都不匹配。ListenerNotFoundException
- 监听器未在 MBean 中注册。- 参见:
-
removeNotificationListener
void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException , ListenerNotFoundException 从接口MBeanServerConnection
复制的描述从已注册的 MBean 中删除监听。
MBean 必须具有与给定的
listener
、filter
和handback
参数完全匹配的监听器。如果有多个这样的监听器,则只删除一个。当且仅当它们在要删除的监听器中为空时,
filter
和handback
参数可以为空。- 指定者:
removeNotificationListener
在接口MBeanServerConnection
中- 参数:
name
- 应删除监听器的 MBean 的名称。listener
- 要删除的监听器。filter
- 添加监听器时指定的过滤器。handback
- 添加监听器时指定的交接。- 抛出:
InstanceNotFoundException
- 提供的 MBean 名称与任何已注册的 MBean 都不匹配。ListenerNotFoundException
- 监听器未在 MBean 中注册,或者未向给定的过滤器和 handback 注册。- 参见:
-
getMBeanInfo
MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException , IntrospectionException , ReflectionException 从接口MBeanServerConnection
复制的描述此方法发现 MBean 为管理而公开的属性和操作。- 指定者:
getMBeanInfo
在接口MBeanServerConnection
中- 参数:
name
- 要分析的 MBean 的名称- 返回:
MBeanInfo
的实例允许检索此 MBean 的所有属性和操作。- 抛出:
InstanceNotFoundException
- 未找到指定的 MBean。IntrospectionException
- 内省期间发生异常。ReflectionException
- 尝试调用 Dynamic MBean 的 getMBeanInfo 时发生异常。
-
isInstanceOf
从接口MBeanServerConnection
复制的描述如果指定的 MBean 是指定类的实例,则返回 true,否则返回 false。
如果
name
没有命名 MBean,则此方法抛出InstanceNotFoundException
。否则,让
X 是由name
命名的 MBean,
L 是 X 的类加载器,
是 X 的MBeanInfo
中的类名。如果 N 等于
className
,则结果为真。否则,如果 L 成功加载
className
且 X 是此类的实例,则结果为真。否则,如果 L 成功加载 N 和
className
,并且第二个类可从第一个类分配,则结果为真。否则,结果为假。
- 指定者:
isInstanceOf
在接口MBeanServerConnection
中- 参数:
name
- MBean 的ObjectName
。className
- 类的名称。- 返回:
- 如果根据上述规则指定的 MBean 是指定类的实例,则返回 true,否则返回 false。
- 抛出:
InstanceNotFoundException
- 指定的 MBean 未在 MBean 服务中注册。- 参见:
-
instantiate
使用在 MBean 服务的
Class Loader Repository
中注册的所有类加载器的列表实例化一个对象。对象的类应该有一个公共构造函数。此方法返回对新创建对象的引用。新创建的对象没有在 MBean 服务中注册。此方法等效于
instantiate(className, (Object[]) null, (String[]) null)
。- 参数:
className
- 要实例化的对象的类名。- 返回:
- 新实例化的对象。
- 抛出:
ReflectionException
- 包装在尝试调用对象的构造函数时发生的java.lang.ClassNotFoundException
或java.lang.Exception
。MBeanException
- 对象的构造函数抛出异常RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:传入参数的 className 为 null。
-
instantiate
Object instantiate(String className, ObjectName loaderName) throws ReflectionException , MBeanException , InstanceNotFoundException 使用由其
ObjectName
指定的类 Loader 实例化一个对象。如果加载程序名称为 null,则将使用加载 MBean Server 的 ClassLoader。对象的类应该有一个公共构造函数。此方法返回对新创建对象的引用。新创建的对象没有在 MBean 服务中注册。此方法等效于
instantiate(className, loaderName, (Object[]) null, (String[]) null)
。- 参数:
className
- 要实例化的 MBean 的类名。loaderName
- 要使用的类加载器的对象名称。- 返回:
- 新实例化的对象。
- 抛出:
ReflectionException
- 包装在尝试调用对象的构造函数时发生的java.lang.ClassNotFoundException
或java.lang.Exception
。MBeanException
- 对象的构造函数抛出异常。InstanceNotFoundException
- 指定的类加载器未在 MBeanServer 中注册。RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:传入参数的 className 为 null。
-
instantiate
Object instantiate(String className, Object [] params, String [] signature) throws ReflectionException , MBeanException 使用在 MBean 服务
Class Loader Repository
中注册的所有类加载器的列表实例化一个对象。对象的类应该有一个公共构造函数。该调用返回对新创建对象的引用。新创建的对象没有在 MBean 服务中注册。- 参数:
className
- 要实例化的对象的类名。params
- 包含要调用的构造函数参数的数组。signature
- 包含要调用的构造函数签名的数组。- 返回:
- 新实例化的对象。
- 抛出:
ReflectionException
- 包装在尝试调用对象的构造函数时发生的java.lang.ClassNotFoundException
或java.lang.Exception
。MBeanException
- 对象的构造函数抛出异常RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:传入参数的 className 为 null。
-
instantiate
Object instantiate(String className, ObjectName loaderName, Object [] params, String [] signature) throws ReflectionException , MBeanException , InstanceNotFoundException 实例化一个对象。要使用的类加载器由其对象名称标识。如果加载器的对象名称为空,则将使用加载 MBean 服务的 ClassLoader。对象的类应该有一个公共构造方法。该调用返回对新创建对象的引用。新创建的对象没有在 MBean 服务中注册。
- 参数:
className
- 要实例化的对象的类名。loaderName
- 要使用的类加载器的对象名称。params
- 包含要调用的构造函数参数的数组。signature
- 包含要调用的构造函数签名的数组。- 返回:
- 新实例化的对象。
- 抛出:
ReflectionException
- 包装在尝试调用对象的构造函数时发生的java.lang.ClassNotFoundException
或java.lang.Exception
。MBeanException
- 对象的构造函数抛出异常InstanceNotFoundException
- 指定的类加载器未在 MBean 服务中注册。RuntimeOperationsException
- 包装一个java.lang.IllegalArgumentException
:传入参数的 className 为 null。
-
deserialize
@Deprecated (since ="1.5") default ObjectInputStream deserialize(ObjectName name, byte[] data) throws InstanceNotFoundException , OperationsException 已弃用。使用getClassLoaderFor
获取适当的类加载器以进行反序列化。在 MBean 的类加载器的上下文中反序列化字节数组。
- 实现要求:
-
此方法默认抛出
UnsupportedOperationException
。 - 参数:
name
- 其类加载器应用于反序列化的 MBean 的名称。data
- 要反序列化的字节数组。- 返回:
- 反序列化的对象流。
- 抛出:
InstanceNotFoundException
- 未找到指定的 MBean。OperationsException
- 任何常见的输入/输出相关异常。
-
deserialize
@Deprecated (since ="1.5") default ObjectInputStream deserialize(String className, byte[] data) throws OperationsException , ReflectionException 已弃用。使用getClassLoaderRepository()
获取类加载器存储库并使用它进行反序列化。在给定 MBean 类加载器的上下文中反序列化字节数组。通过
Class Loader Repository
加载类className
找到类加载器。结果类的类加载器是要使用的类加载器。- 实现要求:
-
此方法默认抛出
UnsupportedOperationException
。 - 参数:
className
- 其类加载器应用于反序列化的类的名称。data
- 要反序列化的字节数组。- 返回:
- 反序列化的对象流。
- 抛出:
OperationsException
- 任何常见的输入/输出相关异常。ReflectionException
- 类加载器存储库无法加载指定的类
-
deserialize
@Deprecated (since ="1.5") default ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data) throws InstanceNotFoundException , OperationsException , ReflectionException 已弃用。使用getClassLoader
获取反序列化的类加载器。在给定 MBean 类加载器的上下文中反序列化字节数组。类加载器是加载名称为“className”的类的加载器。指定用于加载指定类的类加载器的名称。如果为 null,将使用 MBean Server 的类加载器。
- 实现要求:
-
此方法默认抛出
UnsupportedOperationException
。 - 参数:
className
- 其类加载器应用于反序列化的类的名称。loaderName
- 用于加载指定类的类加载器的名称。如果为 null,将使用 MBean Server 的类加载器。data
- 要反序列化的字节数组。- 返回:
- 反序列化的对象流。
- 抛出:
InstanceNotFoundException
- 未找到指定的类加载器 MBean。OperationsException
- 任何常见的输入/输出相关异常。ReflectionException
- 指定的类加载器无法加载指定的类。
-
getClassLoaderFor
返回用于加载指定 MBean 类的
ClassLoader
。- 参数:
mbeanName
- MBean 的 ObjectName。- 返回:
-
用于该 MBean 的 ClassLoader。如果l是 MBean 的实际 ClassLoader,并且r是返回值,则:
- r与l;或者
- 的结果r
.loadClass(s)
与l.loadClass(s)
用于任何字符串s.
- 抛出:
InstanceNotFoundException
- 如果未找到指定的 MBean。
-
getClassLoader
返回命名为
ClassLoader
。- 参数:
loaderName
- 类加载器的对象名称。可以为 null,在这种情况下返回 MBean 服务自己的 ClassLoader。- 返回:
-
命名的类加载器。如果l是具有该名称的实际 ClassLoader,并且r是返回值,则:
- r与l;或者
- 的结果r
.loadClass(s)
与l.loadClass(s)
用于任何字符串s.
- 抛出:
InstanceNotFoundException
- 如果未找到指定的 ClassLoader。
-
getClassLoaderRepository
ClassLoaderRepository getClassLoaderRepository()返回此 MBeanServer 的 ClassLoaderRepository。
- 返回:
- 此 MBeanServer 的 ClassLoaderRepository。
-
getClassLoaderRepository()
获取类加载器存储库并使用它进行反序列化。