protected boolean processBufferedMessages(Event event) throws AvpDataException {
    if (listeners.size() == 0) {
      //PCB added logging
      logger.debug("listeners.size() == 0 on connection [{}]", this.getKey());
      try {
        buffer.add(event);
      }
      catch (IllegalStateException e) {
        logger.debug("Got IllegalStateException in processBufferedMessages");
        // FIXME : requires JDK6 : buffer.removeLast();
        Event[] tempBuffer = buffer.toArray(new Event[buffer.size()]);
        buffer.remove(tempBuffer[tempBuffer.length - 1]);
        buffer.add(event);
      }
      //PCB added logging
      logger.debug("processBufferedMessages is returning false");
      return false;
    }
    else {
      logger.debug("processBufferedMessages is returning true on connection [{}] as there are listeners", getKey());
      return true;
    }
  }
protected boolean processBufferedMessages ( Event event ) throws AvpDataException { if ( listeners . size ( ) == 0 ) { logger . debug ( "listeners.size() == 0 on connection [{}]" , this . getKey ( ) ) ; try { buffer . add ( event ) ; } catch ( IllegalStateException e ) { logger . debug ( "Got IllegalStateException in processBufferedMessages" ) ; Event [ ] tempBuffer = buffer . toArray ( new Event [ buffer . size ( ) ] ) ; buffer . remove ( tempBuffer [ tempBuffer . length - 1 ] ) ; buffer . add ( event ) ; } logger . debug ( "processBufferedMessages is returning false" ) ; return false ; } else { logger . debug ( "processBufferedMessages is returning true on connection [{}] as there are listeners" , getKey ( ) ) ; return true ; } }
private static final Map<String, Long> timerMap = new ConcurrentHashMap<String, Long>();