Package org.jgroups.conf

Examples of org.jgroups.conf.PropertyConverter.convert()


     *
     * @throws Exception
     */
    public static void testNetworkList() throws Exception {
        PropertyConverter conv=new PropertyConverters.NetworkInterfaceList();
        Object tmp=conv.convert(null, List.class, "bela", "lo", false);
        Object str=conv.toString(tmp);
        System.out.println("str = " + str);
        assert str.equals("lo");
    }

View Full Code Here


                        throw new Exception("Could not find property converter for field " + propertyName
                                + " in " + name);
                    }
                    Object converted=null;
                    try {
                        converted=propertyConverter.convert(method.getParameterTypes()[0], props, prop);
                        method.invoke(obj, converted);
                    }
                    catch(Exception e) {
                        String name=obj instanceof Protocol? ((Protocol)obj).getName() : obj.getClass().getName();
                        throw new Exception("Could not assign property " + propertyName + " in "
View Full Code Here

                            throw new Exception("Could not find property converter for field " + propertyName
                                    + " in " + name);
                        }
                        Object converted=null;
                        try {
                            converted=propertyConverter.convert(field.getType(), props, propertyValue);
                            setField(field, obj, converted);
                        }
                        catch(Exception e) {
                            String name=obj instanceof Protocol? ((Protocol)obj).getName() : obj.getClass().getName();
                            throw new Exception("Property assignment of " + propertyName + " in "
View Full Code Here

                        throw new Exception("Could not find property converter for field " + propertyName
                                + " in " + name);
                    }
                    Object converted=null;
                    try {
                        converted=propertyConverter.convert(method.getParameterTypes()[0], props, prop);
                        method.invoke(obj, converted);
                    }
                    catch(Exception e) {
                        String name=obj instanceof Protocol? ((Protocol)obj).getName() : obj.getClass().getName();
                        throw new Exception("Could not assign property " + propertyName + " in "
View Full Code Here

                            throw new Exception("Could not find property converter for field " + propertyName
                                    + " in " + name);
                        }
                        Object converted=null;
                        try {
                            converted=propertyConverter.convert(field.getType(), props, propertyValue);
                            if(converted != null)
                                setField(field, obj, converted);
                        }
                        catch(Exception e) {
                            String name=obj instanceof Protocol? ((Protocol)obj).getName() : obj.getClass().getName();
View Full Code Here

        if(loopback_name == null)
            loopback_name="lo";

        Object tmp;
        try {
            tmp=conv.convert(null, List.class, "bela", loopback_name, false);
        }
        catch(Throwable t) {
            tmp=conv.convert(null, List.class, "bela", "lo0", false); // when running on Mac OS
        }
View Full Code Here

        Object tmp;
        try {
            tmp=conv.convert(null, List.class, "bela", loopback_name, false);
        }
        catch(Throwable t) {
            tmp=conv.convert(null, List.class, "bela", "lo0", false); // when running on Mac OS
        }

        Object str=conv.toString(tmp);
        System.out.println("str = " + str);
        assert str.equals(loopback_name) || str.equals("lo0");
View Full Code Here

    public static void testStringProperties() throws Exception {
        PropertyConverter c = new PropertyConverters.StringProperties();

        String value = "com.sun.security.sasl.digest.realm=MyRealm,qop=true";
        Map<String, String> map = (Map<String, String>) c.convert(null, Map.class, "props", value, false);
        assert map.size() == 2;
        assert map.get("qop").equals("true");
        assert map.get("com.sun.security.sasl.digest.realm").equals("MyRealm");
    }
View Full Code Here

                        throw new Exception("Could not find property converter for field " + propertyName
                                + " in " + name);
                    }
                    Object converted=null;
                    try {
                        converted=propertyConverter.convert(method.getParameterTypes()[0], props, prop);
                        method.invoke(obj, converted);
                    }
                    catch(Exception e) {
                        String name=obj instanceof Protocol? ((Protocol)obj).getName() : obj.getClass().getName();
                        throw new Exception("Could not assign property " + propertyName + " in "
View Full Code Here

                            throw new Exception("Could not find property converter for field " + propertyName
                                    + " in " + name);
                        }
                        Object converted=null;
                        try {
                            converted=propertyConverter.convert(field.getType(), props, propertyValue);
                            if(converted != null)
                                setField(field, obj, converted);
                        }
                        catch(Exception e) {
                            String name=obj instanceof Protocol? ((Protocol)obj).getName() : obj.getClass().getName();
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.