Class StandardScopeCache
java.lang.Object
org.springframework.cloud.context.scope.StandardScopeCache
- All Implemented Interfaces:
ScopeCache
A simple cache implementation backed by a concurrent map.
- 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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.cloud.context.scope.ScopeCache
requiresLocking
-
Constructor Details
-
StandardScopeCache
public StandardScopeCache()
-
-
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.
-