// FIXME haven't even started yet... need to busy-wait, perhaps
public static String getData() {
        Future<String> f = getInstance().startupFuture.get();
        if (f == null) {
            // FIXME haven't even started yet... need to busy-wait, perhaps
        }
        try {
            String data = f.get(30, TimeUnit.SECONDS);
            return data;
        } catch (InterruptedException | ExecutionException e) {
            // FIXME failed to startup or was interrupted during startup; maybe throw to the caller?
            throw new IllegalStateException(e);
        } catch (TimeoutException e) {
            // FIXME got tired of waiting, maybe do something special here?
            throw new IllegalStateException(e);
        }
    }
Future<String> f = getInstance().startupFuture.get();
if (f == null) {
// FIXME haven't even started yet... need to busy-wait, perhaps
}
try {
public static String getData() {
Future<String> f = getInstance().startupFuture.get();
if (f == null) {
// FIXME haven't even started yet... need to busy-wait, perhaps
}
try {
String data = f.get(30, TimeUnit.SECONDS);
return data;
} catch (InterruptedException | ExecutionException e) {
// FIXME failed to startup or was interrupted during startup; maybe throw to the caller?
throw new IllegalStateException(e);
} catch (TimeoutException e) {
// FIXME got tired of waiting, maybe do something special here?
throw new IllegalStateException(e);
public static String getData() {
Future<String> f = getInstance().startupFuture.get();
if (f == null) {
// FIXME haven't even started yet... need to busy-wait, perhaps
}
try {
String data = f.get(30, TimeUnit.SECONDS);
return data;
} catch (InterruptedException | ExecutionException e) {
// FIXME failed to startup or was interrupted during startup; maybe throw to the caller?
throw new IllegalStateException(e);
} catch (TimeoutException e) {
// FIXME got tired of waiting, maybe do something special here?
throw new IllegalStateException(e);
}
}