org.springframework.remoting.support

## 类 SimpleHttpServerFactoryBean

- java.lang.Object
- - org.springframework.remoting.support.SimpleHttpServerFactoryBean

- 所有已实现的接口:
    org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<com.sun.net.httpserver.HttpServer>, org.springframework.beans.factory.InitializingBean

      @UsesSunHttpServer
      public class SimpleHttpServerFactoryBean
      extends Object
      implements org.springframework.beans.factory.FactoryBean<com.sun.net.httpserver.HttpServer>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean

  `FactoryBean` that creates a simple HTTP server, based on the HTTP server that is included in Sun's JRE 1.6. Starts the HTTP server on initialization and stops it on destruction. Exposes the resulting `HttpServer` object.

  Allows for registering `HttpHandlers` for specific `context paths`. Alternatively, register such context-specific handlers programmatically on the `HttpServer` itself.

  从以下版本开始:
    2.5.1
  作者:
    Juergen Hoeller, Arjen Poutsma
  另请参阅:
    `setPort(int)`, `setContexts(java.util.Map<java.lang.String, com.sun.net.httpserver.HttpHandler>)`

- - ### 字段概要

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

  - ### 构造器概要

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

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `afterPropertiesSet()`
    `void` | `destroy()`
    `com.sun.net.httpserver.HttpServer` | `getObject()`
    `Class<? extends com.sun.net.httpserver.HttpServer>` | `getObjectType()`
    `boolean` | `isSingleton()`
    `void` | `setAuthenticator(com.sun.net.httpserver.Authenticator authenticator)` Register a common `Authenticator` to be applied to all locally registered `contexts`.
    `void` | `setBacklog(int backlog)` Specify the HTTP server's TCP backlog.
    `void` | `setContexts(Map<String,com.sun.net.httpserver.HttpHandler> contexts)` Register `HttpHandlers` for specific context paths.
    `void` | `setExecutor(Executor executor)` Set the JDK concurrent executor to use for dispatching incoming requests.
    `void` | `setFilters(List<com.sun.net.httpserver.Filter> filters)` Register common `Filters` to be applied to all locally registered `contexts`.
    `void` | `setHostname(String hostname)` Specify the HTTP server's hostname to bind to.
    `void` | `setPort(int port)` Specify the HTTP server's port.
    `void` | `setShutdownDelay(int shutdownDelay)` Specify the number of seconds to wait until HTTP exchanges have completed when shutting down the HTTP server.

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

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

- - ### 字段详细资料

    - #### logger

          protected final Log logger

  - ### 构造器详细资料

    - #### SimpleHttpServerFactoryBean

          public SimpleHttpServerFactoryBean()

  - ### 方法详细资料

    - #### setPort

          public void setPort(int port)

      Specify the HTTP server's port. Default is 8080.

    - #### setHostname

          public void setHostname(String hostname)

      Specify the HTTP server's hostname to bind to. Default is localhost; can be overridden with a specific network address to bind to.

    - #### setBacklog

          public void setBacklog(int backlog)

      Specify the HTTP server's TCP backlog. Default is -1, indicating the system's default value.

    - #### setShutdownDelay

          public void setShutdownDelay(int shutdownDelay)

      Specify the number of seconds to wait until HTTP exchanges have completed when shutting down the HTTP server. Default is 0.

    - #### setExecutor

          public void setExecutor(Executor executor)

      Set the JDK concurrent executor to use for dispatching incoming requests.
      另请参阅:
        `HttpServer.setExecutor(java.util.concurrent.Executor)`

    - #### setContexts

          public void setContexts(Map<String,com.sun.net.httpserver.HttpHandler> contexts)

      Register `HttpHandlers` for specific context paths.
      参数:
        `contexts` - a Map with context paths as keys and HttpHandler objects as values
      另请参阅:
        `org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter`, `org.springframework.remoting.caucho.SimpleHessianServiceExporter`

    - #### setFilters

          public void setFilters(List<com.sun.net.httpserver.Filter> filters)

      Register common `Filters` to be applied to all locally registered `contexts`.

    - #### setAuthenticator

          public void setAuthenticator(com.sun.net.httpserver.Authenticator authenticator)

      Register a common `Authenticator` to be applied to all locally registered `contexts`.

    - #### afterPropertiesSet

          public void afterPropertiesSet()
                                  throws IOException

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

    - #### getObject

          public com.sun.net.httpserver.HttpServer getObject()

      指定者:
        `getObject` 在接口中 `org.springframework.beans.factory.FactoryBean<com.sun.net.httpserver.HttpServer>`

    - #### getObjectType

          public Class<? extends com.sun.net.httpserver.HttpServer> getObjectType()

      指定者:
        `getObjectType` 在接口中 `org.springframework.beans.factory.FactoryBean<com.sun.net.httpserver.HttpServer>`

    - #### isSingleton

          public boolean isSingleton()

      指定者:
        `isSingleton` 在接口中 `org.springframework.beans.factory.FactoryBean<com.sun.net.httpserver.HttpServer>`

    - #### destroy

          public void destroy()

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