Lachlan, thanks for the reply, a slightly modified version of your code works. The "b" option, the only one applicable to my situation... Below is my modified loop:
// try to connect to all given urls for(String url : urls){ url = "" class="Apple-tab-span" style="white-space:pre"> try{ // code added to my loop // can't deal with existing EOApp instance args because // one was not instantiated yet (this code is in static void main(String[] args) ) NSMutableDictionary arguments = new NSMutableDictionary(); arguments.setObjectForKey(url, ApplicationURLProperty); EOApplication.setArguments(arguments); // try to connect com.webobjects.eoapplication.client.EOClientApplicationSupport.main( new String[]{ApplicationURLProperty, url});
// wait for the specified timeout synchronized(monitor){ monitor.wait(TIMEOUT); } // if connection has been established, return if(connected) return; }catch(Throwable th){} }
Thanks, Flor |