Package com.networknt.handler
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
-
-
Field Summary
-
Fields inherited from interface com.networknt.handler.LightHttpHandler
AUDIT_CONFIG_NAME, AUDIT_ON_ERROR, AUDIT_STACK_TRACE, auditConfig, auditOnError, auditStackTrace, config, CONFIG_NAME, ERROR_NOT_DEFINED, logger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidaddHandlerMDCContext(io.undertow.server.HttpServerExchange exchange, String field, String value)io.undertow.server.HttpHandlergetNext()Get the next handler in the chainbooleanisEnabled()Indicate if this handler is enabled or not.voidregister()Register this handler to the handler registration.default voidreload()Reload config values in case the config values changed by config server.MiddlewareHandlersetNext(io.undertow.server.HttpHandler next)Set the next handler in the chain-
Methods inherited from interface com.networknt.handler.LightHttpHandler
setExchangeStatus, setExchangeStatus, setExchangeStatus
-
-
-
-
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.
-
-