1
1
/*
2
- * Copyright 2002-2015 the original author or authors.
2
+ * Copyright 2002-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
22
22
23
23
/**
24
24
* {@code ContextCache} defines the SPI for caching Spring
25
- * {@link ApplicationContext ApplicationContexts} within the <em>Spring
26
- * TestContext Framework</em>.
25
+ * {@link ApplicationContext ApplicationContexts} within the
26
+ * <em>Spring TestContext Framework</em>.
27
27
*
28
28
* <p>A {@code ContextCache} maintains a cache of {@code ApplicationContexts}
29
29
* keyed by {@link MergedContextConfiguration} instances.
@@ -47,7 +47,7 @@ public interface ContextCache {
47
47
* The name of the logging category used for reporting {@code ContextCache}
48
48
* statistics.
49
49
*/
50
- public static final String CONTEXT_CACHE_LOGGING_CATEGORY = "org.springframework.test.context.cache" ;
50
+ String CONTEXT_CACHE_LOGGING_CATEGORY = "org.springframework.test.context.cache" ;
51
51
52
52
53
53
/**
@@ -59,8 +59,8 @@ public interface ContextCache {
59
59
60
60
/**
61
61
* Obtain a cached {@code ApplicationContext} for the given key.
62
- * <p>The {@link #getHitCount() hit} and {@link #getMissCount() miss} counts
63
- * must be updated accordingly.
62
+ * <p>The {@linkplain #getHitCount() hit} and {@linkplain #getMissCount() miss}
63
+ * counts must be updated accordingly.
64
64
* @param key the context key (never {@code null})
65
65
* @return the corresponding {@code ApplicationContext} instance, or {@code null}
66
66
* if not found in the cache
@@ -70,7 +70,7 @@ public interface ContextCache {
70
70
71
71
/**
72
72
* Explicitly add an {@code ApplicationContext} instance to the cache
73
- * under the given key.
73
+ * under the given key, potentially honoring a custom eviction policy .
74
74
* @param key the context key (never {@code null})
75
75
* @param context the {@code ApplicationContext} instance (never {@code null})
76
76
*/
@@ -80,9 +80,10 @@ public interface ContextCache {
80
80
* Remove the context with the given key from the cache and explicitly
81
81
* {@linkplain org.springframework.context.ConfigurableApplicationContext#close() close}
82
82
* it if it is an instance of {@code ConfigurableApplicationContext}.
83
- * <p>Generally speaking, this method should be called if the state of
84
- * a singleton bean has been modified, potentially affecting future
85
- * interaction with the context.
83
+ * <p>Generally speaking, this method should be called to properly evict
84
+ * a context from the cache (e.g., due to a custom eviction policy) or if
85
+ * the state of a singleton bean has been modified, potentially affecting
86
+ * future interaction with the context.
86
87
* <p>In addition, the semantics of the supplied {@code HierarchyMode} must
87
88
* be honored. See the Javadoc for {@link HierarchyMode} for details.
88
89
* @param key the context key; never {@code null}
0 commit comments