private void elideEvents(){
  if (!s_eventElission) {
    return;
  }
  final Iterator<QuorumStateChangeEvent> events=queue.iterator();
  QuorumStateChangeEvent uce=null;
  QuorumStateChangeEvent dce=null;
  QuorumStateChangeEvent add=null;
  while (events.hasNext()) {
    final QuorumStateChangeEvent tst=events.next();
    if (tst.getEventType() == QuorumStateChangeEventEnum.PIPELINE_UPSTREAM_CHANGE) {
      if (uce != null) {
        if (log.isDebugEnabled())         log.debug("Elission removal of: " + uce);
        queue.remove(uce);
      }
      uce=tst;
    }
 else     if (tst.getEventType() == QuorumStateChangeEventEnum.PIPELINE_CHANGE) {
      if (dce != null) {
        tst.getDownstreamOldAndNew()[0]=dce.getDownstreamOldAndNew()[0];
        if (log.isDebugEnabled())         log.debug("Elission removal of: " + dce);
        queue.remove(dce);
      }
      dce=tst;
    }
 else     if (tst.getEventType() == QuorumStateChangeEventEnum.PIPELINE_ADD) {
      add=tst;
    }
 else     if (tst.getEventType() == QuorumStateChangeEventEnum.PIPELINE_REMOVE) {
      if (add != null) {
        if (log.isDebugEnabled()) {
          log.debug("Elission removal of: " + add);
          log.debug("Elission removal of: " + tst);
        }
        queue.remove(add);
        queue.remove(tst);
        add=null;
      }
      if (dce != null) {
        if (log.isDebugEnabled())         log.debug("Elission removal of: " + dce);
        queue.remove(dce);
        dce=null;
      }
      if (uce != null) {
        if (log.isDebugEnabled())         log.debug("Elission removal of: " + uce);
        queue.remove(uce);
        uce=null;
      }
    }
  }
}

private void elideEvents ( ) { if ( ! s_eventElission ) { return ; } final Iterator < QuorumStateChangeEvent > events = queue . iterator ( ) ; QuorumStateChangeEvent uce = null ; QuorumStateChangeEvent dce = null ; QuorumStateChangeEvent add = null ; while ( events . hasNext ( ) ) { final QuorumStateChangeEvent tst = events . next ( ) ; if ( tst . getEventType ( ) == QuorumStateChangeEventEnum . PIPELINE_UPSTREAM_CHANGE ) { if ( uce != null ) { if ( log . isDebugEnabled ( ) ) log . debug ( "Elission removal of: " + uce ) ; queue . remove ( uce ) ; } uce = tst ; } else if ( tst . getEventType ( ) == QuorumStateChangeEventEnum . PIPELINE_CHANGE ) { if ( dce != null ) { tst . getDownstreamOldAndNew ( ) [ 0 ] = dce . getDownstreamOldAndNew ( ) [ 0 ] ; if ( log . isDebugEnabled ( ) ) log . debug ( "Elission removal of: " + dce ) ; queue . remove ( dce ) ; } dce = tst ; } else if ( tst . getEventType ( ) == QuorumStateChangeEventEnum . PIPELINE_ADD ) { add = tst ; } else if ( tst . getEventType ( ) == QuorumStateChangeEventEnum . PIPELINE_REMOVE ) { if ( add != null ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Elission removal of: " + add ) ; log . debug ( "Elission removal of: " + tst ) ; } queue . remove ( add ) ; queue . remove ( tst ) ; add = null ; } if ( dce != null ) { if ( log . isDebugEnabled ( ) ) log . debug ( "Elission removal of: " + dce ) ; queue . remove ( dce ) ; dce = null ; } if ( uce != null ) { if ( log . isDebugEnabled ( ) ) log . debug ( "Elission removal of: " + uce ) ; queue . remove ( uce ) ; uce = null ; } } } }
event elission endeavours to ensure that events processed represent current state change . this is best explained with an example from its original usage in processing graphic events . whilst a " button click " is a singular event and all button clicks should be processed , a " mouse move " event could be elided with the next " mouse move " event . thus the move events ( l1 - > l2 ) and ( l2 - > l3 ) would elide to a single ( l1 - > l3 ) . in ha rmi calls can trigger event processing , whilst other threads monitor state changes - such as open sockets . without elission , monitoring threads will observe unnecessary transitional state changes . however , there remains a problem with this pattern of synchronization .
