@Override
    public void shutdown() {
        final WireMockServer server = this;
        Thread shutdownThread = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    // We have to sleep briefly to finish serving the shutdown request before stopping the server, as
                    // there's no support in Jetty for shutting down after the current request.
                    // See http://stackoverflow.com/questions/4650713
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                server.stop();
            }
        });
        shutdownThread.start();
    }
@ Override public void shutdown ( ) { final WireMockServer server = this ; Thread shutdownThread = new Thread ( new Runnable ( ) { @ Override public void run ( ) { try { Thread . sleep ( 100 ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } server . stop ( ) ; } } ) ; shutdownThread . start ( ) ; }
Gracefully shutdown the server.

This method assumes it is being called as the result of an incoming HTTP request.