@@ -0,0 +1,1388 @@
+package com.github.johrstrom.util;%0D%0A%0D%0Aimport java.util.HashMap;%0D%0Aimport java.util.Map;%0D%0A%0D%0Aimport org.eclipse.jetty.server.Server;%0D%0Aimport org.slf4j.Logger;%0D%0Aimport org.slf4j.LoggerFactory;%0D%0A%0D%0Apublic class ServerInstantiator %7B%0D%0A%09private static final Logger log = LoggerFactory.getLogger(ServerInstantiator.class);%0D%0A%09private static Map%3CInteger, Server%3E server_instances;%0D%0A%0D%0A%09/**%0D%0A%09 * Retrieves or creates the server%0D%0A%09 * %0D%0A%09 * @param port%0D%0A%09 */%0D%0A%09public static Server getInstance(int port) %7B%0D%0A%09%09// Build the hashmap if it's not there%0D%0A%09%09if (server_instances == null)%0D%0A%09%09%09server_instances = new HashMap%3CInteger, Server%3E();%0D%0A%0D%0A%09%09// build the server instance if it's not there%0D%0A%09%09if (server_instances.get(port) == null) %7B%0D%0A%09%09%09Server new_server_instance = new Server(port);%0D%0A%09%09%09server_instances.put(port, new_server_instance);%0D%0A%09%09%7D%0D%0A%0D%0A%09%09// return the server instance%0D%0A%09%09return server_instances.get(port);%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * Removes a single server%0D%0A%09 * %0D%0A%09 * @param port%0D%0A%09 */%0D%0A%09public static void clear_server(int port) %7B%0D%0A%09%09if (server_instances.containsKey(port))%0D%0A%09%09%09try %7B%0D%0A%09%09%09%09server_instances.get(port).stop();%0D%0A%09%09%09%7D catch (Exception e) %7B%0D%0A%09%09%09%09log.error(%22Couldn't stop http server%22, e);%0D%0A%09%09%09%7D%0D%0A%09%09server_instances.remove(port);%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * Removes all the servers%0D%0A%09 */%0D%0A%09public static void clear_servers() %7B%0D%0A%09%09for (int port : server_instances.keySet())%0D%0A%09%09%09clear_server(port);%0D%0A%09%7D%0D%0A%7D%0D%0A

add missing class