question: public synchronized void onWriteEvent ( ) throws IOException { LRMIInvocationTrace trace = null ; try { while ( ! _contexts . isEmpty ( ) ) { Context current = _contexts . peek ( ) ; trace = current . getTrace ( ) ; if ( trace != null ) LRMIInvocationContext . updateContext ( trace , null , null , null , null , false , null , null ) ; noneBlockingWrite ( current ) ; if ( current . getPhase ( ) != Context . Phase . FINISH ) { setWriteInterest ( ) ; break ; } else { traceContextTotalWriteTime ( current ) ; _contexts . poll ( ) ; pendingWrites . decrement ( ) ; } } if ( _contexts . isEmpty ( ) ) { removeWriteInterest ( true ) ; } } finally { if ( trace != null ) LRMIInvocationContext . resetContext ( ) ; } }
target:  Called from WriteSelectorThread to complete pending write requests. This is synchronized to ensure mutual exclusion with writeBytesToChannelNoneBlocking method