/** * Unregisters an existing client from this server. * * @param memberId Uniquely identifies the client */ public void unregisterClient(ClientProxyMembershipID memberId, boolean normalShutdown) { if (logger.isDebugEnabled()) { logger.debug("CacheClientNotifier: Unregistering all clients with member id: {}", memberId); } CacheClientProxy proxy = getClientProxy(memberId); if (proxy != null) { final boolean isTraceEnabled = logger.isTraceEnabled(); if (isTraceEnabled) { logger.trace("CacheClientNotifier: Potential client: {}", proxy); } // If the proxy's member id is the same as the input member id, add // it to the set of dead proxies. if (!proxy.startRemoval()) { if (isTraceEnabled) { logger.trace("CacheClientNotifier: Potential client: {} matches {}", proxy, memberId); } closeDeadProxies(Collections.singletonList(proxy), normalShutdown); } } }
/** * 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) {}; } }
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); } }