Class JdbcSandboxExecutionGuard
java.lang.Object
io.agentscope.extensions.jdbc.sandbox.JdbcSandboxExecutionGuard
- All Implemented Interfaces:
io.agentscope.harness.agent.sandbox.SandboxExecutionGuard
public final class JdbcSandboxExecutionGuard
extends Object
implements io.agentscope.harness.agent.sandbox.SandboxExecutionGuard
JDBC-backed
SandboxExecutionGuard that delegates all lock semantics to a
SandboxLockStrategy provided by the dialect.
This component contains zero database-specific logic — the dialect handles
whether to use MySQL GET_LOCK, PostgreSQL pg_try_advisory_lock, or
the portable table-based lock (default in
AbstractJdbcDialect).
Each lock is identified by a string key derived from the
SandboxIsolationKey's scope and value.
- Author:
- shanhongyu
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.agentscope.harness.agent.sandbox.SandboxExecutionGuard
io.agentscope.harness.agent.sandbox.SandboxExecutionGuard.NoopSandboxExecutionGuard -
Method Summary
Modifier and TypeMethodDescriptionbuilder(SandboxLockStrategy strategy) Creates a builder forJdbcSandboxExecutionGuard.io.agentscope.harness.agent.sandbox.SandboxLeasetryEnter(io.agentscope.harness.agent.sandbox.SandboxIsolationKey key)
-
Method Details
-
builder
Creates a builder forJdbcSandboxExecutionGuard.- Parameters:
strategy- the lock strategy from the dialect- Returns:
- a new builder
-
tryEnter
public io.agentscope.harness.agent.sandbox.SandboxLease tryEnter(io.agentscope.harness.agent.sandbox.SandboxIsolationKey key) throws InterruptedException - Specified by:
tryEnterin interfaceio.agentscope.harness.agent.sandbox.SandboxExecutionGuard- Throws:
InterruptedException
-