private void isStartupFinished ( ) { boolean started = false ; try { while ( ! started ) { if ( exists ( localhostURL ) ) started = true ; Thread . sleep ( 5 * 1000 ) ; } } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } if ( started ) { statusLabel . setText ( "Nakamura is running." ) ; statusLabel . setForeground ( Color . green ) ; launchButton . setEnabled ( false ) ; browserButton . setEnabled ( true ) ; } }
Pings the Apache Sling server URL every 5 seconds to see if it has finished booting . Once it receives an OK status it enables the button to launch the browser and disables the launch Nakamura button .