Class AiComponentScanner

java.lang.Object
com.aispect.core.engine.bootstrap.scanner.AiComponentScanner

public class AiComponentScanner extends Object
AI Component scanner, belonging tostartup phase (Bootstrap)Responsibilities.

Called when the proxy object is instantiated, responsible for:

  • Scan the target interface and its implementation class for AiUnitAgent and AiGraphAgent annotation
  • Verify the legality of annotation configuration (such as phase conflict detection)
  • Instantiate the corresponding Agent Handler,and deposit them uniformly ScanResult.invocationCache cache 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 Details

    • AiComponentScanner

      public AiComponentScanner()
  • Method Details

    • scan

      public AiScanResult scan(Object target, Class<?> interfaceClass)
      Scan the target interface and remove all Agent Resources are uniformly registered to ScanResult.invocationCache and 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 caller ScanResult.hasErrors() Judge and decide how to proceed.

      Graph Agent Registration agreement:Graph Agent Take each method of the interface as key、 AiExecutePhase.ALL for phase Stored in the cache for passing during the running phase instanceof Distinguish between types.

      Parameters:
      target - Target object (implementation class instance), which can be null
      interfaceClass - Proxied interface
      Returns:
      Scan results (including unified Agent Caching registry and error list)