SandboxIsolationKey
public final class SandboxIsolationKey
源码Source
io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:33–140沙箱隔离键,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.agent.sandbox 包。核心成员包括 resolve、getScope、getValue、equals、hashCode、toString。
Immutable key that uniquely identifies a sandbox state slot for a given
IsolationScope.
Use #resolve to obtain a key from a RuntimeContext. The result is
Optional#empty() when the required context field is absent (e.g., USER scope
without a userId), meaning state lookup should be skipped.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static Optional<SandboxIsolationKey> resolve(IsolationScope scope, RuntimeContext ctx, String agentId)static | 执行解析相关操作。 Resolves an isolation key from the given scope, runtime context, and agent ID. |
public IsolationScope getScope() | 返回隔离范围。 Returns the isolation scope. |
public String getValue() | 获取值。 Returns the discriminating value within the scope (e.g. |
public boolean equals(Object o) | 设置该参数。 Performs the equals operation. |
public int hashCode() | 返回 `hashCode` 结果。 Returns the hash code. |
public String toString() | 返回 `toString` 结果。 Returns the to string. |
方法详情Method Detail
resolve
public static Optional<SandboxIsolationKey> resolve(IsolationScope scope, RuntimeContext ctx, String agentId)
static
执行解析相关操作。
Resolves an isolation key from the given scope, runtime context, and agent ID.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
scope | IsolationScope | 范围(类型 `IsolationScope`)。the desired isolation scope; `null` defaults to `USER` |
ctx | RuntimeContext | 运行时上下文用于当前调用;可能为`null`。the runtime context for the current call; may be `null` |
agentId | String | 智能体标识(类型 `String`)。the agent name resolved at build time; must not be null |
Optional<SandboxIsolationKey>返回可选。resolved key, or empty if the required context field is absent
源码Source
io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:67–104getScope
public IsolationScope getScope()
返回隔离范围。
Returns the isolation scope.
IsolationScope返回IsolationScope。scope
源码Source
io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:111–113getValue
public String getValue()
获取值。
Returns the discriminating value within the scope (e.g.
String返回字符串结果。value string
源码Source
io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:120–122equals
public boolean equals(Object o)
设置该参数。
Performs the equals operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
o | Object | o(类型 `Object`)。The o. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:124–129hashCode
public int hashCode()
返回 hashCode 结果。
Returns the hash code.
int返回数值结果。Returns a numeric result.
源码Source
io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:131–134toString
public String toString()
返回 toString 结果。
Returns the to string.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:136–139