public void run() { e.getDiff().apply(CayenneContextMergeHandler.this); } });
public void run() { e.getDiff().apply(CayenneContextMergeHandler.this); } });
public void graphChanged(final GraphEvent e) { // process flush if (shouldProcessEvent(e) && e.getDiff() != null) { runWithEventsDisabled(new Runnable() { public void run() { e.getDiff().apply(CayenneContextMergeHandler.this); } }); // post event outside of "execute" to make sure it is sent repostAfterMerge(e); } }
public void graphChanged(final GraphEvent e) { // process flush if (shouldProcessEvent(e) && e.getDiff() != null) { runWithEventsDisabled(new Runnable() { public void run() { e.getDiff().apply(CayenneContextMergeHandler.this); } }); // post event outside of "execute" to make sure it is sent repostAfterMerge(e); } }
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()); } }
void repostAfterMerge(GraphEvent originalEvent) { // though the subject is CHANGE, "merge" events are really lifecycle. if (context.isLifecycleEventsEnabled()) { context.fireDataChannelChanged(originalEvent.getSource(), originalEvent.getDiff()); } }
void repostAfterMerge(GraphEvent originalEvent) { // though the subject is CHANGE, "merge" events are really lifecycle. if (context.isLifecycleEventsEnabled()) { context.internalGraphManager().send( originalEvent.getDiff(), DataChannel.GRAPH_CHANGED_SUBJECT, originalEvent.getSource()); } }
public void graphChanged(GraphEvent event) { // parent received external change if (shouldProcessEvent(event)) { // temp kludge - see TODO in ObjectStore.snapshotsChanged(..) GraphDiff diff = event.getDiff(); if (diff instanceof SnapshotEventDecorator) { SnapshotEvent decoratedEvent = ((SnapshotEventDecorator) diff).getEvent(); context.getObjectStore().processSnapshotEvent(decoratedEvent); } else { synchronized (context.getObjectStore()) { diff.apply(this); } } // repost channel change event for our own children context.fireDataChannelChanged(event.getPostedBy(), event.getDiff()); } }
public void graphChanged(GraphEvent event) { // parent received external change if (shouldProcessEvent(event)) { // temp kludge - see TODO in ObjectStore.snapshotsChanged(..) GraphDiff diff = event.getDiff(); if (diff instanceof SnapshotEventDecorator) { SnapshotEvent decoratedEvent = ((SnapshotEventDecorator) diff).getEvent(); context.getObjectStore().processSnapshotEvent(decoratedEvent); } else { synchronized (context.getObjectStore()) { diff.apply(this); } } // repost channel change event for our own children context.fireDataChannelChanged(event.getPostedBy(), event.getDiff()); } }