Package io.micronaut.crac.resources
Class NettyEmbeddedServerResource
java.lang.Object
io.micronaut.crac.resources.NettyEmbeddedServerResource
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,OrderedResource
,org.crac.Resource
@EachBean(io.micronaut.http.server.netty.NettyEmbeddedServer.class)
@Requires(classes=io.micronaut.http.server.netty.NettyEmbeddedServer.class) @Requires(bean=CracResourceRegistrar.class)
public class NettyEmbeddedServerResource
extends Object
implements OrderedResource
Register the NettyEmbedded server as a CRaC resource on startup if CRaC is enabled.
- Since:
- 1.0.0
- Author:
- Tim Yates
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionNettyEmbeddedServerResource
(CracEventPublisher eventPublisher, io.micronaut.http.server.netty.NettyEmbeddedServer server) -
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()
-
Field Details
-
ORDER
public static final int ORDERThe default order for this resource.- See Also:
-
-
Constructor Details
-
NettyEmbeddedServerResource
public NettyEmbeddedServerResource(CracEventPublisher eventPublisher, io.micronaut.http.server.netty.NettyEmbeddedServer server)
-
-
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
-