private boolean awaitRunning ( Service service , long timeoutAt ) { if ( service . isRunning ( ) ) { return true ; } long waitMillis = timeoutAt - System . currentTimeMillis ( ) ; if ( waitMillis <= 0 ) { return false ; } try { service . start ( ) . get ( waitMillis , TimeUnit . MILLISECONDS ) ; } catch ( Exception e ) { // Fall through } return service . isRunning ( ) ; }
Returns true if the Guava service entered the RUNNING state within the specified time period .