org.springframework.context.support
Class SimpleThreadScope
java.lang.Object
org.springframework.context.support.SimpleThreadScope
- All Implemented Interfaces:
- org.springframework.beans.factory.config.Scope
public class SimpleThreadScope
- extends java.lang.Object
- implements org.springframework.beans.factory.config.Scope
Thread-backed Scope
implementation.
Note that the SimpleThreadScope
does not clean up any objects associated
with it. As such, it's typically preferable to use the org.springframework.web.context.request.RequestScope
in Web environments.
For a implementation of a thread-based Scope
with support for destruction callbacks, refer to this module.
Thanks to Eugene Kuleshov for submitting the original prototype for a thread scope!
- Since:
- 3.0
- Author:
- Arjen Poutsma, Juergen Hoeller
- See Also:
org.springframework.web.context.request.RequestScope
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleThreadScope
public SimpleThreadScope()
get
public java.lang.Object get(java.lang.String name,
org.springframework.beans.factory.ObjectFactory objectFactory)
- Specified by:
get
in interface org.springframework.beans.factory.config.Scope
remove
public java.lang.Object remove(java.lang.String name)
- Specified by:
remove
in interface org.springframework.beans.factory.config.Scope
registerDestructionCallback
public void registerDestructionCallback(java.lang.String name,
java.lang.Runnable callback)
- Specified by:
registerDestructionCallback
in interface org.springframework.beans.factory.config.Scope
resolveContextualObject
public java.lang.Object resolveContextualObject(java.lang.String key)
- Specified by:
resolveContextualObject
in interface org.springframework.beans.factory.config.Scope
getConversationId
public java.lang.String getConversationId()
- Specified by:
getConversationId
in interface org.springframework.beans.factory.config.Scope