class DumpHandler implements MiddlewareHandler {

    private static DumpConfig config = (DumpConfig) Config.getInstance().getJsonObjectConfig(DumpConfig.CONFIG_NAME, DumpConfig.class);

    private volatile HttpHandler next;

    public DumpHandler() { }

    @Override
    public HttpHandler getNext() {
        return next;
    }

    @Override
    public MiddlewareHandler setNext(final HttpHandler next) {
        Handlers.handlerNotNull(next);
        this.next = next;
        return this;
    }

    @Override
    public boolean isEnabled() {
        return config.isEnabled();
    }

    @Override
    public void register() {
        ModuleRegistry.registerModule(DumpConfig.CONFIG_NAME, DumpHandler.class.getName(), Config.getNoneDecryptedInstance().getJsonMapConfigNoCache(DumpConfig.CONFIG_NAME), null);
    }

    @Override
    public void handleRequest(final HttpServerExchange exchange) throws Exception {<FILL_FUNCTION_BODY>}

    @Override
    public void reload() {
        config = (DumpConfig)Config.getInstance().getJsonObjectConfigNoCache(DumpConfig.CONFIG_NAME, DumpConfig.class);
        ModuleRegistry.registerModule(DumpConfig.CONFIG_NAME, DumpHandler.class.getName(), Config.getNoneDecryptedInstance().getJsonMapConfigNoCache(DumpConfig.CONFIG_NAME), null);
        if(logger.isInfoEnabled()) logger.info("DumpHandler is reloaded.");
    }
}

        if (exchange.isInIoThread()) {
            exchange.dispatch(this);
            return;
        }
        if(isEnabled()) {
            Map<String, Object> result = new LinkedHashMap<>();
            //create rootDumper which will do dumping.
            RootDumper rootDumper = new RootDumper(config, exchange);
            //dump request info into result right away
            rootDumper.dumpRequest(result);
            //only add response wrapper when response config is not set to "false"
            if(config.isResponseEnabled()) {
                //set Conduit to the conduit chain to store response body
                exchange.addResponseWrapper((factory, exchange12) -> new StoreResponseStreamSinkConduit(factory.create(), exchange12));
            }
            //when complete exchange, dump response info to result, and log the result.
            exchange.addExchangeCompleteListener((exchange1, nextListener) ->{
                try {
                    rootDumper.dumpResponse(result);
                    //log the result
                    DumpHelper.logResult(result, config);
                } catch (Throwable e) {
                    logger.error("ExchangeListener throwable", e);
                } finally {
                    nextListener.proceed();
                }
            });
        }
        Handler.next(exchange, next);
    
<no_super_class>