/** * Just remove the event from the unprocessed events map if it is present. * This method added to fix bug 37603 */ protected void basicHandlePrimaryDestroy(final GatewayEventImpl gatewayEvent) { if (getPrimary()) { // no need to do anything if we have become the primary return; } GatewayStats statistics = getGateway().getStatistics(); // Get the event from the map synchronized (unprocessedEventsLock) { if (this.unprocessedEvents == null) return; // now we can safely use the unprocessedEvents field Object v = this.unprocessedEvents.remove(gatewayEvent.getEventId()); if (v != null) { statistics.incUnprocessedEventsRemovedByPrimary(); } } }
if (getStatistics().isClosed()) { setStatistics(new GatewayStats(this._cache.getDistributedSystem(), getGatewayHubId(), getId(), gpi == null ? null emi.setGatewayStats(getStatistics());
/** * Dispatches a batch of messages to all registered <code>GatewayEventListener</code>s. * @param events The <code>List</code> of events to send * @param removeFromQueueOnException Unused. * * @return whether the batch of messages was successfully processed */ public boolean dispatchBatch(List events, boolean removeFromQueueOnException) { GatewayStats statistics = this.eventProcessor.getGateway().getStatistics(); boolean success = false; try { // Send the batch to the corresponding Gateway long start = statistics.startTime(); success = dispatchBatch(events); statistics.endBatch(start, events.size()); } catch (GatewayException e) { // Do nothing in this case. The exception has already been logged. } catch (CancelException e) { this.eventProcessor.setIsStopped(true); throw e; } catch (Exception e) { this.logger.severe(LocalizedStrings.GatewayEventCallbackDispatcher_STOPPING_THE_PROCESSOR_BECAUSE_THE_FOLLOWING_EXCEPTION_OCCURRED_WHILE_PROCESSING_A_BATCH, e); this.eventProcessor.setIsStopped(true); } return success; }
queue = new SingleWriteSingleReadRegionQueue(getGateway().getCache(), regionName, getGateway().getQueueAttributes(), listener, getGateway().getStatistics());
GatewayStats statistics = getGateway().getStatistics();
GatewayStats statistics = this.eventProcessor.getGateway().getStatistics(); boolean success = false; try {
GatewayStats statistics = getGateway().getStatistics(); if (getLogger().fineEnabled()) { getLogger().fine(getGateway() + ": Queueing event ("
final int batchTimeInterval = gqa.getBatchTimeInterval(); final int alertThreshold = gqa.getAlertThreshold(); final GatewayStats statistics = getGateway().getStatistics(); List events = null; for (;;) {
GatewayStats statistics = getGateway().getStatistics();
private void basicHandleSecondaryEvent(final GatewayEventImpl gatewayEvent) { GatewayStats statistics = getGateway().getStatistics();