/** * Iterates over diffs list, calling "apply" on each individual diff. */ public void apply(GraphChangeHandler tracker) { if (diffs == null) { return; } // implements a naive linear commit - simply replay stored operations for (GraphDiff change : diffs) { change.apply(tracker); } }
public void run() { diff.apply(CayenneContextMergeHandler.this); } });
public void run() { diff.apply(CayenneContextMergeHandler.this); } });
/** * Iterates over diffs list, calling "apply" on each individual diff. */ public void apply(GraphChangeHandler tracker) { if (diffs == null) { return; } // implements a naive linear commit - simply replay stored operations Iterator it = diffs.iterator(); while (it.hasNext()) { GraphDiff change = (GraphDiff) it.next(); change.apply(tracker); } }
@Override public void apply(final GraphChangeHandler handler) { if (otherDiffs != null) { for (final GraphDiff diff : otherDiffs) { diff.apply(handler); } } // phantomFks are not in 'otherDiffs', while flattened diffs are if (phantomFks != null) { for (GraphDiff diff : phantomFks.keySet()) { diff.apply(handler); } } applySimplePropertyChanges(handler); }
GraphDiff filter(GraphDiff in) { diffs = new ArrayList<>(); in.apply(this); return new CompoundDiff(diffs); }
public void apply(final GraphChangeHandler handler) { if (otherDiffs != null) { Iterator it = otherDiffs.iterator(); while (it.hasNext()) { ((GraphDiff) it.next()).apply(handler); } } applySimplePropertyChanges(handler); }
public void run() { e.getDiff().apply(CayenneContextMergeHandler.this); } });
@Override public void apply(GraphChangeHandler handler) { resolveDiff(); resolvedDiff.apply(handler); }
DataChannelSyncCallbackAction(LifecycleCallbackRegistry callbackRegistry, GraphManager graphManager, GraphDiff changes) { this.callbackRegistry = callbackRegistry; this.graphManager = graphManager; if (hasListeners()) { this.seenIds = new HashMap<>(); changes.apply(this); } }
public void apply(GraphChangeHandler handler) { resolveDiff(); resolvedDiff.apply(handler); }
public void run() { e.getDiff().apply(CayenneContextMergeHandler.this); } });
public void run() { if (e.getDiff() != null) { e.getDiff().apply(CayenneContextMergeHandler.this); } } });
public GraphDiff compress(GraphDiff diff) { if (diff.isNoop()) { return diff; } CompressAction action = new CompressAction(); diff.apply(action); return action.getCompressedDiff(); }
private void beforeCommit(MutableChangeMap changes, DataChannel channel, GraphDiff contextDiff) { // capture snapshots of deleted objects before they are purged from cache GraphChangeHandler handler = new DiffFilter(entityFactory, new DeletedDiffProcessor(changes, channel, entityFactory)); contextDiff.apply(handler); }
GraphDiff onContextFlush( ObjectContext originatingContext, GraphDiff changes, boolean cascade) { if (this != originatingContext && changes != null) { changes.apply(new ChildDiffLoader(this)); fireDataChannelChanged(originatingContext, changes); } return (cascade) ? flushToParent(true) : new CompoundDiff(); }
public void graphFlushed(GraphEvent event) { // peer is committed if (shouldProcessEvent(event)) { event.getDiff().apply(this); // repost as change event for our own children context.fireDataChannelChanged(event.getPostedBy(), event.getDiff()); } }
public void run() { if (e.getDiff() != null) { e.getDiff().apply(CayenneContextMergeHandler.this); } if (!hadChanges) { context.internalGraphManager().stateLog.graphCommitted(); context.internalGraphManager().reset(); } } });
public void graphFlushed(GraphEvent event) { // peer is committed if (shouldProcessEvent(event)) { // per CAY-1737 event dispatches from parent context to children are // non-blocking, this causes issues like CAY-1749. so we must // synchronize ObjectStore updates here. // TODO: we can get here if a peer context is committed (ok) or // if our context was committed (not ok, since parent changes are // already applied in the commit thread) .. figure out an alt // filtering mechanism to avoid the duplicate object processing synchronized (context.getObjectStore()) { event.getDiff().apply(this); } // repost as change event for our own children context.fireDataChannelChanged(event.getPostedBy(), event.getDiff()); } }