Package io.micronaut.crac.resources
Class DataSourceResource
java.lang.Object
io.micronaut.crac.resources.DataSourceResource
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,OrderedResource
,org.crac.Resource
@EachBean(javax.sql.DataSource.class)
@Requires(classes=javax.sql.DataSource.class) @Requires(bean=CracResourceRegistrar.class)
public class DataSourceResource
extends Object
implements OrderedResource
Register DataSources as CRaC resources on startup if CRaC is enabled.
- Since:
- 1.1.0
- Author:
- Tim Yates
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionDataSourceResource
(CracConfiguration configuration, CracEventPublisher eventPublisher, DataSource dataSource, DataSourceResourceResolver dataSourceResolver) -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterRestore
(org.crac.Context<? extends org.crac.Resource> context) void
beforeCheckpoint
(org.crac.Context<? extends org.crac.Resource> context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Constructor Details
-
DataSourceResource
public DataSourceResource(CracConfiguration configuration, CracEventPublisher eventPublisher, DataSource dataSource, DataSourceResourceResolver dataSourceResolver) - Parameters:
configuration
-eventPublisher
-dataSource
-dataSourceResolver
-
-
-
Method Details