Class AgentStaticLoader
java.lang.Object
com.google.adk.web.AgentStaticLoader
- All Implemented Interfaces:
AgentLoader
用于程序化加载代理程序的静态代理加载器(Static Agent Loader)。
这个加载器会使用一个预先创建的代理实例列表,并通过 `AgentLoader` 接口将这些代理实例提供给应用程序使用。非常适合那些已经拥有代理实例、但只需要一种方便的方式来将这些代理实例封装到 `AgentLoader` 中的情况。
这个类本身并不是 Spring 组件;它的实例是通过编程方式创建的,然后通过工厂方法(factory methods)被注册为 Spring 的 Bean 对象。
-
构造函数概述
Constructors -
方法概述
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableList<String> 返回一个包含所有可用代理名称的列表。加载指定代理名称对应的 BaseAgent 实例。
-
构造函数详细信息
-
AgentStaticLoader
-
-
方法详细信息(Method Details)
-
listAgents
描述内容复制自接口文档:AgentLoader返回一个包含所有可用代理名称的列表。- Specified by:
listAgentsin interfaceAgentLoader- Returns:
- ImmutableList of agent names. Must not return null - return an empty list if no agents are available.
-
loadAgent
描述内容复制自接口文档:AgentLoader加载指定代理名称对应的 BaseAgent 实例。- Specified by:
loadAgentin interfaceAgentLoader- Parameters:
name- the name of the agent to load- Returns:
- BaseAgent instance for the given name
-