*
* @exception Exception if an error we didn't expect occured
*/
+ private class YarrgTimestampFetcher extends Thread {
+ public String ts = null;
+ public void run() {
+ try {
+ ts = getYarrgTimestamp();
+ progresslog("(async) yarrg timestamp ready.");
+ } catch(Exception e) {
+ error("Error getting YARRG timestamp: "+e);
+ }
+ }
+ };
+
private void runUpload() throws Exception {
progresslog("starting");
- String yarrgts = "";
ProgressMonitor pm = new ProgressMonitor(frame,"Processing Market Data","Getting table data",0,100);
pm.setMillisToDecideToPopup(0);
pm.setMillisToPopup(0);
boolean doneyarrg = false, donepctb = false;
+ YarrgTimestampFetcher yarrgts_thread = null;
if (uploadToYarrg) {
- progresslog("yarrg timestamp...");
- yarrgts = getYarrgTimestamp();
- progresslog("yarrg timestamp done.");
+ progresslog("(async) yarrg timestamp...");
+ yarrgts_thread = new YarrgTimestampFetcher();
+ yarrgts_thread.start();
}
AccessibleTable accesstable = findMarketTable();
}
progresslog("(async) getisland done");
+ String yarrgts = null;
+ if (yarrgts_thread != null) {
+ progresslog("(async) yarrg timestamp join...");
+ yarrgts_thread.join();
+ progresslog("(async) yarrg timestamp joined.");
+ yarrgts = yarrgts_thread.ts;
+ }
+
if (islandName == null) {
error("Could not find island name in YPP user interface.");
return;