Package com.thoughtworks.proxy.toys.multicast

Examples of com.thoughtworks.proxy.toys.multicast.Multicast


            list1.add(new Integer(5));
            list1.add(new Integer(100));
            List list2 = new LinkedList();
            list2.add(new Integer(3));
            List listCombined = (List)Multicasting.object(new List[]{list1, list2});
            Multicast values = (Multicast)listCombined.get(0);
            System.out.println("Sum of the first integers: "
                    + values.multicastTargets(Integer.class, "intValue", null).toString());
        } catch (NoSuchMethodException e) {
            // Integer.class has a intValue method
        }
    }
View Full Code Here


    }

    public static void packageOverviewExample4() {
        try {
            Method method = String.class.getMethod("length", null);
            Multicast multicast = (Multicast)Multicasting.object(new Object[]{"ProxyToys", "is", "great"});
            System.out.println("Total number of characters: " + multicast.multicastTargets(method, null));
            String[] strings = (String[])multicast.getTargetsInArray(String.class);
            for (int i = 0; i < strings.length; i++) {
                System.out.println("String[" + i + "]: " + strings[i]);
            }
        } catch (NoSuchMethodException e) {
            // String.class has a length method
View Full Code Here

TOP

Related Classes of com.thoughtworks.proxy.toys.multicast.Multicast

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.