RemoteOperationMessage extends DistributionMessage implements MessageWithReply, TransactionMessage { @Override public void process(final ClusterDistributionManager dm) { Throwable thr = null; boolean sendReply = true; LocalRegion r = null; long startTime = 0; try { InternalCache cache = getCache(dm); if (checkCacheClosing(cache) || checkDSClosing(dm)) { String message = "Remote cache is closed: " + dm.getId(); if (cache == null) { thr = new CacheClosedException(message); } else { thr = cache.getCacheClosedException(message); } return; } r = getRegionByPath(cache); if (r == null && failIfRegionMissing()) { thr = new RegionDestroyedException( String.format("%s : could not find region %s", dm.getDistributionManagerId(), regionPath), regionPath); return; } TXManagerImpl txMgr = getTXManager(cache); TXStateProxy tx = txMgr.masqueradeAs(this); if (tx == null) { sendReply = operateOnRegion(dm, r, startTime); } else { try { if (txMgr.isClosed()) { sendReply = false; } else if (tx.isInProgress()) { sendReply = operateOnRegion(dm, r, startTime); tx.updateProxyServer(this.getSender()); } else { throw new TransactionException("transactional operation elided because transaction {" + tx.getTxId() + "} is closed"); } } finally { txMgr.unmasquerade(tx); } } } catch (RegionDestroyedException | RemoteOperationException | TransactionException ex) { thr = ex; } catch (DistributedSystemDisconnectedException se) { thr = null; sendReply = false; if (logger.isDebugEnabled()) { logger.debug("shutdown caught, abandoning message: {}", se.getMessage(), se); } } catch (VirtualMachineError err) { thr = new RemoteOperationException("VirtualMachineError", err); SystemFailure.initiateFailure(err); throw err; } catch (Throwable t) { if (sendReply) { thr = new RemoteOperationException("system failure", SystemFailure.getFailure()); } checkForSystemFailure(); if (sendReply) { if (!checkDSClosing(dm)) { thr = t; } else { thr = new RemoteOperationException("cache is closing", new CacheClosedException()); } } if (logger.isTraceEnabled(LogMarker.DM_VERBOSE) && (t instanceof RuntimeException)) { logger.trace(LogMarker.DM_VERBOSE, "Exception caught while processing message", t); } } finally { if (sendReply) { ReplyException rex = null; if (thr != null) { rex = new ReplyException(thr); } sendReply(getSender(), this.processorId, dm, rex, r, startTime); } } } RemoteOperationMessage();  RemoteOperationMessage(InternalDistributedMember recipient, String regionPath,
      ReplyProcessor21 processor); private  RemoteOperationMessage(String regionPath, ReplyProcessor21 processor); @Override boolean isSevereAlertCompatible(); @Override int getProcessorType(); String getRegionPath(); @Override int getProcessorId(); boolean checkCacheClosing(InternalCache cache); boolean checkDSClosing(ClusterDistributionManager dm); @Override void process(final ClusterDistributionManager dm); @Override void fromData(DataInput in,
      DeserializationContext context); @Override InternalDistributedMember getTXOriginatorClient(); @Override void toData(DataOutput out,
      SerializationContext context); @Override String toString(); InternalDistributedMember getRecipient(); void setOperation(Operation op); void setHasOldValue(boolean value); @Override int getTXUniqId(); @Override InternalDistributedMember getMemberToMasqueradeAs(); @Override boolean canStartRemoteTransaction(); @Override boolean canParticipateInTransaction(); @Override boolean isTransactionDistributed();  }
@Test public void processWithOperateOnRegionReturningFalseDoesNotSendReply() throws Exception { msg.setOperationOnRegionResult(false); msg.setSender(sender); msg.process(dm); verify(dm, never()).putOutgoing(any()); }