diff -r a4b4d500e7e6 -r 892dcb178737 launcher/http/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java --- a/launcher/http/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java Sun Apr 28 22:10:57 2013 +0200 +++ b/launcher/http/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java Sun May 05 18:16:43 2013 +0200 @@ -35,6 +35,7 @@ import java.util.List; import java.util.Set; import java.util.concurrent.BlockingQueue; +import java.util.concurrent.Callable; import java.util.concurrent.CountDownLatch; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; @@ -56,7 +57,7 @@ * Supports execution in native browser as well as Java's internal * execution engine. */ -final class Bck2BrwsrLauncher extends Launcher implements Closeable { +final class Bck2BrwsrLauncher extends Launcher implements Closeable, Callable { private static final Logger LOG = Logger.getLogger(Bck2BrwsrLauncher.class.getName()); private static final InvocationContext END = new InvocationContext(null, null, null); private final Set loaders = new LinkedHashSet<>(); @@ -103,6 +104,7 @@ String prefix = startpage.substring(0, last); String simpleName = startpage.substring(last); s.getServerConfiguration().addHttpHandler(new SubTree(resources, prefix), "/"); + server = s; try { launchServerAndBrwsr(s, simpleName); } catch (URISyntaxException | InterruptedException ex) { @@ -443,6 +445,11 @@ } @Override + public HttpServer call() throws Exception { + return server; + } + + @Override public void close() throws IOException { shutdown(); }