Package org.apache.stratos.lb.common.conf

Examples of org.apache.stratos.lb.common.conf.LoadBalancerConfiguration$Configuration


    {
        HierarchicalConfiguration<?> declConfig = setUpConfig(reload);
        ConfigurationDeclaration decl = createDeclaration(declConfig);
        ConfigurationBuilder<? extends Configuration> builder =
                createProvider().getConfigurationBuilder(decl);
        Configuration config = builder.getConfiguration();
        assertEquals("Wrong configuration class",
                PropertiesConfiguration.class, config.getClass());
        PropertiesConfiguration pconfig = (PropertiesConfiguration) config;
        assertTrue("Wrong exception flag",
                pconfig.isThrowExceptionOnMissing());
        DefaultListDelimiterHandler listHandler =
                (DefaultListDelimiterHandler) pconfig.getListDelimiterHandler();
View Full Code Here


        else if (value instanceof Configuration)
        {
            // display a flat Configuration as a dictionary
            out.println(padding + "<dict>");

            Configuration config = (Configuration) value;
            Iterator<String> it = config.getKeys();
            while (it.hasNext())
            {
                // create a node for each property
                String key = it.next();
                ImmutableNode node =
                        new ImmutableNode.Builder().name(key)
                                .value(config.getProperty(key)).create();

                // print the node
                printNode(out, indentLevel + 1, node);

                if (it.hasNext())
View Full Code Here

        {
            // display a flat Configuration as a dictionary
            out.println();
            out.println(padding + "{");

            Configuration config = (Configuration) value;
            Iterator<String> it = config.getKeys();
            while (it.hasNext())
            {
                String key = it.next();
                ImmutableNode node =
                        new ImmutableNode.Builder().name(key)
                                .value(config.getProperty(key)).create();
                InMemoryNodeModel tempModel = new InMemoryNodeModel(node);
                printNode(out, indentLevel + 1, node, tempModel.getNodeHandler());
                out.println(";");
            }
            out.println(padding + "}");
View Full Code Here

        File outFile = ConfigurationAssert.getOutFile("save.properties");
        Parameters parameters = new Parameters();
        FileBasedConfigurationBuilder<PropertiesConfiguration> builder = new FileBasedConfigurationBuilder<PropertiesConfiguration>(
                PropertiesConfiguration.class, null, true).configure(parameters
                .properties().setFile(outFile));
        Configuration config = builder.getConfiguration();
        config.setProperty(PROP, 1);
        builder.save();
        checkSavedConfig(outFile, 1);
        assertTrue("Could not remove test file", outFile.delete());
    }
View Full Code Here

public class TestServletRequestConfiguration extends TestAbstractConfiguration
{
    @Override
    protected AbstractConfiguration getConfiguration()
    {
        final Configuration configuration = new BaseConfiguration();
        configuration.setProperty("key1", "value1");
        configuration.setProperty("key2", "value2");
        configuration.addProperty("list", "value1");
        configuration.addProperty("list", "value2");
        configuration.addProperty("listesc", "value1\\,value2");

        return createConfiguration(configuration);
    }
View Full Code Here

        BaseConfiguration config = new BaseConfiguration();
        config.addProperty(listKey, values);

        assertEquals("Wrong number of list elements", values.length, config.getList(listKey).size());

        Configuration c = createConfiguration(config);
        List<?> v = c.getList(listKey);

        assertEquals("Wrong number of elements in list", values.length, v.size());

        for (int i = 0; i < values.length; i++)
        {
View Full Code Here

        BasicConfigurationBuilder<? extends HierarchicalConfiguration<ImmutableNode>> defBuilder =
                createDefinitionBuilder(defConfig);
        builder.configure(new CombinedBuilderParametersImpl()
                .setDefinitionBuilder(defBuilder).setBasePath(
                        deepDir.getAbsolutePath()));
        Configuration config = builder.getConfiguration();
        assertEquals("Wrong property value", "somevalue",
                config.getString("somekey"));
    }
View Full Code Here

        File optionalFile =
                ConfigurationAssert
                        .getTestFile("testDigesterOptionalConfiguration.xml");
        builder.configure(createParameters()
                .setFile(optionalFile));
        Configuration config = builder.getConfiguration();
        assertTrue(config.getBoolean("test.boolean"));
        assertEquals("value", config.getProperty("element"));
    }
View Full Code Here

        builder.configure(createParameters()
                .setFile(testFile));
        CombinedConfiguration cc = builder.getConfiguration();
        assertTrue("Lookup not registered in CC", cc.getInterpolator()
                .getLookups().containsKey("test"));
        Configuration xmlConf = cc.getConfiguration("xml");
        assertTrue("Lookup not registered in sub config", xmlConf
                .getInterpolator().getLookups().containsKey("test"));
    }
View Full Code Here

    }

    @Override
    public void run() {
        // grab the lb configuration instance
        LoadBalancerConfiguration lbconfig = LoadBalancerConfiguration.getInstance();

        // FIXME Currently there has to be at least one dummy cluster defined in the loadbalancer
        // conf
        // in order to proper initialization of TribesClusteringAgent.
        generateGroupMgtAgents(lbconfig);

        // this thread should run for ever, untill terminated.
        while (true) {
            try {

                // grabs a message or waits till the queue is non-empty
                String message = sharedQueue.take();
//                ConfigHolder data = ConfigHolder.getInstance();

                // this message needs attention only if it's not same as the previous message and
                // not null of course.
//                if (data.getPreviousMsg() == null || !data.getPreviousMsg().equals(message)) {

                    // reset the previous message
//                    data.setPreviousMsg(message);

                    // build the nginx format of this message, and get the Node object
                    Node topologyNode = NodeBuilder.buildNode(message);

                    // reset service configurations
//                    lbconfig.resetData();
                    // create new service configurations
                    List<ServiceConfiguration> currentServiceConfigs = lbconfig.createServicesConfig(topologyNode);
                   
                    generateGroupMgtAgents(lbconfig);
                   
                    removeGroupMgtAgents(lbconfig, currentServiceConfigs);
View Full Code Here

TOP

Related Classes of org.apache.stratos.lb.common.conf.LoadBalancerConfiguration$Configuration

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.