*/
private void startPolling() {
Thread poller = new Thread(new Runnable() {
public void run() {
ProcessingStatus oldStat = mGatewayProcess.getStatus();
ProcessingStatus newStat = oldStat;
Map<String, Pair<Exception, DataSourceStatus>> oldSourceStates =
getSourceStates();
Map<String, Pair<Exception, DataSourceStatus>> newSourceStates =
oldSourceStates;
while (!oldStat.isDone() ||
!allResultsReadorDead(oldSourceStates)) {
if (oldStat.isDone() && !mFinished) {
//stop timer
mFinishTime =
System.currentTimeMillis() - mDate.getTime();
mFinishTimeString = msToString(mFinishTime);
mFinished = true;
}
if (!newStat.equals(oldStat) ||
sourceStatesChanged(
newSourceStates, oldSourceStates)) {
NamedProcess.this.setChanged();
NamedProcess.this.notifyObservers();
oldStat = newStat;