Class DefaultAiInvocationContext<T>
java.lang.Object
com.aispect.core.engine.runtime.context.DefaultAiInvocationContext<T>
- Type Parameters:
T- The expected return value type of the method
- All Implemented Interfaces:
AiInvocationContext<T>
The default calling context implementation class belongs torunning phase (Runtime)Responsibilities.
Encapsulates runtime information such as target objects, methods, parameters and environment variables,
It also provides the ability to continue executing native logic (proceed())ability.
Created every time a method is intercepted, the life cycle is bound to a single call.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget Agent Functional description to assist reasoning.get Agent The name of the downgrade processing method.Get the logical name of the current agent.get AI Operation facade.Object[]getArgs()Get the original parameter list passed to this method.getEnv()Get the currently executed set of mounted environment variables (context implicit data).Gets the value of a specific environment variable set in the context.getError()Gets the exception thrown during the execution of the target method (if any).Get the reflection reference of the currently executing method.Get the preferred model name.Get the return result of the target method execution (if it has been executed).Get the currently proxied target object instance.proceed()Release the method call and execute the original Java Method implements logic.voidSet the exception thrown during the execution of the target method.voidsetProceedResult(Object result) Set the return result of the target method execution.
-
Constructor Details
-
DefaultAiInvocationContext
-
-
Method Details
-
getTarget
Description copied from interface:AiInvocationContextGet the currently proxied target object instance.- Specified by:
getTargetin interfaceAiInvocationContext<T>- Returns:
- target audience
-
getMethod
Description copied from interface:AiInvocationContextGet the reflection reference of the currently executing method.- Specified by:
getMethodin interfaceAiInvocationContext<T>- Returns:
- method reference
-
getArgs
Description copied from interface:AiInvocationContextGet the original parameter list passed to this method.- Specified by:
getArgsin interfaceAiInvocationContext<T>- Returns:
- method parameter array
-
getEnv
Description copied from interface:AiInvocationContextGet the currently executed set of mounted environment variables (context implicit data).- Specified by:
getEnvin interfaceAiInvocationContext<T>- Returns:
- Environment variable dictionary
-
getEnv
Description copied from interface:AiInvocationContextGets the value of a specific environment variable set in the context.- Specified by:
getEnvin interfaceAiInvocationContext<T>- Parameters:
key- Environment variable name- Returns:
- environment variable value
-
proceed
Description copied from interface:AiInvocationContextRelease the method call and execute the original Java Method implements logic.exist AI The processing chain can be interrupted by calling this method AI Take over and return to the native business code execution. And return the result calculated by the native code.
- Specified by:
proceedin interfaceAiInvocationContext<T>- Returns:
- Return value after native method execution
- Throws:
Exception- Exceptions thrown during execution of native logic
-
getProceedResult
Description copied from interface:AiInvocationContextGet the return result of the target method execution (if it has been executed).- Specified by:
getProceedResultin interfaceAiInvocationContext<T>- Returns:
- The return value of the target method, which may be null
-
setProceedResult
Description copied from interface:AiInvocationContextSet the return result of the target method execution.- Specified by:
setProceedResultin interfaceAiInvocationContext<T>- Parameters:
result- Return results
-
getError
Description copied from interface:AiInvocationContextGets the exception thrown during the execution of the target method (if any).- Specified by:
getErrorin interfaceAiInvocationContext<T>- Returns:
- the exception thrown, or if none null
-
setError
Description copied from interface:AiInvocationContextSet the exception thrown during the execution of the target method.- Specified by:
setErrorin interfaceAiInvocationContext<T>- Parameters:
error- abnormal
-
getAiOperations
Description copied from interface:AiInvocationContextget AI Operation facade.- Specified by:
getAiOperationsin interfaceAiInvocationContext<T>
-
getAgentName
Description copied from interface:AiInvocationContextGet the logical name of the current agent.- Specified by:
getAgentNamein interfaceAiInvocationContext<T>- Returns:
- Agent logical name of
-
getAgentDescription
Description copied from interface:AiInvocationContextget Agent Functional description to assist reasoning.- Specified by:
getAgentDescriptionin interfaceAiInvocationContext<T>- Returns:
- Agent describe
-
getAgentFallback
Description copied from interface:AiInvocationContextget Agent The name of the downgrade processing method.- Specified by:
getAgentFallbackin interfaceAiInvocationContext<T>- Returns:
- Downgrade processing method name
-
getModelName
Description copied from interface:AiInvocationContextGet the preferred model name.- Specified by:
getModelNamein interfaceAiInvocationContext<T>- Returns:
- The preferred model name, if not specified returns an empty string or null
-