this._messageDispatcher.stopDispatching(checkQueue); this.cils[RegisterInterestTracker.interestListIndex].clearClientInterestList(); this.cils[RegisterInterestTracker.durableInterestListIndex].clearClientInterestList(); try { this._messageDispatcher.stopDispatching(checkQueue); if (this._messageDispatcher.isAlive()) { closeSocket(); destroyRQ(); alreadyDestroyed = true; this._messageDispatcher.interrupt(); if (this._messageDispatcher.isAlive()) { try { this._messageDispatcher.join(1000); } catch (InterruptedException ex) { gotInterrupt = true; if (this._messageDispatcher.isAlive()) {
this._messageDispatcher = new MessageDispatcher(this, name); this._messageDispatcher.enqueueMessage(nextEvent); this._messageDispatcher.enqueueMessage(nextEvent);
if (isStopped()) { return; basicStopDispatching(); return; basicStopDispatching();
while (!isStopped()) { if (getProxy().isPaused()) { try { waitForResumption(); getStatistics().setQueueSize(this._messageQueue.size()); if (isStopped()) { break; long start = getStatistics().startTime(); boolean isDispatched = dispatchMessage(clientMessage); getStatistics().endMessage(start); if(isDispatched){ this._messageQueue.remove(); if (clientMessage instanceof ClientMarkerMessageImpl) { getProxy().markerEnqueued = false; if (!isStopped() && !getProxy().isPaused()) { if ("Broken pipe".equals(e.getMessage())) { logger.warn(LocalizedMessage.create(LocalizedStrings.CacheClientProxy_0_PROXY_CLOSING_DUE_TO_UNEXPECTED_BROKEN_PIPE_ON_SOCKET_CONNECTION, this)); pauseOrUnregisterProxy(); if (getProxy().isPaused()) { if (logger.isDebugEnabled()) { logger.debug("{}: interrupted because it is being paused. It will continue and wait for resumption.", this);
if (getLoggerI18n().fineEnabled()) { getLoggerI18n().fine(this + ": Beginning to process events"); if (getLoggerI18n().fineEnabled()) getLoggerI18n().fine("Slow start for testing interrupted" while (!isStopped()) { if (getProxy().isPaused()) { try { if (getLoggerI18n().warningEnabled()) { getLoggerI18n().warning(LocalizedStrings.CacheClientProxy_0_SLEEP_INTERRUPTED, this); waitForResumption(); getStatistics().setQueueSize(this._messageQueue.size()); if (isStopped()) { break; long start = getStatistics().startTime(); boolean isDispatched = dispatchMessage(clientMessage); getStatistics().endMessage(start); if(isDispatched){ this._messageQueue.remove(); if (clientMessage instanceof ClientMarkerMessageImpl) { getProxy().markerEnqueued = false;
this._messageDispatcher.stopDispatching(checkQueue); this.cils[RegisterInterestTracker.interestListIndex].clearClientInterestList(); this.cils[RegisterInterestTracker.durableInterestListIndex].clearClientInterestList(); try { this._messageDispatcher.stopDispatching(checkQueue); if (this._messageDispatcher.isAlive()) { if (this._socket != null && !this._socket.isClosed()) { SocketCreator.asyncClose(this._socket, this.getLoggerI18n(), this._remoteHostAddress, null); this._messageDispatcher.interrupt(); if (this._messageDispatcher.isAlive()) { try { this._messageDispatcher.join(1000); } catch (InterruptedException ex) { gotInterrupt = true; if (this._messageDispatcher.isAlive()) {
if (getLoggerI18n().fineEnabled() || BridgeServerImpl.VERBOSE) { getLoggerI18n().info(LocalizedStrings.DEBUG, "Dispatching " + clientMessage); if (getLoggerI18n().finerEnabled()) { StringBuilder msg = new StringBuilder(100); msg.append(this).append(": Using latest value: ").append(Arrays.toString(latestValue)); if (((ClientUpdateMessage)clientMessage).valueIsObject()) { if (latestValue != null) { msg.append(" (").append(deserialize(latestValue)).append(")"); getLoggerI18n().finer(msg.toString()); message = ((ClientUpdateMessageImpl)clientMessage).getMessage(getProxy(), latestValue); message = clientMessage.getMessage(getProxy(), true /* notify */); sendMessage(message); if (getLoggerI18n().finerEnabled()) { getLoggerI18n().finer(this + ": Dispatched " + clientMessage); if (getLoggerI18n().fineEnabled()) { getLoggerI18n().fine("Message Dispatcher of a Paused CCProxy " + "is trying to dispatch message");
if (((ClientUpdateMessage)clientMessage).valueIsObject()) { if (latestValue != null) { msg.append(" (").append(deserialize(latestValue)).append(")"); message = ((ClientUpdateMessageImpl)clientMessage).getMessage(getProxy(), latestValue); message = clientMessage.getMessage(getProxy(), true /* notify */); sendMessage(message);
super(LogWriterImpl.createThreadGroup(name, proxy.getLoggerI18n()), name); setDaemon(true); harq.setExpiryTime(proxy._messageTimeToLive); ((HAContainerWrapper)proxy._cacheClientNotifier.getHaContainer()) .putProxy(HARegionQueue.createRegionName(getProxy() .getHARegionName()), getProxy()); boolean createDurableQueue = proxy.proxyID.isDurable(); boolean canHandleDelta = (proxy.clientVersion.compareTo(Version.GFE_61) >= 0) .getDeltaPropagation() && !(this._proxy.clientConflation == HandShake.CONFLATION_ON); if (getLoggerI18n().fineEnabled() && (createDurableQueue || canHandleDelta)) { getLoggerI18n().fine("Creating a durable HA queue"); getProxy().getHARegionName(), getCache(), harq, HARegionQueue.BLOCKING_HA_QUEUE, createDurableQueue, proxy._cacheClientNotifier.getHaContainer(), getCache().getCancelCriterion().checkCancelInProgress(e); throw new CacheException(LocalizedStrings.CacheClientProxy_EXCEPTION_OCCURRED_WHILE_TRYING_TO_CREATE_A_MESSAGE_QUEUE.toLocalizedString(), e) { private static final long serialVersionUID = 0L;};
this._messageDispatcher.drainClientCqEvents(this.proxyID, cqToClose);
if (isStopped()) { return; if (getLoggerI18n().fineEnabled()) { getLoggerI18n().fine(this + ": Stopping dispatching"); basicStopDispatching(); return; if (getLoggerI18n().fineEnabled()) { getLoggerI18n().fine(this + ": Exception occurred while trying to stop dispatching", e); basicStopDispatching();
CacheClientProxy proxy = (CacheClientProxy)iter_prox.next(); assertFalse("Dispatcher on secondary should not be alive", proxy._messageDispatcher.isAlive());
super(LoggingThreadGroup.createThreadGroup(name, logger), name); setDaemon(true); harq.setExpiryTime(proxy._messageTimeToLive); ((HAContainerWrapper)proxy._cacheClientNotifier.getHaContainer()) .putProxy(HARegionQueue.createRegionName(getProxy() .getHARegionName()), getProxy()); boolean createDurableQueue = proxy.proxyID.isDurable(); boolean canHandleDelta = (proxy.clientVersion.compareTo(Version.GFE_61) >= 0) getProxy().getHARegionName(), getCache(), harq, HARegionQueue.BLOCKING_HA_QUEUE, createDurableQueue, proxy._cacheClientNotifier.getHaContainer(), getCache().getCancelCriterion().checkCancelInProgress(e); throw new CacheException(LocalizedStrings.CacheClientProxy_EXCEPTION_OCCURRED_WHILE_TRYING_TO_CREATE_A_MESSAGE_QUEUE.toLocalizedString(), e) { private static final long serialVersionUID = 0L;};
this._messageDispatcher.drainClientCqEvents(this.proxyID, cqToClose);
this._messageDispatcher.enqueueMessage(conflatable); } else { this._statistics.incMessagesFailedQueued();
CacheClientProxy proxy = (CacheClientProxy)iter_prox.next(); assertFalse("Dispatcher on secondary should not be alive", proxy._messageDispatcher.isAlive());
this._messageDispatcher = new MessageDispatcher(this, name); this._messageDispatcher.enqueueMessage(nextEvent); this._messageDispatcher.enqueueMessage(nextEvent);
&& keyOfInterest instanceof List) { for (Iterator i = ((List) keyOfInterest).iterator(); i.hasNext();) { this._messageDispatcher.enqueueMessage(new ClientInterestMessageImpl( new EventID(this._cache.getDistributedSystem()), regionName, i.next(), interestType, (byte) 0, isDurable, !receiveValues, this._messageDispatcher.enqueueMessage(message);
&& keyOfInterest instanceof List) { for (Iterator i = ((List) keyOfInterest).iterator(); i.hasNext();) { this._messageDispatcher.enqueueMessage(new ClientInterestMessageImpl( new EventID(this._cache.getDistributedSystem()), this._logger, regionName, i.next(), interestType, (byte) 0, isDurable, this._messageDispatcher.enqueueMessage(message);
CacheClientProxy proxy = (CacheClientProxy)iter_prox.next(); assertFalse("Dispatcher on secondary should not be alive", proxy._messageDispatcher.isAlive());