Package org.mockserver.async
Class AsyncApiControlPlaneRegistry
java.lang.Object
org.mockserver.async.AsyncApiControlPlaneRegistry
Process-wide holder for the optional
AsyncApiControlPlane implementation.
Lives in mockserver-core so that HttpState can call it
without a compile-time dependency on mockserver-async. When no implementation is
registered (the module is not on the classpath), the load() and status()
methods return a "not available" JSON response — the endpoint is still routable but
responds with 501/503 semantics, same as other optional features.
Thread safety: register(AsyncApiControlPlane) is called once at startup;
reads are safe after that. The volatile field ensures visibility across threads.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AsyncApiControlPlaneRegistrybooleancom.fasterxml.jackson.databind.JsonNodeDelegate to the registered implementation, or return a "not available" response.voidregister(AsyncApiControlPlane controlPlane) Register the control-plane implementation.voidreset()Reset async mocking state.com.fasterxml.jackson.databind.JsonNodestatus()Delegate to the registered implementation, or return a "not available" response.Delegate verify to the registered implementation, or return a not-available message.
-
Method Details
-
getInstance
-
register
Register the control-plane implementation. Called once at server startup by the mockserver-async module's bootstrap code. -
isAvailable
public boolean isAvailable()- Returns:
- true if an implementation is registered (mockserver-async is on the classpath)
-
load
Delegate to the registered implementation, or return a "not available" response. -
status
public com.fasterxml.jackson.databind.JsonNode status()Delegate to the registered implementation, or return a "not available" response. -
reset
public void reset()Reset async mocking state. Safe to call even when no implementation is registered. -
verify
Delegate verify to the registered implementation, or return a not-available message.- Returns:
nullif verification passes; a failure description if it fails; a not-available message if no implementation is registered
-