Examples of XmlConfiguration


Examples of org.apache.commons.configuration.XMLConfiguration

            protected String interpolate(String o)
            {
                return conf.interpolate(o);
            }
        });
        conf.addConfiguration(new XMLConfiguration(file)
        {
            protected String interpolate(String o)
            {
                return conf.interpolate(o);
            }
View Full Code Here

Examples of org.apache.commons.configuration.XMLConfiguration

            {
                port = getNextAvailable(port + 1);
            }
            _brokerPorts[i] = port;

            XMLConfiguration testConfiguration = new XMLConfiguration();
            testConfiguration.addProperty("management.enabled", "false");

            XMLConfiguration testVirtualhosts = new XMLConfiguration();
            String host = null;
            if (i == 1 || i == _brokerPorts.length - 1)
            {
                host = FAILOVER_VIRTUAL_HOST;
            }
            else
            {
                host = NON_FAILOVER_VIRTUAL_HOST;
            }
            testVirtualhosts.addProperty("virtualhost.name", host);
            testVirtualhosts.addProperty("virtualhost." + host + ".store.class", getTestProfileMessageStoreClassName());
            testVirtualhosts.addProperty(
                    "virtualhost." + host + ".store." + MessageStoreConstants.ENVIRONMENT_PATH_PROPERTY, "${QPID_WORK}/"
                            + host);

            startBroker(port, testConfiguration, testVirtualhosts);
            revertSystemProperties();
View Full Code Here

Examples of org.apache.commons.configuration.XMLConfiguration

     * Tests to watch a configuration file in a jar. In this case the jar file
     * itself should be monitored.
     */
    public void testFromJar() throws Exception
    {
        XMLConfiguration config = new XMLConfiguration();
        // use some jar: URL
        config.setURL(new URL("jar:" + new File("conf/resources.jar").getAbsoluteFile().toURL() + "!/test-jar.xml"));
        FileChangedReloadingStrategy strategy = new FileChangedReloadingStrategy();
        config.setReloadingStrategy(strategy);
        File file = strategy.getFile();
        assertNotNull("Strategy's file is null", file);
        assertEquals("Strategy does not monitor the jar file", "resources.jar", file.getName());
    }
View Full Code Here

Examples of org.apache.commons.configuration.XMLConfiguration

   
    FITS_XML = FITS_HOME+"xml"+File.separator;
    FITS_TOOLS = FITS_HOME+"tools"+File.separator;
   
    try {
      config = new XMLConfiguration(FITS_XML+"fits.xml");
    } catch (ConfigurationException e) {
      throw new FitsConfigurationException("Error reading "+FITS_XML+"fits.xml",e);
    }
    try {
      mapper = new FitsXmlMapper();
View Full Code Here

Examples of org.apache.commons.configuration.XMLConfiguration

public class ToolBelt {
 
  private List<Tool> tools;
 
  public ToolBelt(String configFile) throws FitsConfigurationException {
    XMLConfiguration config = null;
    try {
      config = new XMLConfiguration(configFile);
    } catch (ConfigurationException e) {
      throw new FitsConfigurationException("Error reading "+configFile,e);
    }
 
    tools = new ArrayList<Tool>();
   
    // get number of tools
    int size = config.getList("tools.tool[@class]").size();
    // for each tools get the class path and any excluded extensions
    for(int i=0;i<size;i++) {
      String tClass = config.getString("tools.tool("+i+")[@class]");
      @SuppressWarnings("unchecked")
      List<String> excludes = config.getList("tools.tool("+i+")[@exclude-exts]");
      @SuppressWarnings("unchecked")
      List<String> includes = config.getList("tools.tool("+i+")[@include-exts]");
      Tool t = null;
      try {
        Class c = Class.forName(tClass);
        t = (Tool)c.newInstance();
      }
View Full Code Here

Examples of org.apache.commons.configuration.XMLConfiguration

public class XsltTransformMap {
 
  public static Hashtable getMap(String config) throws FitsConfigurationException {
    Hashtable mappings = new Hashtable();
    XMLConfiguration conf = null;
    try {
      conf = new XMLConfiguration(config);
    } catch (ConfigurationException e) {
      throw new FitsConfigurationException("Error reading "+config+"fits.xml",e);
    }
   
    List fields = conf.configurationsAt("map");
    for(Iterator it = fields.iterator(); it.hasNext();)  {
        HierarchicalConfiguration sub = (HierarchicalConfiguration) it.next();
        // sub contains now all data about a single field
        String format = sub.getString("[@format]");
        String transform = sub.getString("[@transform]");
View Full Code Here

Examples of org.apache.commons.configuration.XMLConfiguration

    /**
     * Constructor.
     */
    public FoConfiguration()
    {
        this.config = new XMLConfiguration();

        // necessary because some attributes contain commas:
        config.setDelimiterParsingDisabled( true );

        loadDefaultConfig();
View Full Code Here

Examples of org.apache.commons.configuration.XMLConfiguration

        registry.remove( "listElements.listElement(1)" );
        registry.save();

       
       
        XMLConfiguration configuration = new XMLConfiguration( dest );
        assertEquals( Arrays.asList( new String[]{"1", "3"} ), configuration.getList( "listElements.listElement" ) );
       
        // file in ${basedir}/target/conf/shared.xml
        Registry section = this.registry.getSection( "org.apache.maven.shared.app.user" );
        section.setString( "foo", "zloug" );
        section.save();
       
        configuration = new XMLConfiguration( new File("target/conf/shared.xml") );
        assertNotNull( configuration.getString( "foo" ) );
       
    }
View Full Code Here

Examples of org.apache.commons.configuration.XMLConfiguration

        // Valid Configuration either has xml links to new files
        _finalConfig = new CompositeConfiguration(getConfig());
        List subFiles = getConfig().getList("xml[@fileName]");
        for (Object subFile : subFiles)
        {
            _finalConfig.addConfiguration(new XMLConfiguration((String) subFile));
        }

    }
View Full Code Here

Examples of org.apache.commons.configuration.XMLConfiguration

     * Tests to watch a configuration file in a jar. In this case the jar file
     * itself should be monitored.
     */
    public void testFromJar() throws Exception
    {
        XMLConfiguration config = new XMLConfiguration();
        // use some jar: URL
        config.setURL(new URL("jar:" + new File("conf/resources.jar").getAbsoluteFile().toURL() + "!/test-jar.xml"));
        FileChangedReloadingStrategy strategy = new FileChangedReloadingStrategy();
        config.setReloadingStrategy(strategy);
        File file = strategy.getFile();
        assertNotNull("Strategy's file is null", file);
        assertEquals("Strategy does not monitor the jar file", "resources.jar", file.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.