Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.MapConfiguration


public class WrappedServiceFactory
{
  public static Object createService(Map map)
  {
    Configuration localConf = new MapConfiguration(map);
    WrappedService service = new WrappedService();
    service.setLocalConfiguration(localConf);
    service.init();
    return service;
  }
View Full Code Here


    return service;
  }

  public static Object createServiceList(Map map, List<String> confFiles)
  {
    Configuration localConf = new MapConfiguration(map);
    WrappedService service = new WrappedService();
    service.setLocalConfiguration(localConf);
    service.setConfFilesList(confFiles);
    service.init();
    return service;
View Full Code Here

    return new WrappedJavaProcess();
  }

  public static WrappedProcess createProcess(Map map, boolean useSystemProperties)
  {
    Configuration localConf = new MapConfiguration(map);
    YajswConfiguration conf = new YajswConfigurationImpl(localConf, true);
    WrappedProcess process = createProcess(conf);
    process.setLocalConfiguration(localConf);
    process.setUseSystemProperties(useSystemProperties);
    process.init();
View Full Code Here

      return _service;
    prepareProperties();
    _service = new WrappedService();
    if (confFileList != null && confFileList.size() > 1)
      _service.setConfFilesList(confFileList);
    _service.setLocalConfiguration(new MapConfiguration(_properties));
    _service.init();
    return _service;
  }
View Full Code Here

   * Do reconnect.
   */
  private static void doReconnect()
  {
    prepareProperties();
    Configuration localConf = new MapConfiguration(_properties);
    YajswConfiguration conf = new YajswConfigurationImpl(localConf, true);
    WrappedProcess w = WrappedProcessFactory.createProcess(conf);

    System.out.println("************* RECONNECTING WRAPPER TO PID  " + pid + " ***********************");
    System.out.println();
 
View Full Code Here

        }
        else if (value instanceof Map)
        {
            // display a Map as a dictionary
            Map map = (Map) value;
            printValue(out, indentLevel, new MapConfiguration(map));
        }
        else if (value instanceof byte[])
        {
            String base64 = new String(Base64.encodeBase64((byte[]) value));
            out.println(padding + "<data>" + StringEscapeUtils.escapeXml(base64) + "</data>");
View Full Code Here

        }
        else if (value instanceof Map)
        {
            // display a Map as a dictionary
            Map map = (Map) value;
            printValue(out, indentLevel, new MapConfiguration(map));
        }
        else if (value instanceof byte[])
        {
            out.print("<" + new String(Hex.encodeHex((byte[]) value)) + ">");
        }
View Full Code Here

    /**
     * Test the modification of a configuration property stored internally as an array.
     */
    public void testSetArrayValue()
    {
        MapConfiguration configuration = new MapConfiguration(new HashMap());
        configuration.getMap().put("objectArray", new Object[] {"value1", "value2", "value3"});

        ConfigurationDynaBean bean = new ConfigurationDynaBean(configuration);

        bean.set("objectArray", 1, "New Value 1");
        Object value = bean.get("objectArray", 1);
View Full Code Here

*/
public class TestSubsetConfigurationEvents extends AbstractTestConfigurationEvents
{
    protected AbstractConfiguration createConfiguration()
    {
        return (SubsetConfiguration)new MapConfiguration(new HashMap()).subset("test");
    }
View Full Code Here

        }
        else if (value instanceof Map)
        {
            // display a Map as a dictionary
            Map map = (Map) value;
            printValue(out, indentLevel, new MapConfiguration(map));
        }
        else if (value instanceof byte[])
        {
            out.print("<" + new String(Hex.encodeHex((byte[]) value)) + ">");
        }
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration.MapConfiguration

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.