org.springframework.jmx.export

## 类 SpringModelMBean

- java.lang.Object
- - javax.management.modelmbean.RequiredModelMBean
  - - org.springframework.jmx.export.SpringModelMBean

- 所有已实现的接口:
    DynamicMBean, MBeanRegistration, ModelMBean, ModelMBeanNotificationBroadcaster, NotificationBroadcaster, NotificationEmitter, PersistentMBean

      public class SpringModelMBean
      extends RequiredModelMBean

  Extension of the `RequiredModelMBean` class that ensures the `thread context ClassLoader` is switched for the managed resource's `ClassLoader` before any invocations occur.
  从以下版本开始:
    2.0
  作者:
    Rob Harrop
  另请参阅:
    `RequiredModelMBean`

- - ### 构造器概要

    构造器
    构造器和说明
    `SpringModelMBean()` Construct a new SpringModelMBean instance with an empty `ModelMBeanInfo`.
    `SpringModelMBean(ModelMBeanInfo mbi)` Construct a new SpringModelMBean instance with the given `ModelMBeanInfo`.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `Object` | `getAttribute(String attrName)` Switches the `context ClassLoader` for the managed resources `ClassLoader` before allowing the invocation to occur.
    `AttributeList` | `getAttributes(String[] attrNames)` Switches the `context ClassLoader` for the managed resources `ClassLoader` before allowing the invocation to occur.
    `Object` | `invoke(String opName, Object[] opArgs, String[] sig)` Switches the `context ClassLoader` for the managed resources `ClassLoader` before allowing the invocation to occur.
    `void` | `setAttribute(Attribute attribute)` Switches the `context ClassLoader` for the managed resources `ClassLoader` before allowing the invocation to occur.
    `AttributeList` | `setAttributes(AttributeList attributes)` Switches the `context ClassLoader` for the managed resources `ClassLoader` before allowing the invocation to occur.
    `void` | `setManagedResource(Object managedResource, String managedResourceType)` Sets managed resource to expose and stores its `ClassLoader`.

    - ### 从类继承的方法 javax.management.modelmbean.RequiredModelMBean

      `addAttributeChangeNotificationListener, addNotificationListener, getClassLoaderRepository, getMBeanInfo, getNotificationInfo, load, postDeregister, postRegister, preDeregister, preRegister, removeAttributeChangeNotificationListener, removeNotificationListener, removeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotification, setModelMBeanInfo, store`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### SpringModelMBean

          public SpringModelMBean()
                           throws MBeanException,
                                  RuntimeOperationsException

      Construct a new SpringModelMBean instance with an empty `ModelMBeanInfo`.
      抛出:
        `MBeanException`
        `RuntimeOperationsException`
      另请参阅:
        `RequiredModelMBean.RequiredModelMBean()`

    - #### SpringModelMBean

          public SpringModelMBean(ModelMBeanInfo mbi)
                           throws MBeanException,
                                  RuntimeOperationsException

      Construct a new SpringModelMBean instance with the given `ModelMBeanInfo`.
      抛出:
        `MBeanException`
        `RuntimeOperationsException`
      另请参阅:
        `RequiredModelMBean.RequiredModelMBean(ModelMBeanInfo)`

  - ### 方法详细资料

    - #### setManagedResource

          public void setManagedResource(Object managedResource,
                                         String managedResourceType)
                                  throws MBeanException,
                                         InstanceNotFoundException,
                                         InvalidTargetObjectTypeException

      Sets managed resource to expose and stores its `ClassLoader`.
      指定者:
        `setManagedResource` 在接口中 `ModelMBean`
      覆盖:
        `setManagedResource` 在类中 `RequiredModelMBean`
      抛出:
        `MBeanException`
        `InstanceNotFoundException`
        `InvalidTargetObjectTypeException`

    - #### invoke

          public Object invoke(String opName,
                               Object[] opArgs,
                               String[] sig)
                        throws MBeanException,
                               ReflectionException

      Switches the `context ClassLoader` for the managed resources `ClassLoader` before allowing the invocation to occur.
      指定者:
        `invoke` 在接口中 `DynamicMBean`
      覆盖:
        `invoke` 在类中 `RequiredModelMBean`
      抛出:
        `MBeanException`
        `ReflectionException`
      另请参阅:
        `DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[])`

    - #### getAttribute

          public Object getAttribute(String attrName)
                              throws AttributeNotFoundException,
                                     MBeanException,
                                     ReflectionException

      Switches the `context ClassLoader` for the managed resources `ClassLoader` before allowing the invocation to occur.
      指定者:
        `getAttribute` 在接口中 `DynamicMBean`
      覆盖:
        `getAttribute` 在类中 `RequiredModelMBean`
      抛出:
        `AttributeNotFoundException`
        `MBeanException`
        `ReflectionException`
      另请参阅:
        `DynamicMBean.getAttribute(java.lang.String)`

    - #### getAttributes

          public AttributeList getAttributes(String[] attrNames)

      Switches the `context ClassLoader` for the managed resources `ClassLoader` before allowing the invocation to occur.
      指定者:
        `getAttributes` 在接口中 `DynamicMBean`
      覆盖:
        `getAttributes` 在类中 `RequiredModelMBean`
      另请参阅:
        `DynamicMBean.getAttributes(java.lang.String[])`

    - #### setAttribute

          public void setAttribute(Attribute attribute)
                            throws AttributeNotFoundException,
                                   InvalidAttributeValueException,
                                   MBeanException,
                                   ReflectionException

      Switches the `context ClassLoader` for the managed resources `ClassLoader` before allowing the invocation to occur.
      指定者:
        `setAttribute` 在接口中 `DynamicMBean`
      覆盖:
        `setAttribute` 在类中 `RequiredModelMBean`
      抛出:
        `AttributeNotFoundException`
        `InvalidAttributeValueException`
        `MBeanException`
        `ReflectionException`
      另请参阅:
        `DynamicMBean.setAttribute(javax.management.Attribute)`

    - #### setAttributes

          public AttributeList setAttributes(AttributeList attributes)

      Switches the `context ClassLoader` for the managed resources `ClassLoader` before allowing the invocation to occur.
      指定者:
        `setAttributes` 在接口中 `DynamicMBean`
      覆盖:
        `setAttributes` 在类中 `RequiredModelMBean`
      另请参阅:
        `DynamicMBean.setAttributes(javax.management.AttributeList)`