Interface MiddlewareHandler

  • All Superinterfaces:
    io.undertow.server.HttpHandler, LightHttpHandler
    All Known Subinterfaces:
    Interceptor, RequestInterceptor, ResponseInterceptor
    All Known Implementing Classes:
    RequestInterceptorInjectionHandler, ResponseInterceptorInjectionHandler

    public interface MiddlewareHandler
    extends LightHttpHandler
    A interface for middleware handlers. All middleware handlers must implement this interface so that the handler can be plugged in to the request/response chain during server startup with SPI (Service Provider Interface). The entire light-4j framework is a core server that provides a plugin structure to hookup all sorts of plugins to handler different cross-cutting concerns. The middleware handlers are designed based on chain of responsibility pattern. This handler extends LightHttpHandler which has a default method to handle the error status response.
    Author:
    Steve Hu
    • Method Detail

      • getNext

        io.undertow.server.HttpHandler getNext()
        Get the next handler in the chain
        Returns:
        HttpHandler
      • setNext

        MiddlewareHandler setNext​(io.undertow.server.HttpHandler next)
        Set the next handler in the chain
        Parameters:
        next - HttpHandler
        Returns:
        MiddlewareHandler
      • isEnabled

        boolean isEnabled()
        Indicate if this handler is enabled or not.
        Returns:
        boolean true if enabled
      • register

        void register()
        Register this handler to the handler registration.
      • reload

        default void reload()
        Reload config values in case the config values changed by config server.
      • addHandlerMDCContext

        default void addHandlerMDCContext​(io.undertow.server.HttpServerExchange exchange,
                                          String field,
                                          String value)