Class PersistenceManager

java.lang.Object
dev.agenor.runtime.persistence.PersistenceManager

public class PersistenceManager extends Object
Manages automatic persistence for agents based on their configuration. Handles periodic saves, snapshots, and lifecycle-based persistence. INTEGRATION WITH AGENOR RUNTIME: - Register as a service: runtime.builder().service(PersistenceManager.class, manager) - Agents are automatically registered when added to runtime - Lifecycle hooks integrate with agent stop process
  • Constructor Details

  • Method Details

    • getPersistenceService

      public PersistenceService getPersistenceService()
      Get the persistence service instance
    • start

      public CompletableFuture<Void> start()
      Start the persistence manager
    • stop

      public CompletableFuture<Void> stop()
      Stop the persistence manager
    • registerAgent

      public void registerAgent(Agent agent)
      Register an agent for automatic persistence. Called automatically by AgenorRuntime when agents are registered.
    • unregisterAgent

      public void unregisterAgent(String agentId)
      Unregister an agent from automatic persistence. Called automatically by AgenorRuntime when agents are unregistered.
    • saveAgent

      public CompletableFuture<Void> saveAgent(Agent agent)
      Manually save agent state
    • loadAgent

      public CompletableFuture<Boolean> loadAgent(Agent agent)
      Manually load and restore agent state
    • createSnapshot

      public CompletableFuture<String> createSnapshot(String agentId)
      Create a snapshot for an agent
    • restoreSnapshot

      public CompletableFuture<Boolean> restoreSnapshot(String agentId, String snapshotId)
      Restore agent from a specific snapshot
    • getStats

      public Map<String,Object> getStats()
      Get persistence statistics