org.springframework.jmx.support

## 类 ConnectorServerFactoryBean

- java.lang.Object
- - org.springframework.jmx.support.MBeanRegistrationSupport
  - - org.springframework.jmx.support.ConnectorServerFactoryBean

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

      public class ConnectorServerFactoryBean
      extends MBeanRegistrationSupport
      implements org.springframework.beans.factory.FactoryBean<JMXConnectorServer>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean

  `FactoryBean` that creates a JSR-160 `JMXConnectorServer`, optionally registers it with the `MBeanServer` and then starts it.

  The `JMXConnectorServer` can be started in a separate thread by setting the `threaded` property to `true`. You can configure this thread to be a daemon thread by setting the `daemon` property to `true`.

  The `JMXConnectorServer` is correctly shutdown when an instance of this class is destroyed on shutdown of the containing `ApplicationContext`.

  从以下版本开始:
    1.2
  作者:
    Rob Harrop, Juergen Hoeller
  另请参阅:
    `JMXConnectorServer`, `MBeanServer`

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static String` | `DEFAULT_SERVICE_URL` The default service URL

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

      `logger, server`

  - ### 构造器概要

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

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `afterPropertiesSet()` Start the connector server.
    `void` | `destroy()` Stop the `JMXConnectorServer` managed by an instance of this class.
    `JMXConnectorServer` | `getObject()`
    `Class<? extends JMXConnectorServer>` | `getObjectType()`
    `boolean` | `isSingleton()`
    `void` | `setDaemon(boolean daemon)` Set whether any threads started for the `JMXConnectorServer` should be started as daemon threads.
    `void` | `setEnvironment(Properties environment)` Set the environment properties used to construct the `JMXConnectorServer` as `java.util.Properties` (String key/value pairs).
    `void` | `setEnvironmentMap(Map<String,?> environment)` Set the environment properties used to construct the `JMXConnector` as a `Map` of String keys and arbitrary Object values.
    `void` | `setForwarder(MBeanServerForwarder forwarder)` Set an MBeanServerForwarder to be applied to the `JMXConnectorServer`.
    `void` | `setObjectName(Object objectName)` Set the `ObjectName` used to register the `JMXConnectorServer` itself with the `MBeanServer`, as `ObjectName` instance or as `String`.
    `void` | `setServiceUrl(String serviceUrl)` Set the service URL for the `JMXConnectorServer`.
    `void` | `setThreaded(boolean threaded)` Set whether the `JMXConnectorServer` should be started in a separate thread.

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

      `doRegister, doUnregister, getRegisteredObjectNames, getServer, onRegister, onRegister, onUnregister, setRegistrationPolicy, setServer, unregisterBeans`

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

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

- - ### 字段详细资料

    - #### DEFAULT_SERVICE_URL

          public static final String DEFAULT_SERVICE_URL

      The default service URL
      另请参阅:
        常量字段值

  - ### 构造器详细资料

    - #### ConnectorServerFactoryBean

          public ConnectorServerFactoryBean()

  - ### 方法详细资料

    - #### setServiceUrl

          public void setServiceUrl(String serviceUrl)

      Set the service URL for the `JMXConnectorServer`.

    - #### setEnvironment

          public void setEnvironment(@Nullable
                                     Properties environment)

      Set the environment properties used to construct the `JMXConnectorServer` as `java.util.Properties` (String key/value pairs).

    - #### setEnvironmentMap

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

      Set the environment properties used to construct the `JMXConnector` as a `Map` of String keys and arbitrary Object values.

    - #### setForwarder

          public void setForwarder(MBeanServerForwarder forwarder)

      Set an MBeanServerForwarder to be applied to the `JMXConnectorServer`.

    - #### setObjectName

          public void setObjectName(Object objectName)
                             throws MalformedObjectNameException

      Set the `ObjectName` used to register the `JMXConnectorServer` itself with the `MBeanServer`, as `ObjectName` instance or as `String`.
      抛出:
        `MalformedObjectNameException` - if the `ObjectName` is malformed

    - #### setThreaded

          public void setThreaded(boolean threaded)

      Set whether the `JMXConnectorServer` should be started in a separate thread.

    - #### setDaemon

          public void setDaemon(boolean daemon)

      Set whether any threads started for the `JMXConnectorServer` should be started as daemon threads.

    - #### afterPropertiesSet

          public void afterPropertiesSet()
                                  throws JMException,
                                         IOException

      Start the connector server. If the `threaded` flag is set to `true`, the `JMXConnectorServer` will be started in a separate thread. If the `daemon` flag is set to `true`, that thread will be started as a daemon thread.
      指定者:
        `afterPropertiesSet` 在接口中 `org.springframework.beans.factory.InitializingBean`
      抛出:
        `JMException` - if a problem occurred when registering the connector server with the `MBeanServer`
        `IOException` - if there is a problem starting the connector server

    - #### getObject

          @Nullable
          public JMXConnectorServer getObject()

      指定者:
        `getObject` 在接口中 `org.springframework.beans.factory.FactoryBean<JMXConnectorServer>`

    - #### getObjectType

          public Class<? extends JMXConnectorServer> getObjectType()

      指定者:
        `getObjectType` 在接口中 `org.springframework.beans.factory.FactoryBean<JMXConnectorServer>`

    - #### isSingleton

          public boolean isSingleton()

      指定者:
        `isSingleton` 在接口中 `org.springframework.beans.factory.FactoryBean<JMXConnectorServer>`

    - #### destroy

          public void destroy()
                       throws IOException

      Stop the `JMXConnectorServer` managed by an instance of this class. Automatically called on `ApplicationContext` shutdown.
      指定者:
        `destroy` 在接口中 `org.springframework.beans.factory.DisposableBean`
      抛出:
        `IOException` - if there is an error stopping the connector server