// Path: src/main/java/cc/agentx/Constants.java
// public final class Constants {
//     public static final String APP_NAME = "agentx";
//     public static final String APP_VERSION = "1.3";
//     public static final String WEB_SERVER_NAME = "agentx-web-console";
// 
//     private Constants() {
//     }
// }


import cc.agentx.Constants;
import java.io.*;
import java.net.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
            port = getIdlePort();
            baseDir = System.getProperty("user.dir").replaceAll("\\\\", "/") + "/www/";
        }
        new HttpServer(port, baseDir).start();
    }

    public int start() {
        isRunning.set(true);
        executor.submit(new ServiceListener(port));
        return port;
    }

    public void stop() {
        isRunning.set(false);
        shutdown(executor);
    }

    boolean shutdown(final ExecutorService pool) {
        pool.shutdown();
        try {
            if (!pool.awaitTermination(60, TimeUnit.SECONDS)) {
                pool.shutdownNow();
                if (!pool.awaitTermination(60, TimeUnit.SECONDS))
                    return false;
            }
        } catch (InterruptedException ie) {
            pool.shutdownNow();
            Thread.currentThread().interrupt();
        }
        if (info)
// Path: src/main/java/cc/agentx/Constants.java
// public final class Constants {
//     public static final String APP_NAME = "agentx";
//     public static final String APP_VERSION = "1.3";
//     public static final String WEB_SERVER_NAME = "agentx-web-console";
// 
//     private Constants() {
//     }
// }


// Path: src/main/java/cc/agentx/ui/HttpServer.java
import cc.agentx.Constants;
import java.io.*;
import java.net.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;

            port = getIdlePort();
            baseDir = System.getProperty("user.dir").replaceAll("\\\\", "/") + "/www/";
        }
        new HttpServer(port, baseDir).start();
    }

    public int start() {
        isRunning.set(true);
        executor.submit(new ServiceListener(port));
        return port;
    }

    public void stop() {
        isRunning.set(false);
        shutdown(executor);
    }

    boolean shutdown(final ExecutorService pool) {
        pool.shutdown();
        try {
            if (!pool.awaitTermination(60, TimeUnit.SECONDS)) {
                pool.shutdownNow();
                if (!pool.awaitTermination(60, TimeUnit.SECONDS))
                    return false;
            }
        } catch (InterruptedException ie) {
            pool.shutdownNow();
            Thread.currentThread().interrupt();
        }
        if (info)
            System.out.println(Constants.WEB_SERVER_NAME + " stopped.");