InMemorySandboxMap
public class InMemorySandboxMap implements SandboxMap
源码Source
io/agentscope/runtime/sandbox/manager/utils/InMemorySandboxMap.java:25–100In 记忆沙箱映射,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.sandbox.manager.utils 包,实现 SandboxMap。核心成员包括 addSandbox、getSandbox、removeSandbox、getAllSandboxes、containSandbox。
A class in io.agentscope.runtime.sandbox.manager.utils that deploys, schedules and serves agents. Declared in io.agentscope.runtime.sandbox.manager.utils. Implements SandboxMap.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void addSandbox(SandboxKey sandboxKey, ContainerModel containerModel) | 添加沙箱。 Adds the sandbox. |
public ContainerModel getSandbox(SandboxKey sandboxKey) | 获取沙箱。 Returns the sandbox. |
public boolean removeSandbox(SandboxKey sandboxKey) | 移除沙箱。 Removes the sandbox. |
public ContainerModel getSandbox(String containerId) | 获取沙箱。 Returns the sandbox. |
public void removeSandbox(String containerId) | 移除沙箱。 Removes the sandbox. |
public Map<String, ContainerModel> getAllSandboxes() | 获取 `getAllSandboxes`。 Returns the all sandboxes. |
public boolean containSandbox(SandboxKey sandboxKey) | 设置该参数。 Performs the contain sandbox operation. |
public boolean containSandbox(String containerId) | 设置该参数。 Performs the contain sandbox operation. |
方法详情Method Detail
addSandbox
public void addSandbox(SandboxKey sandboxKey, ContainerModel containerModel)
添加沙箱。
Adds the sandbox.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxKey | SandboxKey | 沙箱键(类型 `SandboxKey`)。The sandbox key. |
containerModel | ContainerModel | 容器模型(类型 `ContainerModel`)。The container model. |
源码Source
io/agentscope/runtime/sandbox/manager/utils/InMemorySandboxMap.java:29–36getSandbox
public ContainerModel getSandbox(SandboxKey sandboxKey)
获取沙箱。
Returns the sandbox.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxKey | SandboxKey | 沙箱键(类型 `SandboxKey`)。The sandbox key. |
ContainerModel返回ContainerModel。Returns container model.
源码Source
io/agentscope/runtime/sandbox/manager/utils/InMemorySandboxMap.java:38–44removeSandbox
public boolean removeSandbox(SandboxKey sandboxKey)
移除沙箱。
Removes the sandbox.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxKey | SandboxKey | 沙箱键(类型 `SandboxKey`)。The sandbox key. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/manager/utils/InMemorySandboxMap.java:46–56getSandbox
public ContainerModel getSandbox(String containerId)
获取沙箱。
Returns the sandbox.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
ContainerModel返回ContainerModel。Returns container model.
源码Source
io/agentscope/runtime/sandbox/manager/utils/InMemorySandboxMap.java:58–64removeSandbox
public void removeSandbox(String containerId)
移除沙箱。
Removes the sandbox.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
源码Source
io/agentscope/runtime/sandbox/manager/utils/InMemorySandboxMap.java:66–75getAllSandboxes
public Map<String, ContainerModel> getAllSandboxes()
获取 getAllSandboxes。
Returns the all sandboxes.
Map<String, ContainerModel>返回映射。Returns map.
源码Source
io/agentscope/runtime/sandbox/manager/utils/InMemorySandboxMap.java:77–83containSandbox
public boolean containSandbox(SandboxKey sandboxKey)
设置该参数。
Performs the contain sandbox operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxKey | SandboxKey | 沙箱键(类型 `SandboxKey`)。The sandbox key. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/manager/utils/InMemorySandboxMap.java:85–91containSandbox
public boolean containSandbox(String containerId)
设置该参数。
Performs the contain sandbox operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/manager/utils/InMemorySandboxMap.java:93–99