Package com.embabel.agent.spi.support
Class InMemoryContextRepository
-
- All Implemented Interfaces:
-
com.embabel.agent.spi.ContextRepository
public final class InMemoryContextRepository implements ContextRepository
In-memory implementation of ContextRepository with configurable window size to prevent memory overflow by evicting the oldest entries when the limit is reached.
-
-
Constructor Summary
Constructors Constructor Description InMemoryContextRepository(ContextRepositoryProperties properties)
-
Method Summary
Modifier and Type Method Description Contextcreate()Create an empty context with a generated ID. ContextcreateWithId(String id)Create an empty context with the specified ID. ContextfindById(String id)Contextsave(Context context)Unitdelete(Context context)final Integersize()Get current size of the repository for testing purposes. final Unitclear()Clear all entries from the repository for testing purposes. -
-
Constructor Detail
-
InMemoryContextRepository
InMemoryContextRepository(ContextRepositoryProperties properties)
-
-
Method Detail
-
createWithId
Context createWithId(String id)
Create an empty context with the specified ID. Use this when you want deterministic context IDs (e.g., "userId-contextName").
-
-
-
-