Package org.rhq.core.util

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


                }
            }
        }

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

        Properties dbProperties = serverPropertiesUpdater.loadExistingProperties();

        // when upgrading, mark the upgrade by stamping the new version
        if (isUpgrade && !noStamp) {
View Full Code Here


                jvmProps.load(new FileInputStream(cassandraJvmPropsFile));
                PropertiesFileUpdate propertiesUpdater = new PropertiesFileUpdate(
                    cassandraJvmPropsFile.getAbsolutePath());
                jvmProps.setProperty("jmx_port", Integer.toString(installerInfo.jmxPort));

                propertiesUpdater.update(jvmProps);

                deployer.updateStorageAuthConf(asSet(installerInfo.hostname));
            } else {
                File oldStorageAuthConfFile = new File(oldConfDir, "rhq-storage-auth.conf");
                File newStorageAuthConfFile = new File(newConfDir, "rhq-storage-auth.conf");
View Full Code Here

            if ((!isOpenJDK() || javaVersion.compareTo("1.6.0") > 0)
                || (javaVersion.equals("1.6.0") && getJavaPatchVersion() > 23)) {
                properties.put("java_agent", "-javaagent:$CASSANDRA_HOME/lib/jamm-0.2.5.jar");
            }

            propertiesUpdater.update(properties);
        } catch (IOException e) {
            log.error("An error occurred while updating " + jvmPropsFile, e);
            throw new DeploymentException("An error occurred while updating " + jvmPropsFile, e);
        }
    }
View Full Code Here

            wrapperEnvProps.setProperty("set.heap_dump_on_OOMError", "-XX:+HeapDumpOnOutOfMemoryError");
            // This is always set to the bin directory initially
            wrapperEnvProps.setProperty("set.heap_dump_dir", "-XX:HeapDumpPath="
                + useForwardSlash(new File(deployDir, "bin").getAbsolutePath()));

            propertiesUpdater.update(wrapperEnvProps);
        } catch (IOException e) {
            log.error("An error occurred while updating " + wrapperEnvFile, e);
            throw new DeploymentException("An error occurred while updating " + wrapperEnvFile, e);
        }
    }
View Full Code Here

        if (!props.containsKey(ServerProperties.PROP_LOG_LEVEL)) {
            props.setProperty(ServerProperties.PROP_LOG_LEVEL, "INFO");
            serverProperties.put(ServerProperties.PROP_LOG_LEVEL, "INFO");
        }

        propsFile.update(props);

        // we need to put them as system properties now so when we hot deploy,
        // the replacement variables in the config files pick up the new values
        for (Map.Entry<String, String> entry : serverProperties.entrySet()) {
            System.setProperty(entry.getKey(), entry.getValue());
View Full Code Here

            // When running itests-2, there is no server props file, so avoid logging a confusing exception
            return;
        }
        PropertiesFileUpdate updater = new PropertiesFileUpdate(getServerPropsFile().getAbsolutePath());
        try {
            updater.update(key, value);
        } catch (IOException e) {
            // TODO should we propagate the exception?
            LOG.warn("Failed to persist property " + key + " due to unexpected I/O error",
                ThrowableUtil.getRootCause(e));
        }
View Full Code Here

    private void persistServerProperty(String name, String value) {
        String filePath = getServerPropertiesFile().getAbsolutePath();
        PropertiesFileUpdate updater = new PropertiesFileUpdate(filePath);
        try {
            updater.update(name, value);
        } catch (IOException e) {
            String msgString = LOG.getMsgString(ServerI18NResourceKeys.SERVER_PROPERTY_SAVE_FAILED, name, value,
                filePath);
            throw new RuntimeException(msgString, e);
        }
View Full Code Here

        migrateRestrictedProperties(oldServerProps);

        // now merge the old settings in with the default properties from the new server install
        String newServerPropsFilePath = getServerPropertiesFile().getAbsolutePath();
        PropertiesFileUpdate newServerPropsFile = new PropertiesFileUpdate(newServerPropsFilePath);
        newServerPropsFile.update(oldServerProps);

        return;
    }

    /**
 
View Full Code Here

        }

        boolean userAlreadyExisted;
        try {
            PropertiesFileUpdate propsFileUpdate = new PropertiesFileUpdate(propertiesFile.getPath());
            userAlreadyExisted = propsFileUpdate.update(user, encryptedPassword);
        } catch (Exception e) {
            throw new RuntimeException("Failed to update management users properties file [" + propertiesFile + "].", e);
        }

        String verb = (userAlreadyExisted) ? "updated" : "added";
View Full Code Here

    }

    private void testSysProps(File propsFile1, File propsFile2, File jbossHome, CommandLineProducer commandLine)
        throws Exception {
        PropertiesFileUpdate propsFile1Updater = new PropertiesFileUpdate(propsFile1.getPath());
        propsFile1Updater.update("prop1", "delta");
        propsFile1Updater.update("prop4", "epsilon");

        PropertiesFileUpdate propsFile2Updater = new PropertiesFileUpdate(propsFile1.getPath());
        propsFile2Updater.update("prop2", "zeta");
        propsFile2Updater.update("prop5", "eta");
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.