Examples of loadExistingProperties()


Examples of org.rhq.core.util.PropertiesFileUpdate.loadExistingProperties()

        }

        // update the properties file
        serverPropertiesUpdater.update(properties);

        Properties dbProperties = serverPropertiesUpdater.loadExistingProperties();

        // when upgrading, mark the upgrade by stamping the new version
        if (isUpgrade && !noStamp) {
            String version = StorageInstaller.class.getPackage().getImplementationVersion();
            stampStorageNodeVersion(dbProperties, installerInfo.hostname, version);
View Full Code Here

Examples of org.rhq.core.util.PropertiesFileUpdate.loadExistingProperties()

        File jvmPropsFile = new File(confDir, "cassandra-jvm.properties");
        try {
            log.info("Applying configuration changes to " + jvmPropsFile);

            PropertiesFileUpdate propertiesUpdater = new PropertiesFileUpdate(jvmPropsFile.getAbsolutePath());
            Properties properties = propertiesUpdater.loadExistingProperties();

            properties.setProperty("heap_min", "-Xms" + deploymentOptions.getHeapSize());
            properties.setProperty("heap_max", "-Xmx" + deploymentOptions.getHeapSize());
            properties.setProperty("heap_new", "-Xmn" + deploymentOptions.getHeapNewSize());
            properties.setProperty("thread_stack_size", "-Xss" + deploymentOptions.getStackSize());
View Full Code Here

Examples of org.rhq.core.util.PropertiesFileUpdate.loadExistingProperties()

        try {
            log.info("Applying configuration changes to " + wrapperEnvFile);

            PropertiesFileUpdate propertiesUpdater = new PropertiesFileUpdate(wrapperEnvFile.getAbsolutePath());
            Properties wrapperEnvProps = propertiesUpdater.loadExistingProperties();

            wrapperEnvProps.setProperty("set.heap_min", "-Xms" + deploymentOptions.getHeapSize());
            wrapperEnvProps.setProperty("set.heap_max", "-Xmx" + deploymentOptions.getHeapSize());
            wrapperEnvProps.setProperty("set.heap_new", "-Xmn" + deploymentOptions.getHeapNewSize());
            wrapperEnvProps.setProperty("set.thread_stack_size", "-Xss" + deploymentOptions.getStackSize());
View Full Code Here

Examples of org.rhq.core.util.PropertiesFileUpdate.loadExistingProperties()

        // Add the default admin user, or if for some reason this file does not exist, just log the issue
        if (mgmtUsers.exists()) {
            try {
                PropertiesFileUpdate mgmtUsersPropFile = new PropertiesFileUpdate(mgmtUsers.getAbsolutePath());
                Properties existingUsers = mgmtUsersPropFile.loadExistingProperties();
                if (existingUsers.containsKey(RHQ_MGMT_USER)) {
                    LOG.info("There is already a mgmt user named [" + RHQ_MGMT_USER + "], will not create another");
                    return;
                }
            } catch (Exception e) {
View Full Code Here

Examples of org.rhq.core.util.PropertiesFileUpdate.loadExistingProperties()

    @Override
    public HashMap<String, String> getServerProperties() throws Exception {
        final File serverPropertiesFile = getServerPropertiesFile();
        final PropertiesFileUpdate propsFile = new PropertiesFileUpdate(serverPropertiesFile.getAbsolutePath());
        final Properties props = propsFile.loadExistingProperties();

        // the default algorithm that RHQ will use in the comm layer will be defined at runtime based on the VM
        // but if the user mistakenly set the algorithm to the Sun value while using IBM JVM, then force
        // some hardcoded defaults so it can more likely work for IBM JVMs.
        final boolean isIBM = System.getProperty("java.vendor", "").contains("IBM");
View Full Code Here

Examples of org.rhq.core.util.PropertiesFileUpdate.loadExistingProperties()

        if (!serverPropertiesFile.isFile()) {
            throw new Exception("Properties file not found: [" + serverPropertiesFile.getAbsolutePath() + "]");
        }

        PropertiesFileUpdate pfu = new PropertiesFileUpdate(serverPropertiesFile);
        Properties props = pfu.loadExistingProperties();
        final HashMap<String, String> map = new HashMap<String, String>(props.size());
        for (Object property : props.keySet()) {
            map.put(property.toString(), props.getProperty(property.toString()));
        }
View Full Code Here

Examples of org.rhq.core.util.PropertiesFileUpdate.loadExistingProperties()

            }

            // Prompt for critical required values, if not yet set.
            try {
                PropertiesFileUpdate pfu = new PropertiesFileUpdate(serverPropertiesFile);
                Properties props = pfu.loadExistingProperties();

                promptForProperty(pfu, props, serverPropertiesFile.getName(),
                    ServerProperties.PROP_AUTOINSTALL_ADMIN_PASSWORD, false, true, true);
                promptForProperty(pfu, props, serverPropertiesFile.getName(), ServerProperties.PROP_DATABASE_PASSWORD,
                    true, false, true);
View Full Code Here

Examples of org.rhq.core.util.PropertiesFileUpdate.loadExistingProperties()

        }
    }

    private void updateCassandraJvmProps(Configuration newConfig) throws IOException {
        PropertiesFileUpdate propertiesUpdater = new PropertiesFileUpdate(jvmOptsFile.getAbsolutePath());
        Properties properties = propertiesUpdater.loadExistingProperties();

        String jmxPort = newConfig.getSimpleValue("jmxPort");
        if (!StringUtil.isEmpty(jmxPort)) {
            validateIntegerArg("jmx_port", jmxPort);
            properties.setProperty("jmx_port", jmxPort);
View Full Code Here

Examples of org.rhq.core.util.PropertiesFileUpdate.loadExistingProperties()

        }
    }

    private void updateWrapperEnv(Configuration config) throws IOException {
        PropertiesFileUpdate propertiesUpdater = new PropertiesFileUpdate(wrapperEnvFile.getAbsolutePath());
        Properties properties = propertiesUpdater.loadExistingProperties();

        String maxHeapSize = config.getSimpleValue("maxHeapSize");
        if (!StringUtil.isEmpty(maxHeapSize)) {
            validateHeapArg("maxHeapSize", maxHeapSize);
            // We want min and max heap to be the same
View Full Code Here

Examples of org.rhq.core.util.PropertiesFileUpdate.loadExistingProperties()

        deployer.updateStorageAuthConf(Sets.newHashSet("127.0.0.1", "127.0.0.2"));

        File confDir = new File(deploymentOptions.getBasedir(), "conf");
        File cassandraJvmPropsFile = new File(confDir, "cassandra-jvm.properties");
        PropertiesFileUpdate propertiesUpdater = new PropertiesFileUpdate(cassandraJvmPropsFile.getAbsolutePath());
        Properties properties = propertiesUpdater.loadExistingProperties();

        String jvmOpts = properties.getProperty("JVM_OPTS");
        jvmOpts = jvmOpts.substring(0, jvmOpts.lastIndexOf("\""));
        jvmOpts = jvmOpts + " -Dcassandra.ring_delay_ms=2000\"";
        properties.setProperty("JVM_OPTS", jvmOpts);
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.