public abstract class AbstractRequestAttributesScope extends Object implements org.springframework.beans.factory.config.Scope
Scope
implementation that reads from a particular scope
in the current thread-bound RequestAttributes
object.
Subclasses simply need to implement getScope()
to instruct
this class which RequestAttributes
scope to read attributes from.
Subclasses may wish to override the get(java.lang.String, org.springframework.beans.factory.ObjectFactory<?>)
and remove(java.lang.String)
methods to add synchronization around the call back into this super class.
Constructor and Description |
---|
AbstractRequestAttributesScope() |
Modifier and Type | Method and Description |
---|---|
Object |
get(String name,
org.springframework.beans.factory.ObjectFactory<?> objectFactory) |
protected abstract int |
getScope()
Template method that determines the actual target scope.
|
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
protected abstract int getScope()
RequestAttributes
constantRequestAttributes.SCOPE_REQUEST
,
RequestAttributes.SCOPE_SESSION
,
RequestAttributes.SCOPE_GLOBAL_SESSION