Skip to content

Commit e590341

Browse files
committed
Revise Javadoc regarding new ApplicationContext pause() support
See gh-35269
1 parent 4bfc129 commit e590341

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life
223223
/**
224224
* Pause all beans in this application context if necessary, and subsequently
225225
* restart all auto-startup beans, effectively restoring the lifecycle state
226-
* after {@link #refresh()} (typically after a preceding {@link #stop()} call
226+
* after {@link #refresh()} (typically after a preceding {@link #pause()} call
227227
* when a full {@link #start()} of even lazy-starting beans is to be avoided).
228228
* @since 7.0
229229
* @see #pause()

spring-context/src/main/java/org/springframework/context/event/ContextPausedEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
public class ContextPausedEvent extends ContextStoppedEvent {
3636

3737
/**
38-
* Create a new {@code ContextRestartedEvent}.
39-
* @param source the {@code ContextPausedEvent} that has been restarted
38+
* Create a new {@code ContextPausedEvent}.
39+
* @param source the {@code ApplicationContext} that has been paused
4040
* (must not be {@code null})
4141
*/
4242
public ContextPausedEvent(ApplicationContext source) {

spring-test/src/main/java/org/springframework/test/context/CacheAwareContextLoaderDelegate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ default void registerContextUsage(MergedContextConfiguration key, Class<?> testC
169169
* for the supplied {@link MergedContextConfiguration} as well as usage of the
170170
* application context for its {@linkplain MergedContextConfiguration#getParent()
171171
* parent}, recursively.
172-
* <p>This informs the {@code ContextCache} that the application context(s) can
173-
* be safely {@linkplain org.springframework.context.Lifecycle#stop() stopped}
172+
* <p>This informs the {@code ContextCache} that the application context(s) can be safely
173+
* {@linkplain org.springframework.context.ConfigurableApplicationContext#pause() paused}
174174
* if no other test classes are actively using the same application context(s).
175175
* @param key the context key; never {@code null}
176176
* @param testClass the test class that is no longer using the application context(s)

spring-test/src/main/java/org/springframework/test/context/TestContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ default void publishEvent(Function<TestContext, ? extends ApplicationEvent> even
135135
* Call this method to signal that the {@linkplain #getTestClass() test class}
136136
* is no longer using the {@linkplain ApplicationContext application context}
137137
* associated with this test context.
138-
* <p>This informs the context cache that the application context can be
139-
* safely {@linkplain org.springframework.context.Lifecycle#stop() stopped}
138+
* <p>This informs the context cache that the application context can be safely
139+
* {@linkplain org.springframework.context.ConfigurableApplicationContext#pause() paused}
140140
* if no other test classes are actively using the same application context.
141141
* <p>This method is intended to be invoked after execution of the test class
142142
* has ended and should not be invoked unless the application context for this

spring-test/src/main/java/org/springframework/test/context/support/DefaultTestContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ public ApplicationContext getApplicationContext() {
143143
/**
144144
* Mark the {@linkplain ApplicationContext application context} associated
145145
* with this test context as <em>unused</em> so that it can be safely
146-
* {@linkplain org.springframework.context.Lifecycle#stop() stopped} if no
147-
* other test classes are actively using the same application context.
146+
* {@linkplain org.springframework.context.ConfigurableApplicationContext#pause() paused}
147+
* if no other test classes are actively using the same application context.
148148
* <p>The default implementation delegates to the {@link CacheAwareContextLoaderDelegate}
149149
* that was supplied when this {@code TestContext} was constructed.
150150
* @since 7.0

spring-test/src/test/java/org/springframework/test/context/cache/EventTracker.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
import org.springframework.context.ApplicationEvent;
2323
import org.springframework.context.event.ApplicationContextEvent;
2424
import org.springframework.context.event.ContextClosedEvent;
25+
import org.springframework.context.event.ContextPausedEvent;
2526
import org.springframework.context.event.ContextRefreshedEvent;
2627
import org.springframework.context.event.ContextRestartedEvent;
27-
import org.springframework.context.event.ContextStoppedEvent;
2828
import org.springframework.context.event.EventListener;
2929
import org.springframework.stereotype.Component;
3030
import org.springframework.test.context.event.TestContextEvent;
@@ -51,8 +51,8 @@ void contextRestarted(ContextRestartedEvent event) {
5151
trackApplicationContextEvent(event);
5252
}
5353

54-
@EventListener(ContextStoppedEvent.class)
55-
void contextStopped(ContextStoppedEvent event) {
54+
@EventListener(ContextPausedEvent.class)
55+
void contextPaused(ContextPausedEvent event) {
5656
trackApplicationContextEvent(event);
5757
}
5858

0 commit comments

Comments
 (0)