public void stop() {
        log.info("Stopping REST server");

        try {
            if (handlers.isRunning()) {
                for (Handler handler : handlers.getHandlers()) {
                    if (handler != null) {
                        Utils.closeQuietly(handler::stop, handler.toString());
                    }
                }
            }
            for (ConnectRestExtension connectRestExtension : connectRestExtensions) {
                try {
                    connectRestExtension.close();
                } catch (IOException e) {
                    log.warn("Error while invoking close on " + connectRestExtension.getClass(), e);
                }
            }
            jettyServer.stop();
            jettyServer.join();
        } catch (Exception e) {
            throw new ConnectException("Unable to stop REST server", e);
        } finally {
            try {
                jettyServer.destroy();
            } catch (Exception e) {
                log.error("Unable to destroy REST server", e);
            }
        }

        log.info("REST server stopped");
    }
Pluggable hook to customize the admin resources on this server after they have been instantiated and registered
with the given {@link ResourceConfig}. This may be used to, for example, add REST extensions via
{@link #registerRestExtensions(Herder, ResourceConfig)}.
<p>
<em>N.B.: Classes do <b>not</b> need to register the resources provided in {@link #adminResources()} with
the {@link ResourceConfig} parameter in this method; they are automatically registered by the parent class.</em>
@param adminResourceConfig the {@link ResourceConfig} that the server's admin listeners are registered with; never null
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/RestServer.java