/** * During sender is getting stopped, if there are any cache operation on queue then that event will be stored in temp queue. * Once sender is started, these event from tmp queue will be cleared. */ public void clearTempEventsAfterSenderStopped() { TmpQueueEvent nextEvent = null; while ((nextEvent = tmpQueuedEvents.poll()) != null) { nextEvent.release(); } synchronized (this.queuedEventsSync) { while ((nextEvent = tmpQueuedEvents.poll()) != null) { nextEvent.release(); } this.enqueuedAllTempQueueEvents = false; } statistics.setQueueSize(0); statistics.setTempQueueSize(0); }