1.1 --- a/launcher/fx/src/main/java/org/apidesign/bck2brwsr/launcher/BaseHTTPLauncher.java Sun Apr 28 21:17:04 2013 +0200
1.2 +++ b/launcher/fx/src/main/java/org/apidesign/bck2brwsr/launcher/BaseHTTPLauncher.java Sun May 05 18:16:43 2013 +0200
1.3 @@ -35,6 +35,7 @@
1.4 import java.util.List;
1.5 import java.util.Set;
1.6 import java.util.concurrent.BlockingQueue;
1.7 +import java.util.concurrent.Callable;
1.8 import java.util.concurrent.CountDownLatch;
1.9 import java.util.concurrent.LinkedBlockingQueue;
1.10 import java.util.concurrent.TimeUnit;
1.11 @@ -55,7 +56,7 @@
1.12 * Supports execution in native browser as well as Java's internal
1.13 * execution engine.
1.14 */
1.15 -abstract class BaseHTTPLauncher extends Launcher implements Closeable {
1.16 +abstract class BaseHTTPLauncher extends Launcher implements Closeable, Callable<HttpServer> {
1.17 private static final Logger LOG = Logger.getLogger(BaseHTTPLauncher.class.getName());
1.18 private static final InvocationContext END = new InvocationContext(null, null, null);
1.19 private final Set<ClassLoader> loaders = new LinkedHashSet<>();
1.20 @@ -106,6 +107,7 @@
1.21 String prefix = startpage.substring(0, last);
1.22 String simpleName = startpage.substring(last);
1.23 s.getServerConfiguration().addHttpHandler(new SubTree(resources, prefix), "/");
1.24 + server = s;
1.25 try {
1.26 launchServerAndBrwsr(s, simpleName);
1.27 } catch (URISyntaxException | InterruptedException ex) {
1.28 @@ -422,6 +424,11 @@
1.29 }
1.30
1.31 @Override
1.32 + public HttpServer call() throws Exception {
1.33 + return server;
1.34 + }
1.35 +
1.36 + @Override
1.37 public void close() throws IOException {
1.38 shutdown();
1.39 }