org.springframework.context.support

## 类 SimpleThreadScope

- java.lang.Object
- - org.springframework.context.support.SimpleThreadScope

- 所有已实现的接口:
    org.springframework.beans.factory.config.Scope

      public class SimpleThreadScope
      extends Object
      implements org.springframework.beans.factory.config.Scope

  A simple thread-backed `Scope` implementation.

  NOTE: This thread scope is not registered by default in common contexts. Instead, you need to explicitly assign it to a scope key in your setup, either through `ConfigurableBeanFactory.registerScope(java.lang.String, org.springframework.beans.factory.config.Scope)` or through a `CustomScopeConfigurer` bean.

  `SimpleThreadScope` does not clean up any objects associated with it. It is therefore typically preferable to use a request-bound scope implementation such as `org.springframework.web.context.request.RequestScope` in web environments, implementing the full lifecycle for scoped attributes (including reliable destruction).

  For an implementation of a thread-based `Scope` with support for destruction callbacks, refer to Spring by Example.

  Thanks to Eugene Kuleshov for submitting the original prototype for a thread scope!

  从以下版本开始:
    3.0
  作者:
    Arjen Poutsma, Juergen Hoeller
  另请参阅:
    `org.springframework.web.context.request.RequestScope`

- - ### 构造器概要

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

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `Object` | `get(String name, org.springframework.beans.factory.ObjectFactory<?> objectFactory)`
    `String` | `getConversationId()`
    `void` | `registerDestructionCallback(String name, Runnable callback)`
    `Object` | `remove(String name)`
    `Object` | `resolveContextualObject(String key)`

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

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

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

    - #### SimpleThreadScope

          public SimpleThreadScope()

  - ### 方法详细资料

    - #### get

          public Object get(String name,
                            org.springframework.beans.factory.ObjectFactory<?> objectFactory)

      指定者:
        `get` 在接口中 `org.springframework.beans.factory.config.Scope`

    - #### remove

          @Nullable
          public Object remove(String name)

      指定者:
        `remove` 在接口中 `org.springframework.beans.factory.config.Scope`

    - #### registerDestructionCallback

          public void registerDestructionCallback(String name,
                                                  Runnable callback)

      指定者:
        `registerDestructionCallback` 在接口中 `org.springframework.beans.factory.config.Scope`

    - #### resolveContextualObject

          @Nullable
          public Object resolveContextualObject(String key)

      指定者:
        `resolveContextualObject` 在接口中 `org.springframework.beans.factory.config.Scope`

    - #### getConversationId

          public String getConversationId()

      指定者:
        `getConversationId` 在接口中 `org.springframework.beans.factory.config.Scope`