QueueConnectionImpl primary = (QueueConnectionImpl) queueConnections.getPrimary(); if (logger.isDebugEnabled()) { logger.debug("QueueManagerImpl - closing connections with keepAlive={}", keepAlive);
@Override public void emergencyClose() { shuttingDown = true; queueConnections.getPrimary().emergencyClose(); List backups = queueConnections.getBackups(); for (int i = 0; i < backups.size(); i++) { Connection backup = (Connection) backups.get(i); backup.emergencyClose(); } }
boolean isFirstNewConnection = false; synchronized (lock) { if (recoverInterest && queueConnections.getPrimary() == null && queueConnections.getBackups().isEmpty()) {
if (queueConnections.getPrimary() != null) { if (isDebugEnabled) { logger.debug("Primary recovery not needed");
if (snapshot.getPrimary() == null) { while (snapshot.getPrimary() == null && !snapshot.primaryDiscoveryFailed() && !shuttingDown && pool.getPoolOrCacheCancelInProgress() == null) { try { if (snapshot.getPrimary() == null) { pool.getCancelCriterion().checkCancelInProgress(null); GemFireException exception = snapshot.getPrimaryDiscoveryException();
protected void scheduleRedundancySatisfierIfNeeded(long delay) { if (shuttingDown) { return; } synchronized (lock) { if (shuttingDown) { return; } if (queueConnections.getPrimary() == null || getCurrentRedundancy() < redundancyLevel || redundancyLevel == -1 || queueConnections.primaryDiscoveryFailed()) { if (redundancySatisfierTask != null) { if (redundancySatisfierTask.getRemainingDelay() > delay) { redundancySatisfierTask.cancel(); } else { return; } } redundancySatisfierTask = new RedundancySatisfierTask(); try { ScheduledFuture future = recoveryThread.schedule(redundancySatisfierTask, delay, TimeUnit.MILLISECONDS); redundancySatisfierTask.setFuture(future); } catch (RejectedExecutionException e) { // ignore, the timer has been cancelled, which means we're shutting down. } } } }
public boolean isPrimaryUpdaterAlive() { boolean result = false; QueueConnectionImpl primary = (QueueConnectionImpl) queueConnections.getPrimary(); if (primary != null) { ClientUpdater cu = primary.getUpdater(); if (cu != null) { result = cu.isAlive(); } } return result; }