public void waitOnChains ( long quiesceTimeout ) { ChannelFramework cf = ChannelFrameworkFactory . getChannelFramework ( ) ; int elapsedTime = 0 ; if ( waitingChainNames . size ( ) > 0 && elapsedTime < quiesceTimeout ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Waiting on " + waitingChainNames . size ( ) + " chain(s) to stop" ) ; } Iterator < String > iter = waitingChainNames . iterator ( ) ; while ( iter . hasNext ( ) ) { if ( ! cf . isChainRunning ( iter . next ( ) ) ) iter . remove ( ) ; } try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException ie ) { // ignore } elapsedTime += 1000 ; } }
Poll the list of chains until they re stopped or the quiesce timeout is hit