Package com.networknt.handler
Interface MiddlewareHandler
-
- All Superinterfaces:
io.undertow.server.HttpHandler,LightHttpHandler
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_ON_ERROR, AUDIT_STACK_TRACE, auditOnError, auditStackTrace, config, CONFIG_NAME, ERROR_NOT_DEFINED, logger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.MiddlewareHandlersetNext(io.undertow.server.HttpHandler next)Set the next handler in the chain-
Methods inherited from interface com.networknt.handler.LightHttpHandler
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.
-
-