Package org.jgroups.conf

Examples of org.jgroups.conf.XmlConfigurator


                Element cfg = (Element) tmp_config;
                tmp=cfg.getNodeName();
                if(!CONFIG.equals(tmp))
                    throw new IOException("invalid configuration: didn't find a \"" + CONFIG + "\" element under \"" + STACK + "\"");

                XmlConfigurator conf=XmlConfigurator.getInstance(cfg);
                // fixes http://jira.jboss.com/jira/browse/JGRP-290
                ConfiguratorFactory.substituteVariables(conf); // replace vars with system props
                String val=conf.getProtocolStackString();
                if(replace) {
                    stacks.put(st_name, val);
                    if(log.isTraceEnabled())
                        log.trace("added config '" + st_name + "'");
                }
View Full Code Here


            {
               throw new IOException("Invalid configuration: didn't find a \"" +
                     CONFIG + "\" element under \"" + STACK + "\"");
            }

            XmlConfigurator conf = XmlConfigurator.getInstance(cfg);
            // fixes http://jira.jboss.com/jira/browse/JGRP-290
            ConfiguratorFactory.substituteVariables(conf); // replace vars with system props

            result.put(st_name, new ProtocolStackConfigInfo(st_name, stack_descr, conf));
         }
View Full Code Here

    */
   public static String getClusterConfigFromFile(URL url)
   {
      try
      {
         XmlConfigurator conf = XmlConfigurator.getInstance(url);
         String tmp = conf.getProtocolStackString();
         // parse this string for ${} substitutions
         // Highly crappy approach!!
         tmp = tmp.replace("${jgroups.udp.mcast_addr:228.10.10.10}", "228.10.10.10");
         tmp = tmp.replace("${jgroups.udp.mcast_port:45588}", "45588");
         tmp = tmp.replace("${jgroups.udp.ip_ttl:2}", "2");
View Full Code Here

    */
   public static String getClusterConfigFromProperties(String properties)
   {
      try
      {
         XmlConfigurator conf = XmlConfigurator.getInstance(ConfiguratorFactory.getConfigStream(properties));
         String tmp = conf.getProtocolStackString();
         // parse this string for ${} substitutions
         // Highly crappy approach!!
         tmp = tmp.replace("${jgroups.udp.mcast_addr:228.10.10.10}", "228.10.10.10");
         tmp = tmp.replace("${jgroups.udp.mcast_port:45588}", "45588");
         tmp = tmp.replace("${jgroups.udp.ip_ttl:2}", "2");
View Full Code Here

                Element cfg = (Element) tmp_config;
                tmp=cfg.getNodeName();
                if(!CONFIG.equals(tmp))
                    throw new IOException("invalid configuration: didn't find a \"" + CONFIG + "\" element under \"" + STACK + "\"");

                XmlConfigurator conf=XmlConfigurator.getInstance(cfg);
                // fixes http://jira.jboss.com/jira/browse/JGRP-290
                ConfiguratorFactory.substituteVariables(conf); // replace vars with system props
                String val=conf.getProtocolStackString();
                if(replace) {
                    stacks.put(st_name, val);
                    if(log.isTraceEnabled())
                        log.trace("added config '" + st_name + "'");
                }
View Full Code Here


    public void testBasic() {
        try {
            InputStream default_config=Util.getResourceAsStream("udp.xml", this.getClass());
            XmlConfigurator conf=XmlConfigurator.getInstance(default_config);
            if(log.isDebugEnabled()) log.debug(conf.getProtocolStackString());
            assertTrue("Successfully parsed a valid XML configuration file.", true);
        }
        catch(Exception x) {
            fail(x.getMessage());
        }
View Full Code Here

    */
   public static String getClusterConfigFromProperties(String properties)
   {
      try
      {
         XmlConfigurator conf = XmlConfigurator.getInstance(ConfiguratorFactory.getConfigStream(properties));
         String tmp = conf.getProtocolStackString();
         // parse this string for ${} substitutions
         // Highly crappy approach!!
         tmp = tmp.replace("${jgroups.udp.mcast_addr:228.10.10.10}", "228.10.10.10");
         tmp = tmp.replace("${jgroups.udp.mcast_port:45588}", "45588");
         tmp = tmp.replace("${jgroups.udp.ip_ttl:2}", "2");
View Full Code Here

    */
   public static String getClusterConfigFromProperties(String properties)
   {
      try
      {
         XmlConfigurator conf = XmlConfigurator.getInstance(ConfiguratorFactory.getConfigStream(properties));
         String tmp = conf.getProtocolStackString();
         // parse this string for ${} substitutions
         // Highly crappy approach!!
         tmp = tmp.replace("${jgroups.udp.mcast_addr:228.10.10.10}", "228.10.10.10");
         tmp = tmp.replace("${jgroups.udp.mcast_port:45588}", "45588");
         tmp = tmp.replace("${jgroups.udp.ip_ttl:2}", "2");
View Full Code Here

                Element cfg = (Element) tmp_config;
                tmp=cfg.getNodeName();
                if(!CONFIG.equals(tmp))
                    throw new IOException("invalid configuration: didn't find a \"" + CONFIG + "\" element under \"" + STACK + "\"");

                XmlConfigurator conf=XmlConfigurator.getInstance(cfg);
                // fixes http://jira.jboss.com/jira/browse/JGRP-290
                ConfiguratorFactory.substituteVariables(conf); // replace vars with system props
                String val=conf.getProtocolStackString();
                if(replace) {
                    stacks.put(st_name, val);
                    if(log.isTraceEnabled())
                        log.trace("added config '" + st_name + "'");
                }
View Full Code Here

            {
               throw new IOException("Invalid configuration: didn't find a \"" +
                     CONFIG + "\" element under \"" + STACK + "\"");
            }

            XmlConfigurator conf = XmlConfigurator.getInstance(cfg);
            // fixes http://jira.jboss.com/jira/browse/JGRP-290
            ConfiguratorFactory.substituteVariables(conf); // replace vars with system props

            result.put(st_name, new ProtocolStackConfigInfo(st_name, stack_descr, conf));
         }
View Full Code Here

TOP

Related Classes of org.jgroups.conf.XmlConfigurator

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.