Package org.apache.cayenne.graph

Examples of org.apache.cayenne.graph.GraphEvent


                    }

                    Object postedBy = (originatingContext != null)
                            ? (Object) originatingContext
                            : this;
                    GraphEvent e = new GraphEvent(this, postedBy, notification);
                    eventManager.postEvent(e, subject);
                }
            }
        }
View Full Code Here


        EventManager manager = (context.getChannel() != null) ? context
                .getChannel()
                .getEventManager() : null;

        if (manager != null) {
            GraphEvent e = new GraphEvent(context, eventSource, diff);
            manager.postEvent(e, subject);
        }
    }
View Full Code Here

                    }

                    Object postedBy = (originatingContext != null)
                            ? originatingContext
                            : this;
                    GraphEvent e = new GraphEvent(this, postedBy, notification);
                    eventManager.postEvent(e, subject);
                }
            }
        }
View Full Code Here

        CayenneContextMergeHandler handler = new CayenneContextMergeHandler(context);

        // 1. Our context initiated the sync:
        // src == channel && postedBy == context
        GraphEvent e1 = new GraphEvent(context.getChannel(), context, null);
        assertFalse(handler.shouldProcessEvent(e1));

        // 2. Another context initiated the sync:
        // postedBy != context && source == channel
        GraphEvent e2 = new GraphEvent(
                context.getChannel(),
                new MockObjectContext(),
                null);
        assertTrue(handler.shouldProcessEvent(e2));

        // 2.1 Another object initiated the sync:
        // postedBy != context && source == channel
        GraphEvent e21 = new GraphEvent(context.getChannel(), new Object(), null);
        assertTrue(handler.shouldProcessEvent(e21));

        // 3. Another channel initiated the sync:
        // postedBy == ? && source != channel
        GraphEvent e3 = new GraphEvent(new MockDataChannel(), new Object(), null);
        assertFalse(handler.shouldProcessEvent(e3));

        // 4. inactive
        GraphEvent e4 = new GraphEvent(
                context.getChannel(),
                new MockObjectContext(),
                null);
        handler.active = false;
        assertFalse(handler.shouldProcessEvent(e4));
View Full Code Here

        EventManager manager = (context.getChannel() != null) ? context
                .getChannel()
                .getEventManager() : null;

        if (manager != null) {
            GraphEvent e = new GraphEvent(context, eventSource, diff);
            manager.postEvent(e, subject);
        }
    }
View Full Code Here

     */
    protected void fireDataChannelCommitted(Object postedBy, GraphDiff changes) {
        EventManager manager = getEventManager();

        if (manager != null) {
            GraphEvent e = new GraphEvent(this, postedBy, changes);
            manager.postEvent(e, DataChannel.GRAPH_FLUSHED_SUBJECT);
        }
    }
View Full Code Here

     */
    protected void fireDataChannelRolledback(Object postedBy, GraphDiff changes) {
        EventManager manager = getEventManager();

        if (manager != null) {
            GraphEvent e = new GraphEvent(this, postedBy, changes);
            manager.postEvent(e, DataChannel.GRAPH_ROLLEDBACK_SUBJECT);
        }
    }
View Full Code Here

     */
    protected void fireDataChannelChanged(Object postedBy, GraphDiff changes) {
        EventManager manager = getEventManager();

        if (manager != null) {
            GraphEvent e = new GraphEvent(this, postedBy, changes);
            manager.postEvent(e, DataChannel.GRAPH_CHANGED_SUBJECT);
        }
    }
View Full Code Here

     */
    void fireDataChannelCommitted(Object postedBy, GraphDiff changes) {
        EventManager manager = getEventManager();

        if (manager != null) {
            GraphEvent e = new GraphEvent(this, postedBy, changes);
            manager.postEvent(e, DataChannel.GRAPH_FLUSHED_SUBJECT);
        }
    }
View Full Code Here

     */
    void fireDataChannelRolledback(Object postedBy, GraphDiff changes) {
        EventManager manager = getEventManager();

        if (manager != null) {
            GraphEvent e = new GraphEvent(this, postedBy, changes);
            manager.postEvent(e, DataChannel.GRAPH_ROLLEDBACK_SUBJECT);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.graph.GraphEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.