Search in sources :

Example 1 with UnitLocalConnection

use of org.apache.cayenne.unit.UnitLocalConnection in project cayenne by apache.

the class RemoteCayenneCase method createROPContext.

protected CayenneContext createROPContext() {
    ClientServerChannel clientServerChannel = new ClientServerChannel(serverContext);
    UnitLocalConnection connection = new UnitLocalConnection(clientServerChannel, serializationPolicy);
    ClientChannel channel = new ClientChannel(connection, false, // TODO: replace with container managed ClientCase.
    new DefaultEventManager(0), false);
    CayenneContext context = new CayenneContext(channel, true, true);
    context.setQueryCache(new MapQueryCache(10));
    return context;
}
Also used : UnitLocalConnection(org.apache.cayenne.unit.UnitLocalConnection) DefaultEventManager(org.apache.cayenne.event.DefaultEventManager) MapQueryCache(org.apache.cayenne.cache.MapQueryCache) ClientServerChannel(org.apache.cayenne.access.ClientServerChannel) CayenneContext(org.apache.cayenne.CayenneContext)

Aggregations

CayenneContext (org.apache.cayenne.CayenneContext)1 ClientServerChannel (org.apache.cayenne.access.ClientServerChannel)1 MapQueryCache (org.apache.cayenne.cache.MapQueryCache)1 DefaultEventManager (org.apache.cayenne.event.DefaultEventManager)1 UnitLocalConnection (org.apache.cayenne.unit.UnitLocalConnection)1