synchronized void pushPair ( Session session , Object [ ] row1 , Object [ ] row2 ) { if ( maxRowsQueued == 0 ) { trigger . fire ( triggerType , name . name , table . getName ( ) . name , row1 , row2 ) ; return ; } if ( rowsQueued >= maxRowsQueued ) { if ( nowait ) { pendingQueue . removeLast ( ) ; // overwrite last } else { try { wait ( ) ; } catch ( InterruptedException e ) { /* ignore and resume */ } rowsQueued ++ ; } } else { rowsQueued ++ ; } pendingQueue . add ( new TriggerData ( session , row1 , row2 ) ) ; notify ( ) ; // notify pop's wait }
The main thread tells the trigger thread to fire by this call . If this Trigger is not threaded then the fire method is caled immediately and executed by the main thread . Otherwise the row data objects are added to the queue to be used by the Trigger thread .