JdbcSandboxExecutionGuard
public final class JdbcSandboxExecutionGuard implements SandboxExecutionGuard
io/agentscope/extensions/jdbc/sandbox/JdbcSandboxExecutionGuard.java:41–115JDBC 沙箱执行守卫,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.extensions.jdbc.sandbox 包,实现 SandboxExecutionGuard。核心成员包括 builder、tryEnter。
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
io.agentscope.extensions.jdbc.dialect.AbstractJdbcDialect).
Each lock is identified by a string key derived from the
SandboxIsolationKey's scope and value.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
Builder | 类class | `JdbcSandboxExecutionGuard`的构建器。 Builder for `JdbcSandboxExecutionGuard`. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static Builder builder(SandboxLockStrategy strategy)static | 创建构建器用于`JdbcSandboxExecutionGuard`。 Creates a builder for `JdbcSandboxExecutionGuard`. |
public SandboxLease tryEnter(SandboxIsolationKey key) throws InterruptedException | 设置该参数。 Performs the try enter operation. |
方法详情Method Detail
builder
public static Builder builder(SandboxLockStrategy strategy)
创建构建器用于JdbcSandboxExecutionGuard。
Creates a builder for JdbcSandboxExecutionGuard.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
strategy | SandboxLockStrategy | strategy(类型 `SandboxLockStrategy`)。the lock strategy from the dialect |
Builderio/agentscope/extensions/jdbc/sandbox/JdbcSandboxExecutionGuard.java:63–65tryEnter
public SandboxLease tryEnter(SandboxIsolationKey key) throws InterruptedException
设置该参数。
Performs the try enter operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | SandboxIsolationKey | 键(类型 `SandboxIsolationKey`)。The key. |
SandboxLeaseInterruptedException可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
io/agentscope/extensions/jdbc/sandbox/JdbcSandboxExecutionGuard.java:67–72嵌套类详情Nested Class Detail
Builder
public static final class BuilderJdbcSandboxExecutionGuard的构建器。位于 io.agentscope.extensions.jdbc.sandbox 包。核心成员包括 keyPrefix、lockTimeout、build。
Builder for JdbcSandboxExecutionGuard.