ChannelTypeRegistry
public final class ChannelTypeRegistry
源码Source
io/agentscope/builder/runtime/config/ChannelTypeRegistry.java:31–60渠道类型注册表,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.runtime.config 包。核心成员包括 register、get、registeredTypes。
Registry of ChannelFactory implementations keyed by type. Pure SPI holder: the
registry itself ships no built-in factories — the scheduler plane (which owns the channel
adapters and their extension jars) registers the concrete types at startup. The control plane
only reads #registeredTypes() for validation and type listings.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static ChannelFactory register(String typeId, ChannelFactory factory)static | 执行注册相关操作。 Registers (or replaces) a factory under `typeId`. |
public static Optional<ChannelFactory> get(String typeId)static | 返回工厂已注册用于`typeId`,if 任意。 Returns the factory registered for `typeId`, if any. |
public static Set<String> registeredTypes()static | 返回已注册类型。 Returns an immutable snapshot of registered type ids. |
方法详情Method Detail
register
public static ChannelFactory register(String typeId, ChannelFactory factory)
static
执行注册相关操作。
Registers (or replaces) a factory under typeId.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
typeId | String | 类型标识(类型 `String`)。The type id. |
factory | ChannelFactory | 工厂(类型 `ChannelFactory`)。The factory. |
ChannelFactory返回ChannelFactory。Returns channel factory.
源码Source
io/agentscope/builder/runtime/config/ChannelTypeRegistry.java:42–46get
public static Optional<ChannelFactory> get(String typeId)
static
返回工厂已注册用于typeId,if 任意。
Returns the factory registered for typeId, if any.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
typeId | String | 类型标识(类型 `String`)。The type id. |
Optional<ChannelFactory>返回可选。Returns optional.
源码Source
io/agentscope/builder/runtime/config/ChannelTypeRegistry.java:49–54registeredTypes
public static Set<String> registeredTypes()
static
返回已注册类型。
Returns an immutable snapshot of registered type ids.
Set<String>返回设置。Returns set.
源码Source
io/agentscope/builder/runtime/config/ChannelTypeRegistry.java:57–59