Package org.apache.cayenne.event

Examples of org.apache.cayenne.event.DefaultEventManager$DispatchThread


    }

    public void testCommitChangesNew() {
        final CompoundDiff diff = new CompoundDiff();
        final Object newObjectId = new ObjectId("test", "key", "generated");
        final EventManager eventManager = new DefaultEventManager(0);

        // test that ids that are passed back are actually propagated to the right
        // objects...

        MockDataChannel channel = new MockDataChannel() {
View Full Code Here


        deleteTestData();

        DataRowStore cache = new DataRowStore(
                "cacheTest",
                Collections.EMPTY_MAP,
                new DefaultEventManager());

        c1 = new DataContext(getDomain(), new ObjectStore(cache));
        c2 = new DataContext(getDomain(), new ObjectStore(cache));

        // prepare a single artist record
View Full Code Here

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

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

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

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

        assertEquals(DataRowStore.REMOTE_NOTIFICATION_DEFAULT, cache
View Full Code Here

                .valueOf(!DataRowStore.REMOTE_NOTIFICATION_DEFAULT));

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

    public void testNotifyingRemoteListeners() {
        DataRowStore cache = new DataRowStore(
                "cacheXYZ",
                Collections.EMPTY_MAP,
                new DefaultEventManager());

        assertEquals(DataRowStore.REMOTE_NOTIFICATION_DEFAULT, cache
                .isNotifyingRemoteListeners());

        cache.setNotifyingRemoteListeners(!DataRowStore.REMOTE_NOTIFICATION_DEFAULT);
View Full Code Here

        props.put(DataRowStore.SNAPSHOT_CACHE_SIZE_PROPERTY, String.valueOf(2));

        DataRowStore cache = new DataRowStore(
                "cacheXYZ",
                props,
                new DefaultEventManager());
        assertEquals(2, cache.maximumSize());
        assertEquals(0, cache.size());

        ObjectId key1 = new ObjectId("Artist", Artist.ARTIST_ID_PK_COLUMN, 1);
        Map diff1 = new HashMap();
View Full Code Here

    /**
     * @deprecated since 3.1 use
     *             {@link #ClientChannel(ClientConnection, boolean, EventManager, boolean)}
     */
    public ClientChannel(ClientConnection connection, boolean channelEventsEnabled) {
        this(connection, channelEventsEnabled, new DefaultEventManager(2));
    }
View Full Code Here

                clientServerChannel,
                serializationPolicy);
        ClientChannel channel = new ClientChannel(connection, false,
        // we want events, but we don't want thread eaks, so creating single threaded EM.
                // TODO: replace with container managed ClientCase.
                new DefaultEventManager(0),
                false);
        CayenneContext context = new CayenneContext(channel, true, true);
        context.setQueryCache(new MapQueryCache(10));
        return context;
    }
View Full Code Here

        catch (CayenneRuntimeException e) {
            // expected
        }

        try {
            new ClientChannel(connection, false, new DefaultEventManager(2), false);
            fail("Channel didn't throw on broken EventBridge");
        }
        catch (CayenneRuntimeException e) {
            // expected
        }

        try {
            new ClientChannel(connection, false, new DefaultEventManager(2), true);
        }
        catch (CayenneRuntimeException e) {
            fail("Channel threw on broken EventBridge");
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.event.DefaultEventManager$DispatchThread

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.