/** * 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); } throw new CacheException("Cannot close a running durable client : " + durableClientId){}; } }
/** * 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){}; } }
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); } }
/** * Unregisters an existing client from this server. * * @param memberId * Uniquely identifies the client * * */ public void unregisterClient(ClientProxyMembershipID memberId, boolean normalShutdown) { if (_logger.fineEnabled()) { _logger .fine("CacheClientNotifier: Unregistering all clients with member id: " + memberId); } CacheClientProxy proxy = getClientProxy(memberId); if (proxy != null) { if (_logger.finerEnabled()) _logger.finer("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 (_logger.finerEnabled()) _logger.finer("CacheClientNotifier: Potential client: " + proxy + " matches " + memberId); closeDeadProxies(Collections.singletonList(proxy), normalShutdown); } } }
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); } }