Class InfinispanStateBackendRegistrar

java.lang.Object
org.mockserver.state.infinispan.InfinispanStateBackendRegistrar

public final class InfinispanStateBackendRegistrar extends Object
Registers the InfinispanStateBackend with the core StateBackendFactory so that stateBackend=infinispan selects it. Call register() at application startup (or use the static initializer block, which fires when this class is loaded — the class is loaded when it appears on the classpath and the factory's create() method resolves the backend name).

This design keeps mockserver-core free of any Infinispan dependency: the core factory uses a volatile-registry pattern, and this module registers itself into it.

Phase 2c: the factory now passes the full Configuration to InfinispanStateBackend so it can inspect clustering config (clusterEnabled, clusterName, clusterTransportConfig).

  • Method Details

    • register

      public static void register()
      Register the Infinispan factory with StateBackendFactory. Idempotent — safe to call multiple times.
    • deregister

      public static void deregister()
      Deregister the Infinispan factory, reverting to the default in-memory backend (primarily for tests).