/** * Sends an InvalidateMessage * {@link com.gemstone.gemfire.cache.Region#invalidate(Object)}message to the * recipient * * @param recipient the recipient of the message * @param r * the PartitionedRegion for which the invalidate was performed * @param event the event causing this message * @return the InvalidateResponse processor used to await the potential * {@link com.gemstone.gemfire.cache.CacheException} * @throws ForceReattemptException if the peer is no longer available */ public static InvalidateResponse send(DistributedMember recipient, PartitionedRegion r, EntryEventImpl event) throws ForceReattemptException { //Assert.assertTrue(recipient != null, "InvalidateMessage NULL recipient"); recipient may be null for remote notifications Set recipients = Collections.singleton(recipient); InvalidateResponse p = new InvalidateResponse(r.getSystem(), recipients, event.getKey()); InvalidateMessage m = new InvalidateMessage(recipients, false, r.getPRId(), p, event); Set failures =r.getDistributionManager().putOutgoing(m); if (failures != null && failures.size() > 0 ) { throw new ForceReattemptException(LocalizedStrings.InvalidateMessage_FAILED_SENDING_0.toLocalizedString(m)); } return p; }
final InvalidateResponse p = new InvalidateResponse(r.getSystem(), recipients, event.getKey(), tx); final InvalidateMessage m = new InvalidateMessage(recipients, false,
/** * Prepares an InvalidateMessage * {@link com.gemstone.gemfire.cache.Region#invalidate(Object)} for send to * the recipient. * * @param sys * the distributed system * @param recipient * the recipient of the message * @param r * the PartitionedRegion for which the invalidate was performed * @param event * the event causing this message * * @return the prepared InvalidateMessage */ public static InvalidateMessage prepareSend( final InternalDistributedSystem sys, final InternalDistributedMember recipient, final PartitionedRegion r, final EntryEventImpl event) { // recipient may be null for remote notifications //Assert.assertTrue(recipient != null, "InvalidateMessage NULL recipient"); final TXStateInterface tx = event.getTXState(r); final InvalidateResponse p = new InvalidateResponse(sys, recipient, event.getKey(), tx); final InvalidateMessage m = new InvalidateMessage(recipient, false, r.getPRId(), p, event, tx); return m; }
PartitionResponse createReplyProcessor(PartitionedRegion r, Set recipients, Object key) { return new InvalidateResponse(r.getSystem(), recipients, key); }