AS AgentScopeAPI 手册 / API Reference

JdbcSandboxExecutionGuard

public final class JdbcSandboxExecutionGuard implements SandboxExecutionGuard
源码Source io/agentscope/extensions/jdbc/sandbox/JdbcSandboxExecutionGuard.java:41–115

JDBC 沙箱执行守卫,在多次调用之间保存和恢复会话与记忆数据。位于 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)
static

创建构建器用于JdbcSandboxExecutionGuard。

Creates a builder for JdbcSandboxExecutionGuard.

参数Parameters
名称Name类型Type说明Description
strategySandboxLockStrategystrategy(类型 `SandboxLockStrategy`)。the lock strategy from the dialect
返回Returns Builder
一种新的构建器。a new builder
源码Source io/agentscope/extensions/jdbc/sandbox/JdbcSandboxExecutionGuard.java:63–65

tryEnter

public SandboxLease tryEnter(SandboxIsolationKey key) throws InterruptedException

设置该参数。

Performs the try enter operation.

参数Parameters
名称Name类型Type说明Description
keySandboxIsolationKey键(类型 `SandboxIsolationKey`)。The key.
返回Returns SandboxLease
返回SandboxLease。Returns sandbox lease.
抛出Throws
  • InterruptedException 可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/extensions/jdbc/sandbox/JdbcSandboxExecutionGuard.java:67–72

嵌套类详情Nested Class Detail

Builder

public static final class Builder

JdbcSandboxExecutionGuard的构建器。位于 io.agentscope.extensions.jdbc.sandbox 包。核心成员包括 keyPrefix、lockTimeout、build。

Builder for JdbcSandboxExecutionGuard.

继承成员Inherited Members

继承自Methods inherited from SandboxExecutionGuard
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.