From 1f068fcdb8bc1b7fff390c46149ba459993a9f7e Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 13 Jun 2023 19:06:46 +0200 Subject: [PATCH] Rename checkpoint property to "spring.context.checkpoint" See gh-30606 --- .../pages/integration/checkpoint-restore.adoc | 2 +- .../support/DefaultLifecycleProcessor.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/integration/checkpoint-restore.adoc b/framework-docs/modules/ROOT/pages/integration/checkpoint-restore.adoc index a318994997..8fa733f756 100644 --- a/framework-docs/modules/ROOT/pages/integration/checkpoint-restore.adoc +++ b/framework-docs/modules/ROOT/pages/integration/checkpoint-restore.adoc @@ -24,7 +24,7 @@ NOTE: If the checkpoint is created on a warmed-up JVM, the restored JVM will be == Automatic checkpoint/restore at startup -When the `-Dspring.checkpoint.restore=onRefresh` Java system property is set, a checkpoint is created automatically during the startup at `LifecycleProcessor.onRefresh` level. At this phase, all non-lazy initialized singletons are instantiated, `InitializingBean.afterPropertiesSet` callbacks have been invoked, but not `Lifecycle.start` ones and `ContextRefreshedEvent` has not yet been published. +When the `-Dspring.context.checkpoint=onRefresh` Java system property is set, a checkpoint is created automatically during the startup at `LifecycleProcessor.onRefresh` level. At this phase, all non-lazy initialized singletons are instantiated, `InitializingBean.afterPropertiesSet` callbacks have been invoked, but not `Lifecycle.start` ones and `ContextRefreshedEvent` has not yet been published. WARNING: As mentioned above, and especially in use cases where the CRaC files are shipped as part of a deployable artifact (a container image for example), operate with the assumption that any sensitive data "seen" by the JVM ends up in the CRaC files, and assess carefully the related security implications. diff --git a/spring-context/src/main/java/org/springframework/context/support/DefaultLifecycleProcessor.java b/spring-context/src/main/java/org/springframework/context/support/DefaultLifecycleProcessor.java index d41e2533ff..c49a301938 100644 --- a/spring-context/src/main/java/org/springframework/context/support/DefaultLifecycleProcessor.java +++ b/spring-context/src/main/java/org/springframework/context/support/DefaultLifecycleProcessor.java @@ -68,24 +68,24 @@ import org.springframework.util.ClassUtils; public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactoryAware { /** - * Property name for checkpoint restore: {@value}. + * Property name for a common context checkpoint: {@value}. * @since 6.1 - * @see #CHECKPOINT_RESTORE_ON_REFRESH + * @see #CHECKPOINT_ON_REFRESH * @see org.crac.Core#checkpointRestore() */ - public static final String CHECKPOINT_RESTORE_PROPERTY_NAME = "spring.checkpoint.restore"; + public static final String CHECKPOINT_PROPERTY_NAME = "spring.context.checkpoint"; /** - * Recognized value for checkpoint restore property: {@value}. + * Recognized value for the context checkpoint property: {@value}. * @since 6.1 - * @see #CHECKPOINT_RESTORE_PROPERTY_NAME + * @see #CHECKPOINT_PROPERTY_NAME * @see org.crac.Core#checkpointRestore() */ - public static final String CHECKPOINT_RESTORE_ON_REFRESH = "onRefresh"; + public static final String CHECKPOINT_ON_REFRESH = "onRefresh"; - private final static boolean checkpointRestoreOnRefresh = CHECKPOINT_RESTORE_ON_REFRESH.equalsIgnoreCase( - SpringProperties.getProperty(CHECKPOINT_RESTORE_PROPERTY_NAME)); + private final static boolean checkpointRestoreOnRefresh = CHECKPOINT_ON_REFRESH.equalsIgnoreCase( + SpringProperties.getProperty(CHECKPOINT_PROPERTY_NAME)); private final Log logger = LogFactory.getLog(getClass());