Package org.springframework.boot.jdbc
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 Summary
ConstructorDescriptionHikariCheckpointRestoreLifecycle
(DataSource dataSource) Deprecated, for removal: This API element is subject to removal in a future version.HikariCheckpointRestoreLifecycle
(DataSource dataSource, org.springframework.context.ConfigurableApplicationContext applicationContext) Creates a newHikariCheckpointRestoreLifecycle
that will allow the givendataSource
to participate in checkpoint-restore. -
Method Summary
-
Constructor Details
-
HikariCheckpointRestoreLifecycle
@Deprecated(since="3.4.0", forRemoval=true) public HikariCheckpointRestoreLifecycle(DataSource dataSource) Deprecated, for removal: This API element is subject to removal in a future version.since 3.4.0 for removal in 3.6.0 in favor ofHikariCheckpointRestoreLifecycle(DataSource, ConfigurableApplicationContext)
Creates a newHikariCheckpointRestoreLifecycle
that will allow the givendataSource
to participate in checkpoint-restore. ThedataSource
isunwrapped
to aHikariDataSource
. If such unwrapping is not possible, the lifecycle will have no effect.- Parameters:
dataSource
- the checkpoint-restore participant
-
HikariCheckpointRestoreLifecycle
public HikariCheckpointRestoreLifecycle(DataSource dataSource, org.springframework.context.ConfigurableApplicationContext applicationContext) Creates a newHikariCheckpointRestoreLifecycle
that will allow the givendataSource
to participate in checkpoint-restore. ThedataSource
isunwrapped
to aHikariDataSource
. If such unwrapping is not possible, the lifecycle will have no effect.- Parameters:
dataSource
- the checkpoint-restore participantapplicationContext
- the application context- Since:
- 3.4.0
-
-
Method Details
-
start
public void start()- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
-
HikariCheckpointRestoreLifecycle(DataSource, ConfigurableApplicationContext)