Class AiComponentScanner
Called when the proxy object is instantiated, responsible for:
- Scan the target interface and its implementation class for
AiUnitAgentandAiGraphAgentannotation - Verify the legality of annotation configuration (such as phase conflict detection)
- Instantiate the corresponding Agent Handler,and deposit them uniformly
ScanResult.invocationCachecache registry
Scan result passed ScanResult Returned to the caller for use by the runtime phase.
The scanner usesPartially successfulSemantics: Scan continues even if errors are encountered, all errors are collected
ScanResult.getErrors() , it is up to the caller to decide how to handle it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionScan the target interface and remove all Agent Resources are uniformly registered toScanResult.invocationCacheand return scan results.
-
Constructor Details
-
AiComponentScanner
public AiComponentScanner()
-
-
Method Details
-
scan
Scan the target interface and remove all Agent Resources are uniformly registered toScanResult.invocationCacheand return scan results.This method does not throw exceptions. Configuration errors encountered during scanning (reflection failure, phase conflicts, etc.) are collected in
ScanResult.getErrors(), passed by the callerScanResult.hasErrors()Judge and decide how to proceed.Graph Agent Registration agreement:Graph Agent Take each method of the interface as key、
AiExecutePhase.ALLfor phase Stored in the cache for passing during the running phaseinstanceofDistinguish between types.- Parameters:
target- Target object (implementation class instance), which can be nullinterfaceClass- Proxied interface- Returns:
- Scan results (including unified Agent Caching registry and error list)
-