open class DefaultContextCache : ContextCache
Default implementation of the ContextCache API.
Uses a synchronized Map configured with a maximum size and a least recently used (LRU) eviction policy to cache ApplicationContext instances.
The maximum size may be supplied as a constructor argument or set via a system property or Spring property named spring.test.context.cache.maxSize.
Author
Sam Brannen
Author
Juergen Hoeller
Since
2.5
See Also
ContextCacheUtils#retrieveMaxCacheSize()
DefaultContextCache()
Create a new DefaultContextCache(maxSize: Int)
Create a new |
open fun clear(): Unit
{@inheritDoc} |
|
open fun clearStatistics(): Unit
{@inheritDoc} |
|
open fun contains(key: MergedContextConfiguration): Boolean
{@inheritDoc} |
|
open fun get(key: MergedContextConfiguration): ApplicationContext
{@inheritDoc} |
|
open fun getHitCount(): Int
{@inheritDoc} |
|
open fun getMaxSize(): Int
Get the maximum size of this cache. |
|
open fun getMissCount(): Int
{@inheritDoc} |
|
open fun getParentContextCount(): Int
{@inheritDoc} |
|
open fun logStatistics(): Unit
{@inheritDoc} |
|
open fun put(key: MergedContextConfiguration, context: ApplicationContext): Unit
{@inheritDoc} |
|
open fun remove(key: MergedContextConfiguration, hierarchyMode: HierarchyMode): Unit
{@inheritDoc} |
|
open fun reset(): Unit
{@inheritDoc} |
|
open fun size(): Int
{@inheritDoc} |
|
open fun toString(): String
Generate a text string containing the implementation type of this cache and its statistics. The string returned by this method contains all information required for compliance with the contract for |