question: private void generateEvent ( EventReg reg , Item pre , Item post , ServiceID sid , long now ) { if ( reg . leaseExpiration <= now ) return ; if ( ( reg . transitions & ServiceRegistrar . TRANSITION_NOMATCH_MATCH ) != 0 && ( pre == null || ! matchItem ( reg . tmpl , pre ) ) && ( post != null && matchItem ( reg . tmpl , post ) ) ) pendingEvent ( reg , sid , post , ServiceRegistrar . TRANSITION_NOMATCH_MATCH ) ; else if ( ( reg . transitions & ServiceRegistrar . TRANSITION_MATCH_NOMATCH ) != 0 && ( pre != null && matchItem ( reg . tmpl , pre ) ) && ( post == null || ! matchItem ( reg . tmpl , post ) ) ) pendingEvent ( reg , sid , post , ServiceRegistrar . TRANSITION_MATCH_NOMATCH ) ; else if ( ( reg . transitions & ServiceRegistrar . TRANSITION_MATCH_MATCH ) != 0 && ( pre != null && matchItem ( reg . tmpl , pre ) ) && ( post != null && matchItem ( reg . tmpl , post ) ) ) pendingEvent ( reg , sid , post , ServiceRegistrar . TRANSITION_MATCH_MATCH ) ; }
target:  Generate an event if the event registration matches.  A null pre represents creation of a new item, a null post represents deletion of an item.  sid is the serviceID of the item.