Examples of HessianConnection


Examples of org.apache.cayenne.remote.hessian.HessianConnection

                .get(ClientModule.ROP_SERVICE_USER_NAME);
        String password = runtimeProperties.get(ClientModule.ROP_SERVICE_PASSWORD);
        String sharedSession = runtimeProperties
                .get(ClientModule.ROP_SERVICE_SHARED_SESSION);

        return new HessianConnection(url, userName, password, sharedSession);
    }
View Full Code Here

Examples of org.apache.cayenne.remote.hessian.HessianConnection

public class Main {

  public static void main(String[] args) {

    ClientConnection connection = new HessianConnection(
        "http://localhost:8080/cayenne-service", "cayenne-user",
        "secret", null);

    DataChannel channel = new ClientChannel(connection);
View Full Code Here

Examples of org.apache.cayenne.remote.hessian.HessianConnection

                .get(Constants.ROP_SERVICE_SHARED_SESSION_PROPERTY);
        long readTimeout = runtimeProperties.getLong(
                Constants.ROP_SERVICE_TIMEOUT_PROPERTY,
                -1l);

        HessianConnection result = new HessianConnection(
                url,
                userName,
                password,
                sharedSession);

        if (readTimeout > 0) {
            result.setReadTimeout(readTimeout);
        }

        return result;
    }
View Full Code Here

Examples of org.apache.cayenne.remote.hessian.HessianConnection

import java.rmi.RemoteException;

public class HessianConnectionTest extends TestCase {

    public void testConstructor1Arg() {
        HessianConnection c = new HessianConnection("a");
        assertEquals("a", c.getUrl());
        assertNull(c.getUserName());
        assertNull(c.getPassword());
    }
View Full Code Here

Examples of org.apache.cayenne.remote.hessian.HessianConnection

        assertNull(c.getUserName());
        assertNull(c.getPassword());
    }
   
    public void testConstructor3Arg() {
        HessianConnection c = new HessianConnection("a", "b", "c", "d");
        assertEquals("a", c.getUrl());
        assertEquals("b", c.getUserName());
        assertEquals("c", c.getPassword());
        assertEquals("d", c.getSharedSessionName());
    }
View Full Code Here

Examples of org.apache.cayenne.remote.hessian.HessianConnection

        assertEquals("d", c.getSharedSessionName());
    }

    public void testMissingSessionException() {
        // Set up the test objects.  We want to mock out RemoteService.
        HessianConnection c = new HessianConnection("a");
        c.service = new RemoteService() {
            public RemoteSession establishSession() throws RemoteException {
                return null;
            }

            public RemoteSession establishSharedSession(String name) throws RemoteException {
                return null;
            }

            public Object processMessage(ClientMessage message) throws RemoteException, Throwable {
                throw new MissingSessionException();
            }
        };


        try {
            c.doSendMessage(null);
        }
        catch (CayenneRuntimeException e) {
            // Verify that CayenneRuntimeExceptions are not wrapped in another CayenneRuntimeException.
            assertTrue(e instanceof MissingSessionException);
        }
View Full Code Here

Examples of org.apache.cayenne.remote.hessian.HessianConnection

public class Main {

  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);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.