Skip to content

Commit

Permalink
Rename checkpoint property to "spring.context.checkpoint"
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Jun 13, 2023
1 parent 85d8102 commit 1f068fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,24 @@
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());

Expand Down

0 comments on commit 1f068fc

Please sign in to comment.