public class SimpleThreadScope extends Object implements org.springframework.beans.factory.config.Scope
Scope
implementation.
Note: SimpleThreadScope
does not clean up
any objects associated with it. As such, it is typically preferable to
use RequestScope
in web environments.
For an implementation of a thread-based Scope
with support for
destruction callbacks, refer to the
Spring by Example Custom Thread Scope Module.
Thanks to Eugene Kuleshov for submitting the original prototype for a thread scope!
org.springframework.web.context.request.RequestScope
Constructor and Description |
---|
SimpleThreadScope() |
Modifier and Type | Method and Description |
---|---|
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) |
public Object get(String name, org.springframework.beans.factory.ObjectFactory<?> objectFactory)
get
in interface org.springframework.beans.factory.config.Scope
public Object remove(String name)
remove
in interface org.springframework.beans.factory.config.Scope
public void registerDestructionCallback(String name, Runnable callback)
registerDestructionCallback
in interface org.springframework.beans.factory.config.Scope
public Object resolveContextualObject(String key)
resolveContextualObject
in interface org.springframework.beans.factory.config.Scope
public String getConversationId()
getConversationId
in interface org.springframework.beans.factory.config.Scope