Class JavaMethodToolResponse

All Implemented Interfaces:
PropertyChangeSource, Rebindable

public class JavaMethodToolResponse extends AbstractToolResponse<JavaMethodToolCall>
A rich POJO that captures the complete and final outcome of a single tool call. This class now follows a deferred execution model and manages the thread-local context for Java tool execution.
Author:
anahata-gemini-pro-2.5
  • Field Details

    • current

      private static final ThreadLocal<JavaMethodToolResponse> current
      A thread-local storage for the currently executing Java tool response. This allows tool logic to access its own context without explicit parameter passing.
    • exception

      private transient Throwable exception
      The raw exception thrown during execution, for debugging and session serialization. Ignored during schema generation as it's an internal detail.
    • executing

      private transient AtomicBoolean executing
      Guard to ensure only one thread can execute this response at a time.
  • Constructor Details

    • JavaMethodToolResponse

      public JavaMethodToolResponse(@NonNull @NonNull JavaMethodToolCall call)
      Constructs a new JavaMethodToolResponse for a specific call.
      Parameters:
      call - The originating tool call.
  • Method Details