/** * Wraps GraphDiff in a GraphEvent and sends it via EventManager with specified * subject. */ void send(GraphDiff diff, EventSubject subject, Object eventSource) { EventManager manager = (context.getChannel() != null) ? context .getChannel() .getEventManager() : null; if (manager != null) { GraphEvent e = new GraphEvent(context, eventSource, diff); manager.postEvent(e, subject); } }
boolean shouldProcessEvent(GraphEvent e) { // only process events that came from our channel, but did not originate in it // (i.e. likely posted by EventBridge) return active && e.getSource() == context.getChannel() && e.getPostedBy() != context && e.getPostedBy() != context.getChannel(); }
boolean shouldProcessEvent(GraphEvent e) { // only process events that came from our channel, but did not originate in it // (i.e. likely posted by EventBridge) return active && e.getSource() == context.getChannel() && e.getPostedBy() != context && e.getPostedBy() != context.getChannel(); }
/** * Wraps GraphDiff in a GraphEvent and sends it via EventManager with specified * subject. */ void send(GraphDiff diff, EventSubject subject, Object eventSource) { EventManager manager = (context.getChannel() != null) ? context .getChannel() .getEventManager() : null; if (manager != null) { GraphEvent e = new GraphEvent(context, eventSource, diff); manager.postEvent(e, subject); } }
void graphCommitted(GraphDiff parentSyncDiff) { if (parentSyncDiff != null) { new CayenneContextMergeHandler(context).merge(parentSyncDiff); } remapTargets(); stateLog.graphCommitted(); reset(); if (lifecycleEventsEnabled) { // include all diffs after the commit start marker. // We fire event as if it was posted by parent channel, so that // nested contexts could catch it context.fireDataChannelCommitted(context.getChannel(), parentSyncDiff); } }