Package dev.agenor.runtime.persistence
Class PersistenceManager
java.lang.Object
dev.agenor.runtime.persistence.PersistenceManager
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateSnapshot(String agentId) Create a snapshot for an agentGet the persistence service instancegetStats()Get persistence statisticsManually load and restore agent statevoidregisterAgent(Agent agent) Register an agent for automatic persistence.restoreSnapshot(String agentId, String snapshotId) Restore agent from a specific snapshotManually save agent statestart()Start the persistence managerstop()Stop the persistence managervoidunregisterAgent(String agentId) Unregister an agent from automatic persistence.
-
Constructor Details
-
PersistenceManager
-
-
Method Details
-
getPersistenceService
Get the persistence service instance -
start
Start the persistence manager -
stop
Stop the persistence manager -
registerAgent
Register an agent for automatic persistence. Called automatically by AgenorRuntime when agents are registered. -
unregisterAgent
Unregister an agent from automatic persistence. Called automatically by AgenorRuntime when agents are unregistered. -
saveAgent
Manually save agent state -
loadAgent
Manually load and restore agent state -
createSnapshot
Create a snapshot for an agent -
restoreSnapshot
Restore agent from a specific snapshot -
getStats
Get persistence statistics
-