Class ThreadLocalScopeCache
java.lang.Object
org.springframework.cloud.context.scope.thread.ThreadLocalScopeCache
- All Implemented Interfaces:
ScopeCache
- Author:
- Dave Syer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclear()Clears the cache and returns all objects in an unmodifiable collection.Gets the named object from the cache.Put a value in the cache if the key is not already used.Removes the object with this name from the cache.
-
Constructor Details
-
ThreadLocalScopeCache
public ThreadLocalScopeCache()
-
-
Method Details
-
remove
Description copied from interface:ScopeCacheRemoves the object with this name from the cache.- Specified by:
removein interfaceScopeCache- Parameters:
name- The object name.- Returns:
- The object removed, or null if there was none.
-
clear
Description copied from interface:ScopeCacheClears the cache and returns all objects in an unmodifiable collection.- Specified by:
clearin interfaceScopeCache- Returns:
- All objects stored in the cache.
-
get
Description copied from interface:ScopeCacheGets the named object from the cache.- Specified by:
getin interfaceScopeCache- Parameters:
name- The name of the object.- Returns:
- The object with that name, or null if there is none.
-
put
Description copied from interface:ScopeCachePut a value in the cache if the key is not already used. If one is already present with the name provided, it is not replaced, but is returned to the caller.- Specified by:
putin interfaceScopeCache- Parameters:
name- The key.value- The new candidate value.- Returns:
- The value that is in the cache at the end of the operation.
-