Package org.rhq.plugins.modcluster.config

Examples of org.rhq.plugins.modcluster.config.JBossWebServerFile


    public void TestJBossWebConfig() {
        try {
            URL testConfigURL = getClass().getResource("/xml_config/server.xml");
            File testFile = new File(testConfigURL.toURI());

            JBossWebServerFile config = new JBossWebServerFile(testFile);
            config.setPropertyValue("processStatusFrequency", "4");
            config.setPropertyValue("test", "5");
            config.setPropertyValue("test", "123");

            config.setPropertyValue("test", null);
            config.setPropertyValue("processStatusFrequency", null);

            config.saveConfigurationFile();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here


        // assume we succeed - we'll set to failure if we can't set all properties
        report.setStatus(ConfigurationUpdateStatus.SUCCESS);

        try {
            JBossWebServerFile jbossWebServerFile = getJBossWebServerFileInstance();

            for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
                PropertySimple property = report.getConfiguration().getSimple(key);
                if (property != null) {
                    try {
                        PropertyDefinitionSimple def = configurationDefinition.getPropertyDefinitionSimple(property
                            .getName());
                        if (!(ignoreReadOnly && def.isReadOnly())) {
                            jbossWebServerFile.setPropertyValue(property.getName(), property.getStringValue());
                        }
                    } catch (Exception e) {
                        property.setErrorMessage(ThrowableUtil.getStackAsString(e));
                        report.setErrorMessage("Failed setting resource configuration. " + e.getMessage());
                        log.info("Failure setting MBean Resource configuration value for " + key, e);
                    }
                }
            }

            jbossWebServerFile.saveConfigurationFile();
        } catch (Exception e) {
            report.setErrorMessage("Failed to save the resource configuration to file. " + e.getMessage());
            log.debug("Unable to save mod_cluster configuration file.", e);
        }
    }
View Full Code Here

        PropertySimple property = modClusterComponent.getResourceContext().getPluginConfiguration()
            .getSimple(MOD_CLUSTER_CONFIG_FILE);

        if (property != null) {
            String fileName = property.getStringValue();
            return new JBossWebServerFile(fileName);
        }

        return null;
    }
View Full Code Here

TOP

Related Classes of org.rhq.plugins.modcluster.config.JBossWebServerFile

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.