Package org.apache.cayenne.access

Examples of org.apache.cayenne.access.ClientServerChannel


    public void setUpAfterInjection() throws Exception {
        clientContext = createROPContext();
    }

    protected CayenneContext createROPContext() {
        ClientServerChannel clientServerChannel = new ClientServerChannel(serverContext);
        UnitLocalConnection connection = new UnitLocalConnection(
                clientServerChannel,
                serializationPolicy);
        ClientChannel channel = new ClientChannel(connection, false,
        // we want events, but we don't want thread leaks, so creating single threaded EM.
View Full Code Here


        parentDataContext = createDataContext();
        context = createROPContext();
    }

    protected CayenneContext createROPContext() {
        ClientServerChannel clientServerChannel = new ClientServerChannel(
                parentDataContext);
        UnitLocalConnection connection = new UnitLocalConnection(
                clientServerChannel,
                serializationPolicy);
        ClientChannel channel = new ClientChannel(connection, false,
View Full Code Here

                .getAccessStack(MULTI_TIER_ACCESS_STACK);
    }

    protected ObjectContext createObjectContext() {
        // wrap ClientServerChannel in LocalConnection to enable logging...
        ClientConnection connector = new LocalConnection(new ClientServerChannel(
                getDomain()), LocalConnection.HESSIAN_SERIALIZATION);
        return new CayenneContext(new ClientChannel(connector));
    }
View Full Code Here

                    LifecycleEvent.POST_ADD,
                    MtTable1.class,
                    new ClientChannelServerDiffsListener1(),
                    "prePersist");

            ClientServerChannel csChannel = new ClientServerChannel(getDomain());
            ClientChannel channel = new ClientChannel(new LocalConnection(csChannel));
            CayenneContext context = new CayenneContext(channel);
            ClientMtTable1 o = context.newObject(ClientMtTable1.class);
            o.setServerAttribute1("YY");
            context.commitChanges();
View Full Code Here

                    LifecycleEvent.PRE_UPDATE,
                    MtTable1.class,
                    new ClientChannelServerDiffsListener1(),
                    "preUpdate");

            ClientServerChannel csChannel = new ClientServerChannel(getDomain());
            ClientChannel channel = new ClientChannel(new LocalConnection(csChannel));
            CayenneContext context = new CayenneContext(channel);
            ClientMtTable1 o = context.newObject(ClientMtTable1.class);
            o.setServerAttribute1("YY");
            context.commitChanges();
View Full Code Here

     * returns {@link ClientServerChannel} instance wrapping a DataContext. Subclasses may
     * override the method to customize channel creation. For instance they may wrap
     * channel in the custom interceptors to handle transactions or security.
     */
    protected DataChannel createChannel() {
        return new ClientServerChannel(domain);
    }
View Full Code Here

                    LifecycleEvent.POST_ADD,
                    MtTable1.class,
                    new ClientChannelServerDiffsListener1(),
                    "prePersist");

            ClientServerChannel csChannel = new ClientServerChannel(getDomain());
            ClientChannel channel = new ClientChannel(new LocalConnection(csChannel));
            CayenneContext context = new CayenneContext(channel);
            ClientMtTable1 o = context.newObject(ClientMtTable1.class);
            ClientMtTable2 o1 = context.newObject(ClientMtTable2.class);
            o.addToTable2Array(o1);
View Full Code Here

                    LifecycleEvent.POST_ADD,
                    MtTable1.class,
                    new ClientChannelServerDiffsListener1(),
                    "prePersistAddRelationship");

            ClientServerChannel csChannel = new ClientServerChannel(getDomain());
            ClientChannel channel = new ClientChannel(new LocalConnection(csChannel));
            CayenneContext context = new CayenneContext(channel);
            ClientMtTable1 o = context.newObject(ClientMtTable1.class);
            ClientMtTable2 o1 = context.newObject(ClientMtTable2.class);
            o.addToTable2Array(o1);
View Full Code Here

                .getResources()
                .getAccessStack(MULTI_TIER_ACCESS_STACK);
    }

    private CayenneContext createClientContext() {
        ClientServerChannel serverChannel = new ClientServerChannel(getDomain());
        LocalConnection connection = new LocalConnection(serverChannel);
        ClientChannel clientChannel = new ClientChannel(connection);
        return new CayenneContext(clientChannel);
    }
View Full Code Here

    public void testSyncNewObject() throws Exception {
        // this resets snapshot cache...
        createDataContext();
        deleteTestData();

        DataChannel serverChannel = new ClientServerChannel(getDomain());
        ClientChannel clientChannel = new ClientChannel(
                new LocalConnection(serverChannel),
                true);

        CayenneContext c1 = new CayenneContext(clientChannel);
View Full Code Here

TOP

Related Classes of org.apache.cayenne.access.ClientServerChannel

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.