Package org.apache.cayenne

Examples of org.apache.cayenne.DataChannel


        assertTrue(configured[0]);
        assertTrue(configured[1]);
    }

    public void testGetDataChannel_CustomModule() {
        final DataChannel channel = new DataChannel() {

            public EntityResolver getEntityResolver() {
                return null;
            }
View Full Code Here


    @Inject(ClientLocalRuntime.CLIENT_SERVER_CHANNEL_KEY)
    protected Provider<DataChannel> clientServerChannelProvider;

    public ClientConnection get() throws ConfigurationException {

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

    @Override
    protected ServerSession createServerSession() {

        HttpSession httpSession = getSession(true);

        DataChannel channel = createChannel();
        RemoteSession remoteSession = createRemoteSession(
                httpSession.getId(),
                null,
                false);
        ServerSession serverSession = new ServerSession(remoteSession, channel);
View Full Code Here

        if (name == null) {
            throw new IllegalArgumentException("Name is null for shared session.");
        }

        HttpSession httpSession = getSession(true);
        DataChannel channel;

        synchronized (sharedChannels) {
            channel = getSharedChannel(name);
            if (channel == null) {
                channel = createChannel();
View Full Code Here

        dbHelper.deleteAll("ARTIST");
    }

    public void testCommitDecorated() {
        DataDomain dd = runtime.getDataDomain();
        DataChannel decorator = new DataChannelDecorator(dd);
        DataContext context = new DataContext(decorator, new ObjectStore(dd
                .getSharedSnapshotCache()));

        Artist a = context.newObject(Artist.class);
        a.setArtistName("XXX");
View Full Code Here

        assertEquals(new Integer(1), count.get("x"));
    }

    public void testGetParentDataDomain() {
        DataDomain dd = runtime.getDataDomain();
        DataChannel decorator = new DataChannelDecorator(dd);
        DataContext context = new DataContext(decorator, new ObjectStore(dd
                .getSharedSnapshotCache()));

        assertSame(dd, context.getParentDataDomain());
    }
View Full Code Here

                eventBridgeParameters));

        ServerRuntime runtime = new ServerRuntime(configurationLocation, modules
                .toArray(new Module[modules.size()]));

        DataChannel channel = runtime.getChannel();

        RemoteService service = runtime.getInjector().getInstance(RemoteService.class);

        SerializerFactory serializerFactory = HessianConfig.createFactory(
                HessianService.SERVER_SERIALIZER_FACTORIES,
                channel.getEntityResolver());

        setAPIClass(RemoteService.class);
        setSerializerFactory(serializerFactory);
        setService(service);
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

  public static void main(String[] args) {

    ClientConnection connection = new HessianConnection(
        "http://localhost:8080/tutorial/cayenne-service",
        "cayenne-user", "secret", null);
    DataChannel channel = new ClientChannel(connection);
    ObjectContext context = new CayenneContext(channel);

    newObjectsTutorial(context);
    selectTutorial(context);
    deleteTutorial(context);
View Full Code Here

TOP

Related Classes of org.apache.cayenne.DataChannel

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.