Class ExpectationStoreFactory
RequestMatchers).
G10 phase 1 — clustered-state seam. HttpState obtains its
RequestMatchers through this factory rather than constructing it
directly, so an optional clustered backend (phase 2, an embedded Infinispan
data grid sharing expectations across MockServer instances) can register a
ExpectationStoreFactory.Factory that returns a clustering-aware RequestMatchers
subclass without mockserver-core depending on the data grid.
Zero behaviour change in phase 1: the default factory is the standard
RequestMatchers constructor, so when no override is registered the
behaviour is identical to constructing it inline.
Thread-safety: the factory reference is volatile; register/reset are
expected at startup (mirrors the SPI-registry pattern used by
AsyncApiControlPlaneRegistry, DriftStore, WasmStore).
Phase 2 (deferred): a clustered backend additionally requires the
expectation storage (the CircularPriorityQueue inside
RequestMatchers) to be overridable so a distributed map can back it;
that storage abstraction is out of scope for this construction-seam phase.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCreates theRequestMatchersinstance backing anHttpState. -
Method Summary
Modifier and TypeMethodDescriptionstatic RequestMatcherscreate(Configuration configuration, MockServerLogger mockServerLogger, Scheduler scheduler, WebSocketClientRegistry webSocketClientRegistry) Create the expectation store via the registered factory (default: the standard in-memoryRequestMatchers).static booleanstatic voidregister(ExpectationStoreFactory.Factory customFactory) Register a custom factory (e.g. a clustered backend).static voidReset to the default in-memory factory (primarily for tests).
-
Method Details
-
register
Register a custom factory (e.g. a clustered backend). Passingnullresets to the default in-memory factory. -
resetToDefault
public static void resetToDefault()Reset to the default in-memory factory (primarily for tests). -
isCustomFactoryRegistered
public static boolean isCustomFactoryRegistered()- Returns:
trueif a non-default factory is registered.
-
create
public static RequestMatchers create(Configuration configuration, MockServerLogger mockServerLogger, Scheduler scheduler, WebSocketClientRegistry webSocketClientRegistry) Create the expectation store via the registered factory (default: the standard in-memoryRequestMatchers).
-