Package org.apache.cayenne.access

Examples of org.apache.cayenne.access.ClientServerChannel


    protected AccessStack buildAccessStack() {
        return CayenneResources.getResources().getAccessStack(MULTI_TIER_ACCESS_STACK);
    }

    private CayenneContext createClientContext() {
        ClientServerChannel serverChannel = new ClientServerChannel(getDomain());
        LocalConnection connection = new LocalConnection(
                serverChannel,
                LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel clientChannel = new ClientChannel(connection);
        return new CayenneContext(clientChannel);
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

        assertNotNull(connection);
        assertTrue(connection instanceof LocalConnection);

        LocalConnection localConnection = (LocalConnection) connection;
        assertTrue(localConnection.getChannel() instanceof ClientServerChannel);
        ClientServerChannel clientServerChannel = (ClientServerChannel) localConnection
                .getChannel();
        assertSame(channel, ((DataContext) clientServerChannel.getParentChannel())
                .getChannel());
    }
View Full Code Here

        ObjectContextFactory factory = serverInjector
                .getInstance(ObjectContextFactory.class);

        // TODO: ugly cast
        DataContext serverContext = (DataContext) factory.createContext();
        return new ClientServerChannel(serverContext);
    }
View Full Code Here

     * 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((DataContext) contextFactory.createContext());
    }
View Full Code Here

    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

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.