Interface ToolHandler.Cancellable
- All Superinterfaces:
ToolHandler
- Enclosing interface:
ToolHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A handler that observes its cancellation signal while it runs. Implement it with a
three-argument lambda; calling the two-argument form runs it with a never-cancelled signal.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ToolHandler
ToolHandler.CancellableModifier and TypeInterfaceDescriptionstatic interfaceA handler that observes its cancellation signal while it runs. -
Method Summary
Modifier and TypeMethodDescriptiondefault com.fasterxml.jackson.databind.node.ObjectNodehandle(com.fasterxml.jackson.databind.JsonNode arguments, ServerContext context) Runs the handler with a never-cancelled signal (direct invocations and tests).com.fasterxml.jackson.databind.node.ObjectNodehandle(com.fasterxml.jackson.databind.JsonNode arguments, ServerContext context, CancellationSignal cancellation) Executes the tool, checkingcancellationat each point where stopping is still safe.
-
Method Details
-
handle
com.fasterxml.jackson.databind.node.ObjectNode handle(com.fasterxml.jackson.databind.JsonNode arguments, ServerContext context, CancellationSignal cancellation) throws Exception Executes the tool, checkingcancellationat each point where stopping is still safe.- Specified by:
handlein interfaceToolHandler- Parameters:
arguments- the parsed tool-call argumentscontext- the shared server contextcancellation- the call's cancellation signal- Returns:
- the structured result payload
- Throws:
Exception- on any failure
-
handle
default com.fasterxml.jackson.databind.node.ObjectNode handle(com.fasterxml.jackson.databind.JsonNode arguments, ServerContext context) throws Exception Runs the handler with a never-cancelled signal (direct invocations and tests).- Specified by:
handlein interfaceToolHandler- Parameters:
arguments- the parsed tool-call argumentscontext- the shared server context- Returns:
- the structured result payload
- Throws:
Exception- on any failure
-