Package org.apache.cayenne.remote

Examples of org.apache.cayenne.remote.RemoteSession


    protected RemoteSession createRemoteSession(
            String sessionId,
            String name,
            boolean enableEvents) {
        RemoteSession session = (enableEvents) ? new RemoteSession(
                sessionId,
                eventBridgeFactoryName,
                eventBridgeParameters) : new RemoteSession(sessionId);

        session.setName(name);
        return session;
    }
View Full Code Here


    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

            else {
                logger.debug("Joining existing shared channel: " + name);
            }
        }

        RemoteSession remoteSession = createRemoteSession(httpSession.getId(), name, true);

        ServerSession serverSession = new ServerSession(remoteSession, channel);
        httpSession.setAttribute(SESSION_ATTRIBUTE, serverSession);
        return serverSession;
    }
View Full Code Here

    protected abstract ServerSession getServerSession();

    public RemoteSession establishSession() {
        logger.debug("Session requested by client");

        RemoteSession session = createServerSession().getSession();

        logger.debug("Established client session: " + session);
        return session;
    }
View Full Code Here

    protected RemoteSession createRemoteSession(
            String sessionId,
            String name,
            boolean enableEvents) {
        RemoteSession session = (enableEvents) ? new RemoteSession(
                sessionId,
                eventBridgeFactoryName,
                eventBridgeParameters) : new RemoteSession(sessionId);

        session.setName(name);
        return session;
    }
View Full Code Here

        };
        BaseRemoteService service = new BaseRemoteService(factory, map) {

            @Override
            protected ServerSession createServerSession() {
                return new ServerSession(new RemoteSession("a"), null);
            }

            @Override
            protected ServerSession createServerSession(String name) {
                return createServerSession();
View Full Code Here

import junit.framework.TestCase;

public class RemoteSessionTest extends TestCase {

    public void testConstructor1() {
        RemoteSession descriptor = new RemoteSession("abc");
        assertEquals("abc", descriptor.getSessionId());
        assertFalse(descriptor.isServerEventsEnabled());
    }
View Full Code Here

        assertEquals("abc", descriptor.getSessionId());
        assertFalse(descriptor.isServerEventsEnabled());
    }

    public void testConstructor2() {
        RemoteSession descriptor = new RemoteSession("abc", "factory", null);
        assertEquals("abc", descriptor.getSessionId());
        assertTrue(descriptor.isServerEventsEnabled());
    }
View Full Code Here

        assertEquals("abc", descriptor.getSessionId());
        assertTrue(descriptor.isServerEventsEnabled());
    }

    public void testHashCode() {
        RemoteSession d1 = new RemoteSession("1");
        RemoteSession d2 = new RemoteSession("1");

        assertEquals(d1.hashCode(), d1.hashCode());
        assertEquals(d1.hashCode(), d2.hashCode());

        d2.setName("some name");
        assertEquals(d1.hashCode(), d2.hashCode());

        RemoteSession d3 = new RemoteSession("2");
        assertFalse(d1.hashCode() == d3.hashCode());
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.remote.RemoteSession

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.