Skip to content

Commit db4882c

Browse files
committed
Polishing
1 parent 833ed71 commit db4882c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

spring-test/src/main/java/org/springframework/test/context/cache/ContextCache.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,8 +22,8 @@
2222

2323
/**
2424
* {@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>.
2727
*
2828
* <p>A {@code ContextCache} maintains a cache of {@code ApplicationContexts}
2929
* keyed by {@link MergedContextConfiguration} instances.
@@ -47,7 +47,7 @@ public interface ContextCache {
4747
* The name of the logging category used for reporting {@code ContextCache}
4848
* statistics.
4949
*/
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";
5151

5252

5353
/**
@@ -59,8 +59,8 @@ public interface ContextCache {
5959

6060
/**
6161
* 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.
6464
* @param key the context key (never {@code null})
6565
* @return the corresponding {@code ApplicationContext} instance, or {@code null}
6666
* if not found in the cache
@@ -70,7 +70,7 @@ public interface ContextCache {
7070

7171
/**
7272
* 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.
7474
* @param key the context key (never {@code null})
7575
* @param context the {@code ApplicationContext} instance (never {@code null})
7676
*/
@@ -80,9 +80,10 @@ public interface ContextCache {
8080
* Remove the context with the given key from the cache and explicitly
8181
* {@linkplain org.springframework.context.ConfigurableApplicationContext#close() close}
8282
* 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.
8687
* <p>In addition, the semantics of the supplied {@code HierarchyMode} must
8788
* be honored. See the Javadoc for {@link HierarchyMode} for details.
8889
* @param key the context key; never {@code null}

0 commit comments

Comments
 (0)