code: public synchronized void shutdown()
     {
        if (factory != null && handlerCount == 0)
        {
           factory.destroyForPort(port);
        }
        else
        {
           LOG.warnv("Failed to shutdown Undertow server on port {0,number,####0} because it is still in use", port);
        }
     }
docs: This method will shut down the server engine and
  remove it from the factory's cache.