Class AbstractRedisResource<T>

java.lang.Object
io.micronaut.crac.resources.redis.AbstractRedisResource<T>
Type Parameters:
T - The type of resource
All Implemented Interfaces:
io.micronaut.core.order.Ordered, OrderedResource, org.crac.Resource
Direct Known Subclasses:
RedisCacheResource, RedisNamedConfigResource

@Internal public abstract class AbstractRedisResource<T> extends Object implements OrderedResource
Redis resources are removed from the context, so they are automatically recreated on restore.
Since:
1.2.1
Author:
Tim Yates
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final io.micronaut.context.BeanContext
     

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractRedisResource(io.micronaut.context.BeanContext beanContext)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterRestore(org.crac.Context<? extends org.crac.Resource> context)
     
    protected long
    destroyAction(T resource, org.slf4j.Logger logger, String message)
    Destroy the bean.

    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

    Methods inherited from interface org.crac.Resource

    beforeCheckpoint
  • Field Details

    • beanContext

      protected final io.micronaut.context.BeanContext beanContext
  • Constructor Details

    • AbstractRedisResource

      protected AbstractRedisResource(io.micronaut.context.BeanContext beanContext)
  • Method Details

    • destroyAction

      protected long destroyAction(T resource, org.slf4j.Logger logger, String message)
      Destroy the bean.
      Parameters:
      resource - the bean to destroy
      logger - the logger to use
      message - the log message
      Returns:
      the time taken to destroy the bean
    • afterRestore

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