StoreBackedSubagentRegistry
public final class StoreBackedSubagentRegistry implements SubagentRegistry
io/agentscope/harness/agent/gateway/StoreBackedSubagentRegistry.java:42–131存储 Backed 子智能体注册表,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.agent.gateway 包,实现 SubagentRegistry。核心成员包括 register、find、revoke、revokeByParentSession、StoreBackedSubagentRegistry。
Distributed SubagentRegistry backed by a BaseStore. Because the store is supplied
by a io.agentscope.harness.agent.DistributedStore (Redis / OSS / MySQL), exposure
records become visible to every node, so any replica can resolve a subagentId and
re-materialize the subagent.
Records are stored under the namespace ["subagents", "exposed"] keyed by
subagentId. TTL is enforced lazily on #find: an elapsed record is deleted and
reported as absent.
This registry deliberately stores only routing/identity metadata. Concurrency safety for the
subagent's mutable conversation state is the responsibility of the distributed
io.agentscope.core.state.AgentStateStore (and BaseStore#putIfVersion where
explicit optimistic guarding is desired), not of this registry.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public StoreBackedSubagentRegistry(BaseStore store) | 初始化 `StoreBackedSubagentRegistry` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void register(SubagentRecord record) | 设置注册。 Performs the register operation. |
public Optional<SubagentRecord> find(String subagentId) | 设置查找。 Performs the find operation. |
public void revoke(String subagentId) | 设置该参数。 Performs the revoke operation. |
public void revokeByParentSession(String parentSessionId) | 设置该参数。 Performs the revoke by parent session operation. |
构造器详情Constructor Detail
StoreBackedSubagentRegistry
public StoreBackedSubagentRegistry(BaseStore store)
初始化 StoreBackedSubagentRegistry 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
store | BaseStore | 存储实例(类型 `BaseStore`)。The store. |
io/agentscope/harness/agent/gateway/StoreBackedSubagentRegistry.java:51–53方法详情Method Detail
register
public void register(SubagentRecord record)
设置注册。
Performs the register operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
record | SubagentRecord | 记录(类型 `SubagentRecord`)。The record. |
io/agentscope/harness/agent/gateway/StoreBackedSubagentRegistry.java:55–68find
public Optional<SubagentRecord> find(String subagentId)
设置查找。
Performs the find operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
subagentId | String | 子智能体标识(类型 `String`)。The subagent id. |
Optional<SubagentRecord>io/agentscope/harness/agent/gateway/StoreBackedSubagentRegistry.java:70–94revoke
public void revoke(String subagentId)
设置该参数。
Performs the revoke operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
subagentId | String | 子智能体标识(类型 `String`)。The subagent id. |
io/agentscope/harness/agent/gateway/StoreBackedSubagentRegistry.java:96–106revokeByParentSession
public void revokeByParentSession(String parentSessionId)
设置该参数。
Performs the revoke by parent session operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
parentSessionId | String | 父级会话标识(类型 `String`)。The parent session id. |
io/agentscope/harness/agent/gateway/StoreBackedSubagentRegistry.java:108–130