WeComChannelRegistry
public final class WeComChannelRegistry
io/agentscope/extensions/channel/wecom/WeComChannelRegistry.java:30–54WeCom 渠道注册表,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.extensions.channel.wecom 包。核心成员包括 instance、register、unregister、get。
Process-wide lookup table from channelId to WeComChannel instance. Used by
WeComCallbackController to dispatch URL-routed requests onto the correct channel.
Channels register themselves in WeComChannel#start() and remove on
WeComChannel#stop(). The controller obtains the same singleton via
#instance() (no Spring wiring required), since the channel is created by
io.agentscope.harness.agent.gateway.channel.ChannelFactory's static factory and the controller
by Spring's component scan — neither knows about the other ahead of time.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static WeComChannelRegistry instance()static | 返回实例。 Returns the process-wide singleton instance. |
public void register(WeComChannel channel) | 设置注册。 Performs the register operation. |
public void unregister(String channelId) | 设置注销。 Performs the unregister operation. |
public WeComChannel get(String channelId) | 按条件读取数据。 Performs the get operation. |
方法详情Method Detail
instance
public static WeComChannelRegistry instance()
返回实例。
Returns the process-wide singleton instance.
WeComChannelRegistryio/agentscope/extensions/channel/wecom/WeComChannelRegistry.java:39–41register
public void register(WeComChannel channel)
设置注册。
Performs the register operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
channel | WeComChannel | 渠道(类型 `WeComChannel`)。The channel. |
io/agentscope/extensions/channel/wecom/WeComChannelRegistry.java:43–45unregister
public void unregister(String channelId)
设置注销。
Performs the unregister operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
channelId | String | 渠道标识(类型 `String`)。The channel id. |
io/agentscope/extensions/channel/wecom/WeComChannelRegistry.java:47–49get
public WeComChannel get(String channelId)
按条件读取数据。
Performs the get operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
channelId | String | 渠道标识(类型 `String`)。The channel id. |
WeComChannelio/agentscope/extensions/channel/wecom/WeComChannelRegistry.java:51–53