Class DefaultFluxzero

java.lang.Object
io.fluxzero.sdk.configuration.DefaultFluxzero
All Implemented Interfaces:
Fluxzero, AutoCloseable

public class DefaultFluxzero extends Object implements Fluxzero
  • Constructor Details

    • DefaultFluxzero

      public DefaultFluxzero()
  • Method Details

    • builder

      public static DefaultFluxzero.Builder builder()
    • customGateway

      public GenericGateway customGateway(String topic)
      Description copied from interface: Fluxzero
      Returns the gateway for given custom message topic.
      Specified by:
      customGateway in interface Fluxzero
    • tracking

      public Tracking tracking(io.fluxzero.common.MessageType messageType)
      Description copied from interface: Fluxzero
      Returns a client to assist with the tracking of a given message type.
      Specified by:
      tracking in interface Fluxzero
    • withClock

      public void withClock(@NonNull @NonNull Clock clock)
      Description copied from interface: Fluxzero
      Have Fluxzero use the given Clock when generating timestamps, e.g. when creating a Message.
      Specified by:
      withClock in interface Fluxzero
    • clock

      public Clock clock()
      Description copied from interface: Fluxzero
      Returns the clock used by Fluxzero to generate timestamps.
      Specified by:
      clock in interface Fluxzero
    • executeModelCommit

      public CompletableFuture<Void> executeModelCommit(Message update)
      Description copied from interface: Fluxzero
      Executes one model commit without routing it through command handlers.

      This is an infrastructure extension point used by Fluxzero.assertAndApply(Object). Custom Fluxzero implementations that support independent models should override it.

      Specified by:
      executeModelCommit in interface Fluxzero
      Parameters:
      update - message containing the model update
      Returns:
      completion of the durable model commit
    • executeModelCommit

      public CompletableFuture<Void> executeModelCommit(Message update, String modelId, Class<?> modelType)
      Description copied from interface: Fluxzero
      Executes one model commit against an explicitly selected persisted model identity. This is the infrastructure extension used by Graph.assertAndApply(Object); custom implementations supporting independent models may override it alongside Fluxzero.executeModelCommit(Message).
      Specified by:
      executeModelCommit in interface Fluxzero
    • executeModelCommits

      public CompletableFuture<Void> executeModelCommits(List<Message> updates)
      Description copied from interface: Fluxzero
      Executes multiple independent model commits without routing them through command handlers. The default implementation preserves compatibility for custom implementations by invoking Fluxzero.executeModelCommit(Message) for every update. Implementations may override this to batch transport while retaining separate commit semantics.
      Specified by:
      executeModelCommits in interface Fluxzero
      Parameters:
      updates - messages containing independent model updates
      Returns:
      completion after every durable model commit
    • executeStoredModelEvent

      public CompletableFuture<Void> executeStoredModelEvent(Message event)
      Description copied from interface: Fluxzero
      Applies an event that was already accepted by its original command flow to independent models. Assertions and apply interceptors are skipped, while regular @Apply methods and durable Model-event storage are preserved. The accepted event is not published again. This infrastructure hook is primarily used by replay and test fixtures.
      Specified by:
      executeStoredModelEvent in interface Fluxzero
      Parameters:
      event - previously accepted event to apply
      Returns:
      completion of the durable model commit
    • executeModelAssertions

      public CompletableFuture<Void> executeModelAssertions(Message update)
      Description copied from interface: Fluxzero
      Executes model apply interceptors and immediate assertions without applying or committing the update.

      This is an infrastructure extension point used by Fluxzero.assertLegal(Object). Custom Fluxzero implementations that support independent models should override it.

      Specified by:
      executeModelAssertions in interface Fluxzero
      Parameters:
      update - message containing the model update to validate
      Returns:
      completion of the validation-only model evaluation
    • beforeShutdown

      public io.fluxzero.common.Registration beforeShutdown(Runnable task)
      Description copied from interface: Fluxzero
      Register a task to run before this Fluxzero instance is closed.
      Specified by:
      beforeShutdown in interface Fluxzero
    • close

      public void close(boolean silently)
      Description copied from interface: Fluxzero
      Closes this Fluxzero instance gracefully. If silently is true, shutdown is done without logging.
      Specified by:
      close in interface Fluxzero