protected void waitForResumption() throws InterruptedException { synchronized (this._pausedLock) { logger.info(LocalizedMessage.create(LocalizedStrings.CacheClientProxy_0__PAUSING_PROCESSING, this)); if (!getProxy().isPaused()) { return; } while (getProxy().isPaused()) { this._pausedLock.wait(); } // Fix for #48571 _messageQueue.clearPeekedIDs(); } }
protected void waitForResumption() throws InterruptedException { synchronized (this._pausedLock) { if (getLoggerI18n().infoEnabled()) { getLoggerI18n().info(LocalizedStrings.CacheClientProxy_0__PAUSING_PROCESSING, this); } if (!getProxy().isPaused()) { return; } while (getProxy().isPaused()) { this._pausedLock.wait(); } } }
public void run2() throws CacheException { // Find the proxy final CacheClientProxy proxy = getClientProxy(); assertNotNull(proxy); WaitCriterion ev = new WaitCriterion() { public boolean done() { return proxy.isPaused(); } public String description() { return null; } }; DistributedTestCase.waitForCriterion(ev, 1000, 200, true); assertTrue(proxy.isPaused()); } });
/** * Shuts down durable client proxy * */ public boolean closeDurableClientProxy(String durableClientId) throws CacheException { CacheClientProxy ccp = getClientProxy(durableClientId); if (ccp == null) { return false; } //we can probably remove the isPaused check if (ccp.isPaused() && !ccp.isConnected()) { ccp.setKeepAlive(false); closeDeadProxies(Collections.singletonList(ccp), true); return true; } else { if (logger.isDebugEnabled()) { logger.debug("Cannot close running durable client: {}", durableClientId); } throw new CacheException("Cannot close a running durable client : " + durableClientId){}; } }
if (!this._proxy.isPaused()) { sendMessage(message);
/** * Shuts down durable client proxy * */ public boolean closeDurableClientProxy(String durableClientId) throws CacheException { CacheClientProxy ccp = getClientProxy(durableClientId); if (ccp == null) { return false; } //we can probably remove the isPaused check if (ccp.isPaused() && !ccp.isConnected()) { ccp.setKeepAlive(false); closeDeadProxies(Collections.singletonList(ccp), true); return true; } else { if (_logger.fineEnabled()) { _logger.fine("Cannot close running durable client : " + durableClientId); } throw new CacheException("Cannot close a running durable client : " + durableClientId){}; } }
if (this.isPaused()) {
private void sendMessageDirectly(ClientMessage clientMessage) { Message message; try { if (logger.isDebugEnabled()) { logger.debug("{}: Dispatching directly: {}", this, clientMessage); } message = clientMessage.getMessage(getProxy(), true); sendMessage(message); if (logger.isDebugEnabled()) { logger.debug("{}: Dispatched directly: {}", this, clientMessage); } // The exception handling code was modeled after the MessageDispatcher // run method } catch (IOException e) { synchronized (this._stopDispatchingLock) { // Pause or unregister proxy if (!isStopped() && !getProxy().isPaused()) { logger.fatal(LocalizedMessage.create(LocalizedStrings.CacheClientProxy_0__AN_UNEXPECTED_EXCEPTION_OCCURRED, this), e); pauseOrUnregisterProxy(); } } } catch (Exception e) { if (!isStopped()) { logger.fatal(LocalizedMessage.create(LocalizedStrings.CacheClientProxy_0__AN_UNEXPECTED_EXCEPTION_OCCURRED, this), e); } } }
if(this._proxy.isPaused() && this._proxy.isDurable()){ this._proxy._cacheClientNotifier._statistics.incEventEnqueuedWhileClientAwayCount(); if (logger.isDebugEnabled()) {
private void singletonRouteClientMessage(Conflatable conflatable, Collection<ClientProxyMembershipID> filterClients) { this._cache.getCancelCriterion().checkCancelInProgress(null); // bug #43942 - client notified but no p2p distribution List<CacheClientProxy> deadProxies = null; for(ClientProxyMembershipID clientId: filterClients ) { CacheClientProxy proxy; proxy = this.getClientProxy(clientId, true); if (proxy != null) { if (proxy.isAlive() || proxy.isPaused() || proxy.isConnected() || proxy.isDurable()) { proxy.deliverMessage(conflatable); } else { if (deadProxies == null) { deadProxies = new ArrayList<CacheClientProxy>(); } deadProxies.add(proxy); } this.blackListSlowReciever(proxy); } } checkAndRemoveFromClientMsgsRegion(conflatable); // Remove any dead clients from the clients to notify if (deadProxies != null) { closeDeadProxies(deadProxies, false); } }
if (l_proxy.isPaused()) { if (CacheClientProxy.testHook != null) { CacheClientProxy.testHook.doTestHook("CLIENT_PRE_RECONNECT");
private void singletonRouteClientMessage(Conflatable conflatable, Collection<ClientProxyMembershipID> filterClients) { this._cache.getCancelCriterion().checkCancelInProgress(null); // bug #43942 - client notified but no p2p distribution List<CacheClientProxy> deadProxies = null; for(ClientProxyMembershipID clientId: filterClients ) { CacheClientProxy proxy; proxy = this.getClientProxy(clientId, true); if (proxy != null) { if (proxy.isAlive() || proxy.isPaused() || proxy.isConnected() || proxy.isDurable()) { proxy.deliverMessage(conflatable); } else { proxy.getStatistics().incMessagesFailedQueued(); if (deadProxies == null) { deadProxies = new ArrayList<CacheClientProxy>(); } deadProxies.add(proxy); } this.blackListSlowReciever(proxy); } } checkAndRemoveFromClientMsgsRegion(conflatable); // Remove any dead clients from the clients to notify if (deadProxies != null) { closeDeadProxies(deadProxies, false); } }
if (!this._proxy.isPaused()) { sendMessage(message);
if (isPaused() && !isConnected()) { CqService cqService = getCache().getCqService(); if (cqService != null) {
if(this._proxy.isPaused() && this._proxy.isDurable()){ this._proxy._cacheClientNotifier._statistics.incEventEnqueuedWhileClientAwayCount(); if (getLoggerI18n().fineEnabled()) {
if (proxy != null && !proxy.isPaused()) {
if (this.isPaused()) {
synchronized (this._stopDispatchingLock) { if (!isStopped() && !getProxy().isPaused()) { if (getLoggerI18n().severeEnabled()) { getLoggerI18n().severe(LocalizedStrings.CacheClientProxy_0__AN_UNEXPECTED_EXCEPTION_OCCURRED, this, e);
if (proxy != null && !proxy.isPaused()) {
if (isPaused() && !isConnected()) { CqService cqService = CqService.getRunningCqService(); if (cqService != null) {