Package com.aispect.api
Interface AgentInvocationCache<V extends AiAgentFilter>
- Type Parameters:
V- The cached resource object type (e.g. AiResourceContext wrapper etc.)
- All Known Implementing Classes:
AgentInvocationCacheImpl
public interface AgentInvocationCache<V extends AiAgentFilter>
Global scheduling cache interface for agents and node resources
Adopt combined mode (can be packaged internally Hashtable or ConcurrentHashMap etc. structure). Concrete implementation class (such as UnitInvocationCache, GraphInvocationCache)should have complete control own Hash Compute logic and provide basic resource retrieval capabilities to the outside world.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Destroy or clear the cache and release related resources.computeHash(Method method, AiExecutePhase phase) Compute cached hash valueget(Method method, AiExecutePhase phase) Quickly retrieve the corresponding resources through the specified joint primary key.voidput(Method method, AiExecutePhase phase, V resource) Register the parsed resource into the internal cache.booleanremove(Method method, AiExecutePhase phase) Remove resources from cache.
-
Method Details
-
computeHash
Compute cached hash value- Parameters:
method- methodphase- Execution phase- Returns:
- hash value
-
put
Register the parsed resource into the internal cache.- Parameters:
method- methodphase- Execution phaseresource- Cached resource entities- Throws:
AiSpectException
-
get
Quickly retrieve the corresponding resources through the specified joint primary key.- Parameters:
method- methodphase- Execution phase- Returns:
- The corresponding resource is returned if it does not exist. null
-
remove
Remove resources from cache.- Parameters:
method- methodphase- Execution phase- Returns:
- Removed successfully
-
clear
void clear()Destroy or clear the cache and release related resources.
-