int refreshAndGetMax ( ) { int max = 0 ; for ( InputChannel channel : inputGate . getInputChannels ( ) . values ( ) ) { if ( channel instanceof RemoteInputChannel ) { RemoteInputChannel rc = ( RemoteInputChannel ) channel ; int size = rc . unsynchronizedGetNumberOfQueuedBuffers ( ) ; max = Math . max ( max , size ) ; } } return max ; }
Iterates over all input channels and collects the maximum number of queued buffers in a channel in a best - effort way .