mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-24 15:49:26 +00:00
Revise Javadoc regarding new ApplicationContext pause() support
See gh-35269
This commit is contained in:
+1
-1
@@ -223,7 +223,7 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life
|
||||
/**
|
||||
* Pause all beans in this application context if necessary, and subsequently
|
||||
* restart all auto-startup beans, effectively restoring the lifecycle state
|
||||
* after {@link #refresh()} (typically after a preceding {@link #stop()} call
|
||||
* after {@link #refresh()} (typically after a preceding {@link #pause()} call
|
||||
* when a full {@link #start()} of even lazy-starting beans is to be avoided).
|
||||
* @since 7.0
|
||||
* @see #pause()
|
||||
|
||||
+2
-2
@@ -35,8 +35,8 @@ import org.springframework.context.ConfigurableApplicationContext;
|
||||
public class ContextPausedEvent extends ContextStoppedEvent {
|
||||
|
||||
/**
|
||||
* Create a new {@code ContextRestartedEvent}.
|
||||
* @param source the {@code ContextPausedEvent} that has been restarted
|
||||
* Create a new {@code ContextPausedEvent}.
|
||||
* @param source the {@code ApplicationContext} that has been paused
|
||||
* (must not be {@code null})
|
||||
*/
|
||||
public ContextPausedEvent(ApplicationContext source) {
|
||||
|
||||
+2
-2
@@ -169,8 +169,8 @@ public interface CacheAwareContextLoaderDelegate {
|
||||
* for the supplied {@link MergedContextConfiguration} as well as usage of the
|
||||
* application context for its {@linkplain MergedContextConfiguration#getParent()
|
||||
* parent}, recursively.
|
||||
* <p>This informs the {@code ContextCache} that the application context(s) can
|
||||
* be safely {@linkplain org.springframework.context.Lifecycle#stop() stopped}
|
||||
* <p>This informs the {@code ContextCache} that the application context(s) can be safely
|
||||
* {@linkplain org.springframework.context.ConfigurableApplicationContext#pause() paused}
|
||||
* if no other test classes are actively using the same application context(s).
|
||||
* @param key the context key; never {@code null}
|
||||
* @param testClass the test class that is no longer using the application context(s)
|
||||
|
||||
@@ -135,8 +135,8 @@ public interface TestContext extends AttributeAccessor, Serializable {
|
||||
* Call this method to signal that the {@linkplain #getTestClass() test class}
|
||||
* is no longer using the {@linkplain ApplicationContext application context}
|
||||
* associated with this test context.
|
||||
* <p>This informs the context cache that the application context can be
|
||||
* safely {@linkplain org.springframework.context.Lifecycle#stop() stopped}
|
||||
* <p>This informs the context cache that the application context can be safely
|
||||
* {@linkplain org.springframework.context.ConfigurableApplicationContext#pause() paused}
|
||||
* if no other test classes are actively using the same application context.
|
||||
* <p>This method is intended to be invoked after execution of the test class
|
||||
* has ended and should not be invoked unless the application context for this
|
||||
|
||||
+2
-2
@@ -143,8 +143,8 @@ public class DefaultTestContext implements TestContext {
|
||||
/**
|
||||
* Mark the {@linkplain ApplicationContext application context} associated
|
||||
* with this test context as <em>unused</em> so that it can be safely
|
||||
* {@linkplain org.springframework.context.Lifecycle#stop() stopped} if no
|
||||
* other test classes are actively using the same application context.
|
||||
* {@linkplain org.springframework.context.ConfigurableApplicationContext#pause() paused}
|
||||
* if no other test classes are actively using the same application context.
|
||||
* <p>The default implementation delegates to the {@link CacheAwareContextLoaderDelegate}
|
||||
* that was supplied when this {@code TestContext} was constructed.
|
||||
* @since 7.0
|
||||
|
||||
+3
-3
@@ -22,9 +22,9 @@ import java.util.List;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.context.event.ApplicationContextEvent;
|
||||
import org.springframework.context.event.ContextClosedEvent;
|
||||
import org.springframework.context.event.ContextPausedEvent;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.context.event.ContextRestartedEvent;
|
||||
import org.springframework.context.event.ContextStoppedEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.test.context.event.TestContextEvent;
|
||||
@@ -51,8 +51,8 @@ class EventTracker {
|
||||
trackApplicationContextEvent(event);
|
||||
}
|
||||
|
||||
@EventListener(ContextStoppedEvent.class)
|
||||
void contextStopped(ContextStoppedEvent event) {
|
||||
@EventListener(ContextPausedEvent.class)
|
||||
void contextPaused(ContextPausedEvent event) {
|
||||
trackApplicationContextEvent(event);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user