Package org.apache.commons.configuration2.reloading

Examples of org.apache.commons.configuration2.reloading.CombinedReloadingController


            InterruptedException
    {
        // populate the test combined configuration
        setUpSourceTest();
        XMLConfiguration xmlConf = new XMLConfiguration();
        new FileHandler(xmlConf).load(ConfigurationAssert
                .getTestFile("test.xml"));
        config.addConfiguration(xmlConf);
        PropertiesConfiguration propConf = new PropertiesConfiguration();
        new FileHandler(propConf).load(ConfigurationAssert
                .getTestFile("test.properties"));
        for (int i = 0; i < 8; i++)
        {
            config.addConfiguration(new BaseHierarchicalConfiguration());
        }
View Full Code Here


     * @return the URL of the include file or <b>null</b> if it cannot be
     *         resolved
     */
    private URL locateIncludeFile(String basePath, String fileName)
    {
        FileLocator includeLocator =
                FileLocatorUtils.fileLocator(locator).sourceURL(null)
                        .basePath(basePath).fileName(fileName).create();
        return FileLocatorUtils.locate(includeLocator);
    }
View Full Code Here

        for (ConfigurationBuilder<? extends Configuration> b : getChildBuilders())
        {
            obtainReloadingController(subControllers, b);
        }

        CombinedReloadingController ctrl =
                new CombinedReloadingController(subControllers);
        ctrl.resetInitialReloadingState();
        return ctrl;
    }
View Full Code Here

     * @return the newly created {@code ReloadingController}
     */
    private ReloadingController createReloadingController()
    {
        Set<ReloadingController> empty = Collections.emptySet();
        return new CombinedReloadingController(empty)
        {
            @Override
            public Collection<ReloadingController> getSubControllers()
            {
                Collection<FileBasedConfigurationBuilder<T>> builders =
View Full Code Here

                        new FileBasedConfigurationBuilder<XMLConfiguration>(
                                XMLConfiguration.class))
                .setDefinitionBuilderParameters(
                        new FileBasedBuilderParametersImpl().setFile(testFile)));
        builder.getConfiguration();
        CombinedReloadingController rc =
                (CombinedReloadingController) builder.getReloadingController();
        assertTrue("Got sub reloading controllers", rc.getSubControllers()
                .isEmpty());
    }
View Full Code Here

        ReloadingCombinedConfigurationBuilder confBuilder =
                builder.configure(new FileBasedBuilderParametersImpl()
                        .setFile(testFile));
        assertSame("Wrong configured builder instance", builder, confBuilder);
        builder.getConfiguration();
        CombinedReloadingController rc =
                (CombinedReloadingController) builder.getReloadingController();
        Collection<ReloadingController> subControllers = rc.getSubControllers();
        assertEquals("Wrong number of sub controllers", 1,
                subControllers.size());
        ReloadingController subctrl =
                ((ReloadingControllerSupport) builder.getDefinitionBuilder())
                        .getReloadingController();
View Full Code Here

        File testFile =
                ConfigurationAssert.getTestFile("testCCReloadingNested.xml");
        builder.configure(new FileBasedBuilderParametersImpl()
                .setFile(testFile));
        builder.getConfiguration();
        CombinedReloadingController rc =
                (CombinedReloadingController) builder.getReloadingController();
        Collection<ReloadingController> subControllers = rc.getSubControllers();
        assertEquals("Wrong number of sub controllers", 2,
                subControllers.size());
        ReloadingControllerSupport ccBuilder =
                (ReloadingControllerSupport) builder.getNamedBuilder("cc");
        assertTrue("Sub controller not found",
                subControllers.contains(ccBuilder.getReloadingController()));
        CombinedReloadingController rc2 =
                (CombinedReloadingController) ccBuilder
                        .getReloadingController();
        assertEquals("Wrong number of sub controllers (2)", 3, rc2
                .getSubControllers().size());
    }
View Full Code Here

            config.addConfiguration(new BaseHierarchicalConfiguration());
        }
        config.getConfiguration(0).addProperty(KEY_CONCURRENT, TEST_NAME);

        // Set a single synchronizer for all involved configurations
        Synchronizer sync = new ReadWriteSynchronizer();
        config.setSynchronizer(sync);
        for (Configuration c : config.getConfigurations())
        {
            c.setSynchronizer(sync);
        }
View Full Code Here

     * @since 2.0
     */
    @Override
    public final Synchronizer getSynchronizer()
    {
        Synchronizer sync = synchronizer;
        return (sync != null) ? sync : NoOpSynchronizer.INSTANCE;
    }
View Full Code Here

            config.addConfiguration(new BaseHierarchicalConfiguration());
        }
        config.getConfiguration(0).addProperty(KEY_CONCURRENT, TEST_NAME);

        // Set a single synchronizer for all involved configurations
        Synchronizer sync = new ReadWriteSynchronizer();
        config.setSynchronizer(sync);
        for (Configuration c : config.getConfigurations())
        {
            c.setSynchronizer(sync);
        }
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration2.reloading.CombinedReloadingController

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.