Package org.apache.cayenne.event

Examples of org.apache.cayenne.event.EventManager


     */
    public static boolean listenForChannelEvents(
            DataChannel channel,
            DataChannelListener listener) {

        EventManager manager = channel.getEventManager();

        if (manager == null) {
            return false;
        }

View Full Code Here


                // cache entity resolver, as we have no idea how expensive it is to query
                // it on the channel every time
                this.entityResolver = channel.getEntityResolver();

                EventManager eventManager = channel.getEventManager();

                if (eventManager != null) {
                    this.mergeHandler = new DataContextMergeHandler(this);

                    // listen to our channel events...
View Full Code Here

    /**
     * @since 1.2
     */
    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

    /**
     * @since 1.2
     */
    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

    /**
     * @since 1.2
     */
    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

     *            null.
     * @deprecated since 3.0 as it instantiates an EventManager internally that can lead
     *             to dispatch thread leaks.
     */
    public DataRowStore(String name, Map properties) {
        this(name, properties, new EventManager());
    }
View Full Code Here

                // cache entity resolver, as we have no idea how expensive it is to query
                // it on the channel every time
                this.entityResolver = channel.getEntityResolver();

                EventManager eventManager = channel.getEventManager();

                if (eventManager != null) {
                    this.mergeHandler = new DataContextMergeHandler(this);

                    // listen to our channel events...
View Full Code Here

        final boolean[] cacheShutdown = new boolean[1];

        DataRowStore cache = new DataRowStore(
                "Y",
                Collections.EMPTY_MAP,
                new EventManager()) {

            @Override
            public void shutdown() {
                cacheShutdown[0] = true;
            }
View Full Code Here

    public void testDefaultConstructor() {
        DataRowStore cache = new DataRowStore(
                "cacheXYZ",
                Collections.EMPTY_MAP,
                new EventManager());
        assertEquals("cacheXYZ", cache.getName());
        assertNotNull(cache.getSnapshotEventSubject());
        assertTrue(cache.getSnapshotEventSubject().getSubjectName().contains("cacheXYZ"));

        assertEquals(DataRowStore.REMOTE_NOTIFICATION_DEFAULT, cache
View Full Code Here

    public void testConstructorWithProperties() {
        Map props = new HashMap();
        props.put(DataRowStore.REMOTE_NOTIFICATION_PROPERTY, String
                .valueOf(!DataRowStore.REMOTE_NOTIFICATION_DEFAULT));

        DataRowStore cache = new DataRowStore("cacheXYZ", props, new EventManager());
        assertEquals("cacheXYZ", cache.getName());
        assertEquals(!DataRowStore.REMOTE_NOTIFICATION_DEFAULT, cache
                .isNotifyingRemoteListeners());
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.event.EventManager

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.