Package org.codehaus.aspectwerkz.connectivity

Examples of org.codehaus.aspectwerkz.connectivity.RemoteProxy


        // creates a new remote proxy for the TestImpl1 class which maps to an instance of this

        // class on the server

        RemoteProxy proxy1 = RemoteProxy.createClientProxy(new String[] {

            "examples.connectivity.Test1"

        }, "examples.connectivity.Test1Impl", "localhost", 6663);

        // retrieves the proxy the the TestImpl1 instance

        Test1 mixin1 = (Test1) proxy1.getInstance();



        // 2)

        // retrieve the proxy to a specific instance created on the server

        RemoteProxy proxy2 = mixin1.getTest1();

        // retrieves the proxy the the TestImpl2 instance

        Test2 mixin2 = (Test2) proxy2.getInstance();



        // 3)

        // invoke methods on the proxies (executed on the server)

        System.out.println("Mixin1 says: " + mixin1.test1());

        System.out.println("Mixin2 says: " + mixin2.test2());



        // 4)

        // close the proxies (close() must always be called)

        proxy1.close();

        proxy2.close();

    }
View Full Code Here


    public RemoteProxy getTest1() {

        Test2 test2 = (Test2) new Target();

        RemoteProxy proxy = RemoteProxy.createServerProxy(test2, "localhost", 7777);

        return proxy;

    }
View Full Code Here

    private static void run() {

        // 1)
        // creates a new remote proxy for the TestImpl1 class which maps to an instance of this
        // class on the server
        RemoteProxy proxy1 = RemoteProxy.createClientProxy(
                new String[]{"examples.connectivity.Test1"},
                "examples.connectivity.Test1Impl",
                "localhost",
                7777
        );
        // retrieves the proxy the the TestImpl1 instance
        Test1 mixin1 = (Test1)proxy1.getInstance();

        // 2)
        // retrieve the proxy to a specific instance created on the server
        RemoteProxy proxy2 = mixin1.getTest1();
        // retrieves the proxy the the TestImpl2 instance
        Test2 mixin2 = (Test2)proxy2.getInstance();

        // 3)
        // invoke methods on the proxies (executed on the server)
        System.out.println("Mixin1 says: " + mixin1.test1());
        System.out.println("Mixin2 says: " + mixin2.test2());

        // 4)
        // close the proxies (close() must always be called)
        proxy1.close();
        proxy2.close();
    }
View Full Code Here

        return "test 1";
    }

    public RemoteProxy getTest1() {
        Test2 test2 = (Test2)new Target();
        RemoteProxy proxy = RemoteProxy.createServerProxy(test2, "localhost", 7777);
        return proxy;
    }
View Full Code Here

     */
    private static void run() {
        // 1)
        // creates a new remote proxy for the TestImpl1 class which maps to an instance of this
        // class on the server
        RemoteProxy proxy1 = RemoteProxy.createClientProxy(
                new String[]{
                    "examples.connectivity.Test1"
                }, "examples.connectivity.Test1Impl", "localhost", 6663
        );
        // retrieves the proxy the the TestImpl1 instance
        Test1 mixin1 = (Test1) proxy1.getInstance();

        // 2)
        // retrieve the proxy to a specific instance created on the server
        RemoteProxy proxy2 = mixin1.getTest1();
        // retrieves the proxy the the TestImpl2 instance
        Test2 mixin2 = (Test2) proxy2.getInstance();

        // 3)
        // invoke methods on the proxies (executed on the server)
        System.out.println("Mixin1 says: " + mixin1.test1());
        System.out.println("Mixin2 says: " + mixin2.test2());

        // 4)
        // close the proxies (close() must always be called)
        proxy1.close();
        proxy2.close();
    }
View Full Code Here

*
* @author <a href="mailto:jboner@codehaus.org">Jonas Bon�r</a>
*/
public class Client {
    public static void main(String[] args) {
        RemoteProxy proxy = RemoteProxy.createClientProxy(
                new String[]{
                    "examples.connectivity.Test1",
                    "examples.connectivity.Test2"
                },
                "examples.connectivity.Target",
                "localhost",
                7777
        );

        Test1 test1 = (Test1)proxy.getProxy();
        System.out.println("Message: " + test1.test1());

        Test2 test2 = (Test2)proxy.getProxy();
        System.out.println("Message: " + test2.test2());

        proxy.close();
    }
View Full Code Here

    private static void run() {

        // 1)
        // creates a new remote proxy for the TestImpl1 class which maps to an instance of this
        // class on the server
        RemoteProxy proxy1 = RemoteProxy.createClientProxy(
                new String[]{"examples.connectivity.Test1"},
                "examples.connectivity.Test1Impl",
                "localhost",
                7777
        );
        // retrieves the proxy the the TestImpl1 instance
        Test1 mixin1 = (Test1)proxy1.getInstance();

        // 2)
        // retrieve the proxy to a specific instance created on the server
        RemoteProxy proxy2 = mixin1.getTest1();
        // retrieves the proxy the the TestImpl2 instance
        Test2 mixin2 = (Test2)proxy2.getInstance();

        // 3)
        // invoke methods on the proxies (executed on the server)
        System.out.println("Mixin1 says: " + mixin1.test1());
        System.out.println("Mixin2 says: " + mixin2.test2());

        // 4)
        // close the proxies (close() must always be called)
        proxy1.close();
        proxy2.close();
    }
View Full Code Here

    private static void run() {

        // 1)
        // creates a new remote proxy for the TestImpl1 class which maps to an instance of this
        // class on the server
        RemoteProxy proxy1 = RemoteProxy.createClientProxy(
                new String[]{"examples.connectivity.Test1"},
                "examples.connectivity.Test1Impl",
                "localhost",
                7777
        );
        // retrieves the proxy the the TestImpl1 instance
        Test1 mixin1 = (Test1)proxy1.getInstance();

        // 2)
        // retrieve the proxy to a specific instance created on the server
        RemoteProxy proxy2 = mixin1.getTest1();
        // retrieves the proxy the the TestImpl2 instance
        Test2 mixin2 = (Test2)proxy2.getInstance();

        // 3)
        // invoke methods on the proxies (executed on the server)
        System.out.println("Mixin1 says: " + mixin1.test1());
        System.out.println("Mixin2 says: " + mixin2.test2());

        // 4)
        // close the proxies (close() must always be called)
        proxy1.close();
        proxy2.close();
    }
View Full Code Here

        return "test 1";
    }

    public RemoteProxy getTest1() {
        Test2 test2 = (Test2)new Target();
        RemoteProxy proxy = RemoteProxy.createServerProxy(test2, "localhost", 7777);
        return proxy;
    }
View Full Code Here

     */
    private static void run() {
        // 1)
        // creates a new remote proxy for the TestImpl1 class which maps to an instance of this
        // class on the server
        RemoteProxy proxy1 = RemoteProxy.createClientProxy(new String[] {
            "examples.connectivity.Test1"
        }, "examples.connectivity.Test1Impl", "localhost", 6663);
        // retrieves the proxy the the TestImpl1 instance
        Test1 mixin1 = (Test1) proxy1.getInstance();

        // 2)
        // retrieve the proxy to a specific instance created on the server
        RemoteProxy proxy2 = mixin1.getTest1();
        // retrieves the proxy the the TestImpl2 instance
        Test2 mixin2 = (Test2) proxy2.getInstance();

        // 3)
        // invoke methods on the proxies (executed on the server)
        System.out.println("Mixin1 says: " + mixin1.test1());
        System.out.println("Mixin2 says: " + mixin2.test2());

        // 4)
        // close the proxies (close() must always be called)
        proxy1.close();
        proxy2.close();
    }
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.connectivity.RemoteProxy

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.