Class HikariCheckpointRestoreLifecycle

java.lang.Object
org.springframework.boot.jdbc.HikariCheckpointRestoreLifecycle
All Implemented Interfaces:
org.springframework.context.Lifecycle

public class HikariCheckpointRestoreLifecycle extends Object implements org.springframework.context.Lifecycle
Lifecycle for a HikariDataSource allowing it to participate in checkpoint-restore. When stopped, and the data source allows it, its pool is suspended, blocking any attempts to borrow connections. Open and idle connections are then evicted. When subsequently started, the pool is resumed if necessary.
Since:
3.2.0
  • Constructor Details

    • HikariCheckpointRestoreLifecycle

      public HikariCheckpointRestoreLifecycle(DataSource dataSource)
      Creates a new HikariCheckpointRestoreLifecycle that will allow the given dataSource to participate in checkpoint-restore. The dataSource is unwrapped to a HikariDataSource. If such unwrapping is not possible, the lifecycle will have no effect.
      Parameters:
      dataSource - the checkpoint-restore participant
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle