Class AgentInterceptor
java.lang.Object
com.aispect.core.engine.runtime.interceptor.AgentInterceptor
- All Implemented Interfaces:
InvocationHandler
JDK The core interceptor of dynamic proxy, which belongs torunning phase (Runtime)Responsibilities.
delegate at instantiation AiComponentScanner Complete annotation scanning and resource registration during startup;
When the method is called, from AgentInvocationCacheImpl Read the registered Agent,
pass instanceof distinguish AiUnitAgentHandler and AbstractGraphAgent,
and routes the call to the appropriate execution engine (Unit / Graph)。
-
Constructor Summary
ConstructorsConstructorDescriptionAgentInterceptor(Object target, Class<?> interfaceClass, AiOperations aiOperations) Interceptor constructor. -
Method Summary
-
Constructor Details
-
AgentInterceptor
public AgentInterceptor(Object target, Class<?> interfaceClass, AiOperations aiOperations) throws AiScanException Interceptor constructor.Trigger component scanning in the startup phase immediately upon instantiation: entrust
AiComponentScannerScan the annotations of the target interface and verify the legality of the resources. and will instantiate Handler DepositinvocationCache。- Parameters:
target- The proxy's target object instanceinterfaceClass- The interface class corresponding to the agentaiOperations- AI Service operation interface instance- Throws:
AiScanException- If the component scan during the startup phase finds configuration errors
-
-
Method Details
-
invoke
Interception entry during running phase: According to the cached Agent Resources to route calls to the appropriate engine.Priority:Unit Agent > Graph Agent > Native method call (informal)
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-