@Override protected void appendFields(StringBuilder buff) { super.appendFields(buff); buff.append("; membershipID="); buff.append(this.context == null ? "" : this.context.toString()); }
@Override protected boolean operateOnRegion(CacheEvent event, ClusterDistributionManager dm) throws EntryNotFoundException { EntryEventImpl ev = (EntryEventImpl) event; DistributedRegion rgn = (DistributedRegion) ev.getRegion(); try { if (!rgn.isCacheContentProxy()) { if (logger.isTraceEnabled()) { logger.trace("InvalidateMessage.operationOnRegion; key={}", ev.getKey()); } // if this is a mirrored region and we're still initializing, or // concurrency conflict detection is enabled (requiring version # // retention) then force new entry creation boolean forceNewEntry = rgn.getDataPolicy().withReplication() && (!rgn.isInitialized() || rgn.getConcurrencyChecksEnabled()); boolean invokeCallbacks = rgn.isInitialized(); rgn.basicInvalidate(ev, invokeCallbacks, forceNewEntry); } this.appliedOperation = true; return true; } catch (ConcurrentCacheModificationException e) { dispatchElidedEvent(rgn, ev); return true; // concurrent modification problems are not reported to senders } }
@Override @Retained protected InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { @Retained EntryEventImpl ev = EntryEventImpl.create(rgn, getOperation(), this.key, null, this.callbackArg, true, getSender()); ev.setEventId(this.eventId); setOldValueInEvent(ev); ev.setVersionTag(this.versionTag); if (this.filterRouting != null) { ev.setLocalFilterInfo(this.filterRouting.getFilterInfo(rgn.getMyId())); } ev.setInhibitAllNotifications(this.inhibitAllNotifications); return ev; }
@Override public ConflationKey getConflationKey() { if (!super.regionAllowsConflation || getProcessorId() != 0) { // if the publisher's region attributes do not support conflation // or if it is an ack region // then don't even bother with a conflation key return null; } else { // don't conflate invalidates return new ConflationKey(this.key, super.regionPath, false); } } }
@Override @Retained protected InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { EntryEventImpl event = (EntryEventImpl) super.createEvent(rgn); event.setContext(this.context); return event; }
@Override public void toData(DataOutput out) throws IOException { super.toData(out); DataSerializer.writeObject(this.context, out); }
@Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { super.fromData(in); this.context = ClientProxyMembershipID.readCanonicalized(in); }
@Override protected CacheOperationMessage createMessage() { if (this.event.hasClientOrigin()) { InvalidateWithContextMessage msgwithContxt = new InvalidateWithContextMessage(); msgwithContxt.context = ((EntryEventImpl) this.event).getContext(); return msgwithContxt; } else { return new InvalidateMessage(); } }