public abstract class AbstractRequestAttributesScope
extends java.lang.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 |
---|---|
java.lang.Object |
get(java.lang.String name,
org.springframework.beans.factory.ObjectFactory<?> objectFactory) |
protected abstract int |
getScope()
Template method that determines the actual target scope.
|
void |
registerDestructionCallback(java.lang.String name,
java.lang.Runnable callback) |
java.lang.Object |
remove(java.lang.String name) |
java.lang.Object |
resolveContextualObject(java.lang.String key) |
public java.lang.Object get(java.lang.String name, org.springframework.beans.factory.ObjectFactory<?> objectFactory)
get
in interface org.springframework.beans.factory.config.Scope
@Nullable public java.lang.Object remove(java.lang.String name)
remove
in interface org.springframework.beans.factory.config.Scope
public void registerDestructionCallback(java.lang.String name, java.lang.Runnable callback)
registerDestructionCallback
in interface org.springframework.beans.factory.config.Scope
@Nullable public java.lang.Object resolveContextualObject(java.lang.String key)
resolveContextualObject
in interface org.springframework.beans.factory.config.Scope
protected abstract int getScope()
RequestAttributes
constantRequestAttributes.SCOPE_REQUEST
,
RequestAttributes.SCOPE_SESSION