private void timerEvent ( ) throws IOException { if ( isMonitoring ) { Collection < Updater > myUpdaters ; synchronized ( this ) { myUpdaters = new ArrayList < Updater > ( updaters . keySet ( ) ) ; } // Run all the registered updates without holding a lock // on this context for ( Updater updater : myUpdaters ) { try { updater . doUpdates ( this ) ; } catch ( Throwable throwable ) { throwable . printStackTrace ( ) ; } } emitRecords ( ) ; } }
Timer callback .