Package io.micronaut.crac.resources
Class RefreshEventResource
java.lang.Object
io.micronaut.crac.resources.RefreshEventResource
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,OrderedResource
,org.crac.Resource
@Singleton
@Requires(property="crac.refresh-beans",
defaultValue="true",
value="true")
public class RefreshEventResource
extends Object
implements OrderedResource
An OrderedResource that emits a RefreshEvent when a CRaC checkpoint is taken.
- Since:
- 1.0.0
- Author:
- Tim Yates
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionRefreshEventResource
(CracEventPublisher cracEventPublisher, io.micronaut.context.event.ApplicationEventPublisher<io.micronaut.runtime.context.scope.refresh.RefreshEvent> refreshEventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterRestore
(org.crac.Context<? extends org.crac.Resource> context) void
beforeCheckpoint
(org.crac.Context<? extends org.crac.Resource> context) int
getOrder()
-
Constructor Details
-
RefreshEventResource
public RefreshEventResource(CracEventPublisher cracEventPublisher, io.micronaut.context.event.ApplicationEventPublisher<io.micronaut.runtime.context.scope.refresh.RefreshEvent> refreshEventPublisher) - Parameters:
cracEventPublisher
- The CRaC event publisherrefreshEventPublisher
- The publisher to use to emit the RefreshEvent
-
-
Method Details
-
beforeCheckpoint
public void beforeCheckpoint(org.crac.Context<? extends org.crac.Resource> context) throws Exception - Specified by:
beforeCheckpoint
in interfaceorg.crac.Resource
- Throws:
Exception
-
afterRestore
- Specified by:
afterRestore
in interfaceorg.crac.Resource
- Throws:
Exception
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceio.micronaut.core.order.Ordered
-