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

    Constructors
    Constructor
    Description
    RefreshEventResource(CracEventPublisher cracEventPublisher, io.micronaut.context.event.ApplicationEventPublisher<io.micronaut.runtime.context.scope.refresh.RefreshEvent> refreshEventPublisher)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterRestore(org.crac.Context<? extends org.crac.Resource> context)
     
    void
    beforeCheckpoint(org.crac.Context<? extends org.crac.Resource> context)
     
    int
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 publisher
      refreshEventPublisher - 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 interface org.crac.Resource
      Throws:
      Exception
    • afterRestore

      public void afterRestore(org.crac.Context<? extends org.crac.Resource> context) throws Exception
      Specified by:
      afterRestore in interface org.crac.Resource
      Throws:
      Exception
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface io.micronaut.core.order.Ordered