Module bus.http

Interface Interceptor

All Known Implementing Classes:
BridgeInterceptor, CacheInterceptor, CallServerInterceptor, ConnectInterceptor, FileInterceptor, RetryAndFollowUp

public interface Interceptor
Intercepts, observes, modifies, and potentially short-circuits requests and their corresponding responses. Typically, interceptors add, remove, or transform headers on requests or responses.
Since:
Java 17+
Author:
Kimi Liu
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Provides a description of what this interceptor implementation does.
    Intercepts the given chain to process a network request.
  • Method Details

    • intercept

      Response intercept(NewChain chain) throws IOException
      Intercepts the given chain to process a network request.
      Parameters:
      chain - The network call chain.
      Returns:
      The Response from the network request.
      Throws:
      IOException - if an I/O error occurs during interception.
    • instructions

      default void instructions()
      Provides a description of what this interceptor implementation does. This can be useful for other business scenarios or services, such as distributed tracing.