public void readyForEventsAfterFailover(QueueConnectionImpl primary) { try { logger.info("Sending ready for events to primary: {}", primary); ReadyForEventsOp.execute(pool, primary); } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Error sending ready for events to {}", primary, e); } primary.destroy(); } }
@Override public void readyForEvents(InternalDistributedSystem system) { synchronized (lock) { this.sentClientReady = true; } QueueConnectionImpl primary = null; while (primary == null) { try { primary = (QueueConnectionImpl) getAllConnections().getPrimary(); } catch (NoSubscriptionServersAvailableException ignore) { primary = null; break; } if (primary.sendClientReady()) { try { logger.info("Sending ready for events to primary: {}", primary); ReadyForEventsOp.execute(pool, primary); } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Error sending ready for events to {}", primary, e); } primary.destroy(); primary = null; } } } }
private boolean recoverInterest(final QueueConnectionImpl newConnection, final boolean isFirstNewConnection) { if (pool.getPoolOrCacheCancelInProgress() != null) { return true; } // recover interest try { recoverAllInterestTypes(newConnection, isFirstNewConnection); newConnection.getFailureTracker().reset(); return true; } catch (CancelException ignore) { return true; // ok to ignore we are being shutdown } catch (VirtualMachineError err) { SystemFailure.initiateFailure(err); // If this ever returns, rethrow the error. We're poisoned // now, so don't let this thread continue. throw err; } catch (Throwable t) { SystemFailure.checkFailure(); pool.getCancelCriterion().checkCancelInProgress(t); logger.warn("QueueManagerImpl failed to recover interest to server " + newConnection.getServer(), t); newConnection.getFailureTracker().addFailure(); newConnection.destroy(); return false; } }