public String getState() { StringBuffer buffer = new StringBuffer(); buffer.append("CacheClientProxy[") .append(this.proxyID) .append("; port=").append(this._socket.getPort()).append("; primary=").append(isPrimary) .append("; version=").append(clientVersion).append("; paused=").append(isPaused()) .append("; alive=").append(isAlive()).append("; connected=").append(isConnected()) .append("; isMarkedForRemoval=").append(isMarkedForRemoval).append("]"); if (_messageDispatcher != null && isAlive()) { buffer.append(LogWriterImpl.getStackTrace(_messageDispatcher)); } return buffer.toString(); }
/** * 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); } // TODO: never throw an anonymous inner class throw new CacheException("Cannot close a running durable client : " + durableClientId) {}; } }
if (isPaused() && !isConnected()) { CqService cqService = getCache().getCqService(); if (cqService != null) {
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.denyListSlowReceiver(proxy); } } if (conflatable instanceof HAEventWrapper) { ((HAEventWrapper) conflatable).decrementPutInProgressCounter(); } // Remove any dead clients from the clients to notify if (deadProxies != null) { closeDeadProxies(deadProxies, false); } }
boolean toCreateNewProxy = true; if (staleClientProxy != null) { if (staleClientProxy.isConnected() && staleClientProxy.getSocket().isConnected()) { successful = false; toCreateNewProxy = false;
CacheClientProxy proxy = CacheClientNotifier.getInstance().getClientProxy(proxyId); if (proxy != null && !proxy.isConnected() && !proxyId.isDurable()) { return null; status.setUpTime(proxy.getUpTime()); status.setQueueSize(proxy.getQueueSizeStat()); status.setConnected(proxy.isConnected()); status.setSubscriptionEnabled(true); } else {
private ClientQueueDetail getClientQueueDetail(CacheClientProxy p) { ClientQueueDetail queueDetail = new ClientQueueDetail(); ClientProxyMembershipID proxyID = p.getProxyID(); if (!p.isConnected() && !proxyID.isDurable()) { return null; } queueDetail.setClientId(getClientIdFromCacheClientProxy(p)); HARegionQueue queue = p.getHARegionQueue(); if (queue == null) { return queueDetail; } queueDetail.setQueueSize(p.getQueueSizeStat()); queueDetail.setEventsConflated(queue.getStatistics().getEventsConflated()); queueDetail.setEventsEnqued(queue.getStatistics().getEventsEnqued()); queueDetail.setEventsExpired(queue.getStatistics().getEventsExpired()); queueDetail.setEventsRemoved(queue.getStatistics().getEventsRemoved()); queueDetail.setEventsRemovedByQrm(queue.getStatistics().getEventsRemovedByQrm()); queueDetail.setEventsTaken(queue.getStatistics().getEventsTaken()); queueDetail.setMarkerEventsConflated(queue.getStatistics().getMarkerEventsConflated()); queueDetail.setNumVoidRemovals(queue.getStatistics().getNumVoidRemovals()); return queueDetail; }