private synchronized void waitForPush ( ) { long waitStart = - 1L ; while ( waiting != null && waiting . isEmpty ( ) && ! loaded ) { long untouched = System . currentTimeMillis ( ) - lastTouch ; if ( untouched > timeout . longValue ( ) ) { logger . error ( "[" + this + "] Jiterator timeout for " + getName ( ) ) ; setLoadException ( new TimeoutException ( "Jiterator " + getName ( ) + " timed out while loading" ) ) ; } if ( waitStart == - 1L ) { waitStart = System . currentTimeMillis ( ) ; } else { if ( ( System . currentTimeMillis ( ) - waitStart ) > CalendarWrapper . MINUTE ) { if ( ( System . currentTimeMillis ( ) - scream ) > CalendarWrapper . MINUTE ) { scream = System . currentTimeMillis ( ) ; logger . warn ( "[" + this + "] " + ( ( System . currentTimeMillis ( ) - lastTouch ) / 1000 ) + " seconds since last touch." ) ; } } } long multiplier = ( untouched / ( 15 * CalendarWrapper . SECOND ) ) + 1 ; try { wait ( 150L * multiplier ) ; } catch ( InterruptedException ignore ) { } } }
Waits for a new item to be put into the jiterator or for the jiterator to be marked empty .