Class AbstractRequestAttributesScope
java.lang.Object
org.springframework.web.context.request.AbstractRequestAttributesScope
- All Implemented Interfaces:
org.springframework.beans.factory.config.Scope
- Direct Known Subclasses:
RequestScope,SessionScope
public abstract class AbstractRequestAttributesScope
extends Object
implements org.springframework.beans.factory.config.Scope
Abstract
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 superclass.
- Since:
- 2.0
- Author:
- Rod Johnson, Juergen Hoeller, Rob Harrop
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract intgetScope()Template method that determines the actual target scope.voidregisterDestructionCallback(String name, Runnable callback) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.config.Scope
getConversationId
-
Constructor Details
-
AbstractRequestAttributesScope
public AbstractRequestAttributesScope()
-
-
Method Details
-
get
- Specified by:
getin interfaceorg.springframework.beans.factory.config.Scope
-
remove
- Specified by:
removein interfaceorg.springframework.beans.factory.config.Scope
-
registerDestructionCallback
- Specified by:
registerDestructionCallbackin interfaceorg.springframework.beans.factory.config.Scope
-
resolveContextualObject
- Specified by:
resolveContextualObjectin interfaceorg.springframework.beans.factory.config.Scope
-
getScope
protected abstract int getScope()Template method that determines the actual target scope.- Returns:
- the target scope, in the form of an appropriate
RequestAttributesconstant - See Also:
-