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 Type
    Method
    Description
    void
    Destroy or clear the cache and release related resources.
    Compute cached hash value
    get(Method method, AiExecutePhase phase)
    Quickly retrieve the corresponding resources through the specified joint primary key.
    void
    put(Method method, AiExecutePhase phase, V resource)
    Register the parsed resource into the internal cache.
    boolean
    remove(Method method, AiExecutePhase phase)
    Remove resources from cache.
  • Method Details

    • computeHash

      String computeHash(Method method, AiExecutePhase phase)
      Compute cached hash value
      Parameters:
      method - method
      phase - Execution phase
      Returns:
      hash value
    • put

      void put(Method method, AiExecutePhase phase, V resource) throws AiSpectException
      Register the parsed resource into the internal cache.
      Parameters:
      method - method
      phase - Execution phase
      resource - Cached resource entities
      Throws:
      AiSpectException
    • get

      V get(Method method, AiExecutePhase phase)
      Quickly retrieve the corresponding resources through the specified joint primary key.
      Parameters:
      method - method
      phase - Execution phase
      Returns:
      The corresponding resource is returned if it does not exist. null
    • remove

      boolean remove(Method method, AiExecutePhase phase)
      Remove resources from cache.
      Parameters:
      method - method
      phase - Execution phase
      Returns:
      Removed successfully
    • clear

      void clear()
      Destroy or clear the cache and release related resources.