@Override public String cancelInProgress() { String reason = getDistributedSystem().getCancelCriterion().cancelInProgress(); if (reason != null) { return reason; } if (GemFireCacheImpl.this.disconnectCause != null) { return GemFireCacheImpl.this.disconnectCause.getMessage(); } if (GemFireCacheImpl.this.isClosing) { return "The cache is closed."; // this + ": closed"; } return null; }
/** * Indicate whether the updater or the system is trying to terminate * * @return true if we are trying to stop */ private boolean quitting() { if (isInterrupted()) { // Any time an interrupt is thrown at this thread, regard it as a request to terminate return true; } if (!this.continueProcessing.get()) { // de facto flag indicating we are to stop return true; } if (this.cache != null && this.cache.getCancelCriterion().isCancelInProgress()) { // System is cancelling return true; } // The pool stuff is really sick, so it's possible for us to have a distributed // system that is not the same as our cache. Check it just in case... if (this.system.getCancelCriterion().isCancelInProgress()) { return true; } // All clear on this end, boss. return false; }
CancelCriterion stopper = this.system.getCancelCriterion(); stopper.checkCancelInProgress(null); throw ex; } catch (ClassNotFoundException ex) { CancelCriterion stopper = this.system.getCancelCriterion(); stopper.checkCancelInProgress(null); throw ex;
getDistributedSystem().getCancelCriterion().generateCancelledException(throwable); if (result != null) { return result;
@Override public void run() { CancelCriterion stopper = region.getGemFireCache().getDistributedSystem().getCancelCriterion(); DistributedSystem.setThreadsSocketPolicy(true /* conserve sockets */); SystemFailure.checkFailure(); if (stopper.cancelInProgress() != null) { return; } try { run2(); } 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) { // Whenever you catch Error or Throwable, you must also // catch VirtualMachineError (see above). However, there is // _still_ a possibility that you are dealing with a cascading // error condition, so you also need to check to see if the JVM // is still usable: SystemFailure.checkFailure(); if (logger.isDebugEnabled()) { logger.debug("Unexpected exception in colocation", t); } } }
@Override public void run() { CancelCriterion stopper = redundancyProvider.prRegion.getGemFireCache().getDistributedSystem().getCancelCriterion(); DistributedSystem.setThreadsSocketPolicy(true /* conserve sockets */); SystemFailure.checkFailure();
when(distributedSystem.getCancelCriterion()).thenReturn(cancelCriterion); when(cancelCriterion.isCancelInProgress()).thenReturn(Boolean.FALSE);
CancelCriterion stopper = this.system.getCancelCriterion(); stopper.checkCancelInProgress(null); throw ex;
if (ev == null) { getStopper().checkCancelInProgress(null); this.getCache().getDistributedSystem().getCancelCriterion().checkCancelInProgress(null);