Package org.apache.cayenne.remote.service

Examples of org.apache.cayenne.remote.service.LocalConnection


    @Inject
    protected Provider<ClientRuntime> clientRuntimeProvider;

    public ClientServerChannel get() throws ConfigurationException {

        LocalConnection connection = (LocalConnection) clientRuntimeProvider
                .get()
                .getConnection();
       
        ClientServerDataChannelDecorator channelDecorator = (ClientServerDataChannelDecorator) connection.getChannel();
        return (ClientServerChannel) channelDecorator.getDelegate();
    }
View Full Code Here


    @Inject
    protected Provider<ClientRuntime> clientRuntimeProvider;

    private ClientServerDataChannelDecorator getChannelDecorator() {

        LocalConnection connection = (LocalConnection) clientRuntimeProvider
                .get()
                .getConnection();

        return (ClientServerDataChannelDecorator) connection.getChannel();
    }
View Full Code Here

        ClientConnection connection = runtime.getConnection();
        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

    protected Provider<DataChannel> clientServerChannelProvider;

    public ClientConnection get() throws ConfigurationException {

        DataChannel clientServerChannel = clientServerChannelProvider.get();
        return new LocalConnection(
                clientServerChannel,
                LocalConnection.HESSIAN_SERIALIZATION);
    }
View Full Code Here

*/
public class LocalConnectionTest extends TestCase {

    public void testConstructors() {
        DataChannel handler1 = new MockDataChannel();
        LocalConnection connector1 = new LocalConnection(handler1);
        assertFalse(connector1.isSerializingMessages());
        assertSame(handler1, connector1.getChannel());

        DataChannel handler2 = new MockDataChannel();
        LocalConnection connector2 = new LocalConnection(
                handler2,
                LocalConnection.JAVA_SERIALIZATION);
        assertTrue(connector2.isSerializingMessages());
        assertSame(handler2, connector2.getChannel());
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.remote.service.LocalConnection

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.