AS AgentScopeAPI 手册 / API Reference

SandboxLease

public interface SandboxLease extends AutoCloseable
源码Source io/agentscope/harness/agent/sandbox/SandboxLease.java:27–55

定义沙箱 Lease契约的接口。位于 io.agentscope.harness.agent.sandbox 包,实现 AutoCloseable。核心成员包括 close、noop。

A handle that represents a held execution right on a sandbox isolation slot.

Returned by SandboxExecutionGuard#tryEnter. The harness closes the lease automatically after SandboxManager#release completes (whether the call succeeded or failed), so implementations do not need to worry about cleanup ordering.

Implementations must be idempotent: calling #close() more than once must be safe.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
NoopSandboxLease类class
Noop 沙箱 Lease,承载智能体的部署、调度与服务化运行。
Singleton no-op implementation.

方法摘要Method Summary

方法Method说明Description
public void close()
关闭连接并释放相关资源。
Releases the execution right held by this lease.
static public SandboxLease noop()
static
返回 `noop` 结果。
Returns a no-op lease whose `#close()` is a no-op.

方法详情Method Detail

close

public void close()

关闭连接并释放相关资源。

Releases the execution right held by this lease.

源码Source io/agentscope/harness/agent/sandbox/SandboxLease.java:34–35

noop

static public SandboxLease noop()
static

返回 noop 结果。

Returns a no-op lease whose #close() is a no-op.

返回Returns SandboxLease
返回SandboxLease。Returns sandbox lease.
源码Source io/agentscope/harness/agent/sandbox/SandboxLease.java:41–43

嵌套类详情Nested Class Detail

NoopSandboxLease

final class NoopSandboxLease implements SandboxLease

Noop 沙箱 Lease,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.agent.sandbox 包,实现 SandboxLease。核心成员包括 close。

Singleton no-op implementation.

基于官方固定版本源码静态生成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.