org.springframework.jmx.access

## 类 NotificationListenerRegistrar

- java.lang.Object
- - org.springframework.jmx.support.NotificationListenerHolder
  - - org.springframework.jmx.access.NotificationListenerRegistrar

- 所有已实现的接口:
    org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

      public class NotificationListenerRegistrar
      extends NotificationListenerHolder
      implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean

  Registrar object that associates a specific `NotificationListener` with one or more MBeans in an `MBeanServer` (typically via a `MBeanServerConnection`).
  从以下版本开始:
    2.5.2
  作者:
    Juergen Hoeller
  另请参阅:
    `setServer(javax.management.MBeanServerConnection)`, `NotificationListenerHolder.setMappedObjectNames(java.lang.Object...)`, `NotificationListenerHolder.setNotificationListener(javax.management.NotificationListener)`

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `protected Log` | `logger` Logger available to subclasses

    - ### 从类继承的字段 org.springframework.jmx.support.NotificationListenerHolder

      `mappedObjectNames`

  - ### 构造器概要

    构造器
    构造器和说明
    `NotificationListenerRegistrar()`

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `afterPropertiesSet()`
    `void` | `destroy()` Unregisters the specified `NotificationListener`.
    `Map<String,?>` | `getEnvironment()` Allow Map access to the environment to be set for the connector, with the option to add or override specific entries.
    `void` | `prepare()` Registers the specified `NotificationListener`.
    `void` | `setAgentId(String agentId)` Set the agent id of the `MBeanServer` to locate.
    `void` | `setEnvironment(Map<String,?> environment)` Specify the environment for the JMX connector.
    `void` | `setServer(MBeanServerConnection server)` Set the `MBeanServerConnection` used to connect to the MBean which all invocations are routed to.
    `void` | `setServiceUrl(String url)` Set the service URL of the remote `MBeanServer`.

    - ### 从类继承的方法 org.springframework.jmx.support.NotificationListenerHolder

      `equals, getHandback, getNotificationFilter, getNotificationListener, getResolvedObjectNames, hashCode, setHandback, setMappedObjectName, setMappedObjectNames, setNotificationFilter, setNotificationListener`

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

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

- - ### 字段详细资料

    - #### logger

          protected final Log logger

      Logger available to subclasses

  - ### 构造器详细资料

    - #### NotificationListenerRegistrar

          public NotificationListenerRegistrar()

  - ### 方法详细资料

    - #### setServer

          public void setServer(MBeanServerConnection server)

      Set the `MBeanServerConnection` used to connect to the MBean which all invocations are routed to.

    - #### setEnvironment

          public void setEnvironment(@Nullable
                                     Map<String,?> environment)

      Specify the environment for the JMX connector.
      另请参阅:
        `JMXConnectorFactory.connect(javax.management.remote.JMXServiceURL, java.util.Map)`

    - #### getEnvironment

          @Nullable
          public Map<String,?> getEnvironment()

      Allow Map access to the environment to be set for the connector, with the option to add or override specific entries.

      Useful for specifying entries directly, for example via "environment[myKey]". This is particularly useful for adding or overriding entries in child bean definitions.

    - #### setServiceUrl

          public void setServiceUrl(String url)
                             throws MalformedURLException

      Set the service URL of the remote `MBeanServer`.
      抛出:
        `MalformedURLException`

    - #### setAgentId

          public void setAgentId(String agentId)

      Set the agent id of the `MBeanServer` to locate.

      Default is none. If specified, this will result in an attempt being made to locate the attendant MBeanServer, unless the `"serviceUrl"` property has been set.

      另请参阅:
        `

        Specifying the empty String indicates the platform MBeanServer.

        `

    - #### afterPropertiesSet

          public void afterPropertiesSet()

      指定者:
        `afterPropertiesSet` 在接口中 `org.springframework.beans.factory.InitializingBean`

    - #### prepare

          public void prepare()

      Registers the specified `NotificationListener`.

      Ensures that an `MBeanServerConnection` is configured and attempts to detect a local connection if one is not supplied.

    - #### destroy

          public void destroy()

      Unregisters the specified `NotificationListener`.
      指定者:
        `destroy` 在接口中 `org.springframework.beans.factory.DisposableBean`