Interface SandboxLease
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
SandboxLease.NoopSandboxLease
A handle that represents a held execution right on a sandbox isolation slot.
Returned by SandboxExecutionGuard.tryEnter(io.agentscope.harness.agent.sandbox.SandboxIsolationKey). The harness closes the lease
automatically after SandboxManager.release(io.agentscope.harness.agent.sandbox.SandboxAcquireResult) 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
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classSingleton no-op implementation. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases the execution right held by this lease.static SandboxLeasenoop()Returns a no-op lease whoseclose()is a no-op.
-
Method Details
-
close
void close()Releases the execution right held by this lease.Must not throw. Any release-side error should be logged internally by the implementation.
- Specified by:
closein interfaceAutoCloseable
-
noop
Returns a no-op lease whoseclose()is a no-op. Used by the defaultSandboxExecutionGuard.noop()implementation.
-