javaApiInterceptAgentClosing

Intercepts and sets a handler to be invoked before an agent is closed.

JVM-friendly overload that accepts an async interceptor.

Example (Java): pipeline.interceptAgentClosing(feature, eventContext -> { // Pre-close actions return java.util.concurrent.CompletableFuture.completedFuture(null); });