@ Handler ( priority = - 1000 ) public void onStop ( Stop event ) throws InterruptedException { while ( ! inputWriters . isEmpty ( ) ) { Writer handler = inputWriters . entrySet ( ) . iterator ( ) . next ( ) . getValue ( ) ; handler . close ( event ) ; } while ( ! outputWriters . isEmpty ( ) ) { Writer handler = outputWriters . entrySet ( ) . iterator ( ) . next ( ) . getValue ( ) ; handler . close ( event ) ; } }
Handle stop by closing all files .