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
Redis resources are removed from the context, so they are automatically recreated on restore.
- Since:
- 1.2.1
- Author:
- Tim Yates
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractRedisResource
(io.micronaut.context.BeanContext beanContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Destroy the bean.- Parameters:
resource
- the bean to destroylogger
- the logger to usemessage
- the log message- Returns:
- the time taken to destroy the bean
-
afterRestore
- Specified by:
afterRestore
in interfaceorg.crac.Resource
- Throws:
Exception
-