Package org.exolab.jms.net

Examples of org.exolab.jms.net.CallbackService


        Proxy proxy = server.exportObject(serviceImpl);
        server.getRegistry().bind("service", proxy);

        ORB client = getClientORB();
        Registry registry = client.getRegistry(getConnectionProperties());
        CallbackService service = (CallbackService) registry.lookup("service");

        LoggingCallback callback = new LoggingCallback();
        Callback callbackProxy = (Callback) client.exportObjectTo(callback,
                                                                  getServerURI());
        service.addCallback(callbackProxy);

        assertNull(serviceImpl.getException());
        client.shutdown();

        if (!latch.attempt(10 * 1000)) {
View Full Code Here


        ORB client = getClientORB();
        client.addCallerListener(getServerURI(), listener);

        Registry registry = getRegistry(); // will establish a connection
        assertNotNull(registry);
        CallbackService service = (CallbackService) registry.lookup("service");
        assertNotNull(service);

        // make sure the connection isn't reaped through inactivity
        // while there are proxies associated with it.
        for (int i = 0; i < 10; ++i) {
View Full Code Here

     */
    public void testCallback() throws Exception {
        final int count = 10;
        ORB client = getClientORB();
        Registry registry = client.getRegistry(getConnectionProperties());
        CallbackService service =
                (CallbackService) registry.lookup(CALLBACK_SERVICE);

        LoggingCallback callback = new LoggingCallback();
        Callback proxy = (Callback) client.exportObjectTo(callback,
                                                          getServerURI());
        service.addCallback(proxy);

        for (int i = 0; i < count; ++i) {
            _service.invoke(new Integer(i));
        }

View Full Code Here

        final int count = 10;
        final int depth = 4; // recursion depth

        ORB client = getClientORB();
        Registry registry = client.getRegistry(getConnectionProperties());
        CallbackService service =
                (CallbackService) registry.lookup(CALLBACK_SERVICE);

        RecursiveCallback callback = new RecursiveCallback(service, depth);
        Callback proxy = (Callback) client.exportObjectTo(callback,
                                                          getServerURI());
        service.addCallback(proxy);

        for (int i = 0; i < count; ++i) {
            _service.invoke(new Integer(i));
        }
View Full Code Here

        }

        Authenticator authenticator = new TestAuthenticator(principal);
        ORB orb = createORB(authenticator);

        CallbackService serviceImpl = new CallbackServiceImpl();
        Proxy proxy = orb.exportObject(serviceImpl);
        orb.getRegistry().bind("service", proxy);

        ORB client = getClientORB();
        Registry registry = getRegistry(principal);
        CallbackService service = (CallbackService) registry.lookup("service");

        LoggingCallback callback = new LoggingCallback();
        Callback callbackProxy = (Callback) client.exportObjectTo(
                callback, getServerURI(), user, password);
        service.addCallback(callbackProxy);

        for (int i = 0; i < count; ++i) {
            service.invoke(new Integer(i));
        }

        Integer[] objects = (Integer[]) callback.getObjects().toArray(
                new Integer[0]);
        assertEquals(count, objects.length);
        for (int i = 0; i < count; ++i) {
            assertEquals(i, objects[i].intValue());
        }

        client.unexportObject(callback);
        try {
            service.invoke(new Integer(0));
        } catch (RemoteInvocationException expected) {
            // expected behaviour
            assertTrue(expected.getTargetException()
                       instanceof NoSuchObjectException);
        }
View Full Code Here

TOP

Related Classes of org.exolab.jms.net.CallbackService

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.