@Override protected void appendFields(StringBuilder buff) { super.appendFields(buff); buff.append("; membershipID="); buff.append(this.context == null ? "" : this.context.toString()); }
@Override public List getOperations() { byte deserializationPolicy = DistributedCacheOperation.DESERIALIZATION_POLICY_NONE; QueuedOperation qOp = new QueuedOperation(getOperation(), this.key, null, null, deserializationPolicy, this.callbackArg); return Collections.singletonList(qOp); }
registerDSFID(PR_PUT_MESSAGE, () -> new PutMessage()); registerDSFID(INVALIDATE_MESSAGE, () -> new InvalidateOperation.InvalidateMessage()); registerDSFID(DESTROY_MESSAGE, () -> new DestroyOperation.DestroyMessage()); registerDSFID(DA_PROFILE, () -> new DistributionAdvisor.Profile());
@Override protected boolean operateOnRegion(CacheEvent event, DistributionManager dm) throws EntryNotFoundException { EntryEventImpl ev = (EntryEventImpl)event; DistributedRegion rgn = (DistributedRegion)ev.region; try { if (!rgn.isCacheContentProxy()) { LogWriterI18n log = ev.region.getCache().getLoggerI18n(); if (log.finerEnabled()) { log.finer("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.dataPolicy.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 protected boolean operateOnRegion(CacheEvent event, DistributionManager dm) throws EntryNotFoundException { EntryEventImpl ev = (EntryEventImpl)event; DistributedRegion rgn = (DistributedRegion)ev.region; 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.dataPolicy.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 protected InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { if (rgn.keyRequiresRegionContext()) { ((KeyWithRegionContext)this.key).setRegionContext(rgn); } 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 protected InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { if (rgn.keyRequiresRegionContext()) { ((KeyWithRegionContext)this.key).setRegionContext(rgn); } 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 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 public List getOperations() { byte deserializationPolicy = DistributedCacheOperation.DESERIALIZATION_POLICY_NONE; QueuedOperation qOp = new QueuedOperation(getOperation(), this.key, null, null, deserializationPolicy, this.callbackArg); return Collections.singletonList(qOp); }
@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 InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { EntryEventImpl event = (EntryEventImpl)super.createEvent(rgn); event.setContext(this.context); return event; }
@Override protected CacheOperationMessage createMessage() { if (this.event.hasClientOrigin()) { InvalidateWithContextMessage msgwithContxt = new InvalidateWithContextMessage(); msgwithContxt.context = ((EntryEventImpl)this.event).getContext(); return msgwithContxt; } else { return new InvalidateMessage(); } }
@Override protected CacheOperationMessage createMessage() { if (this.event.hasClientOrigin()) { InvalidateWithContextMessage msgwithContxt = new InvalidateWithContextMessage(); msgwithContxt.context = ((EntryEventImpl)this.event).getContext(); return msgwithContxt; } else { return new InvalidateMessage(); } }
@Override protected void appendFields(StringBuilder buff) { super.appendFields(buff); buff.append("; membershipID="); buff.append(this.context == null ? "" : this.context.toString()); }
@Override 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); }