checkState(ceMainThread != null, "getStatus() can not be called before start()");
if (ceMainThread.isStarted()) {
- return Status.OPERATIONAL;
+ return ceMainThread.isOperational() ? Status.OPERATIONAL : Status.FAILED;
}
return Status.DOWN;
}
private static final int CHECK_FOR_STOP_DELAY = 50;
private volatile boolean stop = false;
private volatile boolean started = false;
+ private volatile boolean operational = false;
public CeMainThread() {
super(CE_MAIN_THREAD_NAME);
@Override
public void run() {
boolean startupSuccessful = attemptStartup();
+ this.operational = startupSuccessful;
this.started = true;
if (startupSuccessful) {
// call below is blocking
return started;
}
+ public boolean isOperational() {
+ return operational;
+ }
+
public void stopIt() {
// stop looping indefinitely
this.stop = true;