1.1 --- a/launcher/src/main/java/org/apidesign/bck2brwsr/launcher/MethodInvocation.java Sun Dec 23 17:02:34 2012 +0100
1.2 +++ b/launcher/src/main/java/org/apidesign/bck2brwsr/launcher/MethodInvocation.java Sun Dec 23 18:24:18 2012 +0100
1.3 @@ -17,20 +17,34 @@
1.4 */
1.5 package org.apidesign.bck2brwsr.launcher;
1.6
1.7 +import java.util.concurrent.CountDownLatch;
1.8 +import java.util.concurrent.TimeUnit;
1.9 +
1.10 /**
1.11 *
1.12 * @author Jaroslav Tulach <jtulach@netbeans.org>
1.13 */
1.14 public final class MethodInvocation {
1.15 + final CountDownLatch wait = new CountDownLatch(1);
1.16 final String className;
1.17 final String methodName;
1.18 - String result;
1.19 - Exception exception;
1.20 + private String result;
1.21 + private Exception exception;
1.22
1.23 MethodInvocation(String className, String methodName) {
1.24 this.className = className;
1.25 this.methodName = methodName;
1.26 }
1.27 +
1.28 + void await(long timeOut) throws InterruptedException {
1.29 + wait.await(timeOut, TimeUnit.MILLISECONDS);
1.30 + }
1.31 +
1.32 + void result(String r, Exception e) {
1.33 + this.result = r;
1.34 + this.exception = e;
1.35 + wait.countDown();
1.36 + }
1.37
1.38 @Override
1.39 public String toString() {