[rhq] .classpath modules/enterprise
by Thomas Segismont
.classpath | 1
modules/enterprise/pom.xml | 2
modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml | 16
modules/enterprise/server/ear/pom.xml | 46
modules/enterprise/server/pom.xml | 1
modules/enterprise/server/sars/agent-sar/pom.xml | 200 -
modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapService.java | 795 -------
modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapServiceMBean.java | 230 --
modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentClassLoader.java | 87
modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent/log4j.xml | 65
modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-deployment-structure.xml | 12
modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-service.xml | 20
modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration-overrides.properties | 29
modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration.xml | 1062 ----------
modules/enterprise/server/sars/pom.xml | 50
15 files changed, 2616 deletions(-)
New commits:
commit aeb13c720a564a5b09fcb2ef6ae4c46ba39c37d2
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Mon Jul 1 16:51:48 2013 +0200
Agent SAR removed
diff --git a/.classpath b/.classpath
index d0646ed..f09f8ed 100644
--- a/.classpath
+++ b/.classpath
@@ -71,7 +71,6 @@
<classpathentry kind="src" path="modules/enterprise/remoting/client-api/src/main/java"/>
<classpathentry kind="src" path="modules/enterprise/remoting/cli/src/main/java"/>
<classpathentry kind="src" path="modules/enterprise/remoting/cli/src/test/java"/>
- <classpathentry kind="src" path="modules/enterprise/server/sars/agent-sar/src/main/java"/>
<classpathentry kind="src" path="modules/enterprise/server/safe-invoker/src/main/java"/>
<classpathentry kind="src" path="modules/enterprise/server/safe-invoker/src/test/java"/>
<classpathentry kind="src" path="modules/enterprise/server/startup-subsystem/src/main/java"/>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index ba70811..73352f5 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -33,7 +33,6 @@
<module>server/xml-schemas</module>
<module>server/jar</module>
<module>server/safe-invoker</module>
- <module>server/sars</module>
<module>remoting</module>
<module>gui</module>
<module>server/plugins</module>
@@ -64,7 +63,6 @@
<module>server/xml-schemas</module>
<module>server/jar</module>
<module>server/safe-invoker</module>
- <module>server/sars</module>
<module>binding</module>
<module>scripting</module>
<module>remoting</module>
diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
index d11e27b..32824e2 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
+++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
@@ -316,22 +316,6 @@
</delete>
<delete dir="${jboss.home}/bin/init.d" />
- <!--TODO - embedded agent isn't working now - we need to:
- 1) add AS7's jars jboss-as-[jmx,server]-7.x.x.Final.jar to META-INF/embedded-agent/lib
- 2) get the agent to successfully see that the server is started (AgentMain.waitForServer was hanging for me)
- So until we fix this we need to not deploy this at all.
- Note that I also took out the sysprops for embedded agent from rhq-server.properties.
- If we resurrect embedded agent, add this to the rhq-server.properties created down below:
- # Embedded RHQ Agent
- rhq.server.embedded-agent.enabled=false
- rhq.server.embedded-agent.name=
- rhq.server.embedded-agent.reset-configuration=true
- rhq.server.embedded-agent.disable-native-system=false
-
- <unjar src="${settings.localRepository}/org/rhq/rhq-enterprise-server-agent-sar/${rhq.version}/rhq-enterprise-server-agent-sar-${rhq.version}.sar"
- dest="....todo..../rhq-agent.sar" />
- -->
-
<echo>Delete docs, README, et. al. files</echo>
<delete dir="${jboss.home}/docs/examples" />
<delete>
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index 691d23c..0e4bc83 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -81,16 +81,6 @@
<type>war</type>
</dependency>
- <!-- ** SARs -->
- <!--
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-enterprise-server-agent-sar</artifactId>
- <version>${project.version}</version>
- <type>sar</type>
- </dependency>
- -->
-
<!-- ** JARs -->
<dependency>
<groupId>${project.groupId}</groupId>
@@ -257,22 +247,6 @@
<excluded>true</excluded>
</ejbClientModule>
- <!-- ** SARs -->
-
- <!-- AS7 allows for SARs embedded in an EAR without anything in application.xml -->
- <!-- see https://issues.jboss.org/browse/AS7-1248 -->
- <!-- The Maven ear plugin has a bug that causes SARs to be marked as <connector> modules -->
- <!-- and there is no way to tell it not to put the SAR in the application.xml so we have -->
- <!-- to do things with SARs separately using another maven plugin below -->
- <!--
- <sarModule>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-enterprise-server-agent-sar</artifactId>
- <bundleFileName>rhq-agent.sar</bundleFileName>
- <excluded>true</excluded>
- </sarModule>
- -->
-
<!-- ** JARs -->
<jarModule>
<groupId>org.rhq.helpers</groupId>
@@ -334,26 +308,6 @@
<artifactId>maven-dependency-plugin</artifactId>
<executions>
- <!--<execution>-->
- <!--<id>copy-sars</id>-->
- <!--<phase>process-resources</phase>-->
- <!--<goals>-->
- <!--<goal>copy</goal>-->
- <!--</goals>-->
- <!--<configuration>-->
- <!--<artifactItems>-->
- <!--<artifactItem>-->
- <!--<groupId>${project.groupId}</groupId>-->
- <!--<artifactId>rhq-enterprise-server-agent-sar</artifactId>-->
- <!--<version>${project.version}</version>-->
- <!--<type>sar</type>-->
- <!--</artifactItem>-->
- <!--</artifactItems>-->
- <!--<outputDirectory>${earDirectory}</outputDirectory>-->
- <!--<stripVersion>true</stripVersion>-->
- <!--</configuration>-->
- <!--</execution>-->
-
<execution>
<id>copy-core-agent-plugins</id>
<phase>process-resources</phase>
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index 725f18f..eb26cac 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -28,7 +28,6 @@
<module>server-metrics</module>
<module>data-migration</module>
<module>jar</module>
- <!--<module>sars</module>-->
<module>plugins</module>
<module>ear</module>
<module>startup-subsystem</module>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml
deleted file mode 100644
index 44bc647..0000000
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ /dev/null
@@ -1,200 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.7.0-SNAPSHOT</version>
- </parent>
-
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-agent-sar</artifactId>
- <packaging>jboss-sar</packaging>
-
- <name>RHQ Enterprise Server Embedded Agent SAR</name>
- <description>The SAR that allows the server to embed the agent</description>
-
- <properties>
- <sarDirectory>${project.build.directory}/${project.build.finalName}</sarDirectory>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-agent</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <!-- we want to explicitly include these (do not use scope=provided) -->
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <!-- make sure you match that which is used by standalone agent! -->
- </dependency>
-
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>rhq-agent</finalName>
- <plugins>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jboss-packaging-maven-plugin</artifactId>
- <version>1.9.99</version>
- <extensions>true</extensions> <!-- allows Maven to grok the jboss-sar packaging type -->
- <configuration>
- <libDirectory>${sarDirectory}/META-INF/embedded-agent/lib</libDirectory>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <!-- we are packaging the agent in isolation - but the sar needs the agent jar/core-util jars, put a copy in the lib directory -->
- <execution>
- <phase>package</phase>
- <configuration>
- <target>
- <echo>sarDirectory="${sarDirectory}"</echo>
- <echo>Putting some jars required by the embedded agent bootstrap service in the sar's classpath</echo>
- <!-- if you add jars in here, make sure you add them in jboss-deployment-structure.xml also -->
- <mkdir dir="${sarDirectory}/lib" />
- <copy file="${sarDirectory}/META-INF/embedded-agent/lib/rhq-enterprise-agent-${project.version}.jar" todir="${sarDirectory}/lib" />
- <copy file="${sarDirectory}/META-INF/embedded-agent/lib/rhq-enterprise-comm-${project.version}.jar" todir="${sarDirectory}/lib" />
- <copy file="${sarDirectory}/META-INF/embedded-agent/lib/rhq-core-comm-api-${project.version}.jar" todir="${sarDirectory}/lib" />
- <copy file="${sarDirectory}/META-INF/embedded-agent/lib/rhq-core-util-${project.version}.jar" todir="${sarDirectory}/lib" />
- <copy file="${sarDirectory}/META-INF/embedded-agent/lib/i18nlog-${i18nlog.version}.jar" todir="${sarDirectory}/lib" />
-
- <echo>Populating the sar with the native libraries found at ${settings.localRepository}/org/hyperic/sigar-dist/${sigar.version}/sigar-dist-${sigar.version}.zip</echo>
- <unzip dest="${sarDirectory}/META-INF/embedded-agent/lib">
- <fileset dir="${settings.localRepository}/org/hyperic/sigar-dist/${sigar.version}" includes="*.zip" />
- <patternset>
- <!-- <include name="**/lib/sigar.jar" /> already part of our dependencies -->
- <include name="**/lib/bcel*.jar" />
- <include name="**/lib/*.so" />
- <include name="**/lib/*.sl" />
- <include name="**/lib/*.dll" />
- <include name="**/lib/*.dylib" />
- </patternset>
- </unzip>
- <move todir="${sarDirectory}/META-INF/embedded-agent/lib" flatten="true">
- <fileset dir="${sarDirectory}/META-INF/embedded-agent/lib">
- <include name="**/lib/*" />
- </fileset>
- </move>
-
- <delete includeemptydirs="true">
- <fileset dir="${sarDirectory}/META-INF/embedded-agent/lib/" includes="hyperic-sigar*/**"/>
- </delete>
-
- <echo>Removing libraries that are either unused or in the RHQ Server's JBossAS endorsed dir</echo>
- <delete>
- <fileset dir="${sarDirectory}/META-INF/embedded-agent/lib">
- <include name="jdom*.jar" /> <!-- never needed; only for deprecated XML code for the license stuff -->
- </fileset>
- </delete>
-
- <!-- I can't figure out how to avoid this - should be able to bind to prepare-package but it isn't working -->
- <!-- so I have to re-package the sar after I added the lib -->
- <echo>Repackaging the sar...</echo>
- <delete file="${project.build.directory}/${project.build.finalName}.sar" />
- <jar destfile="${project.build.directory}/${project.build.finalName}.sar" basedir="${sarDirectory}" />
-<!--
- <echo>Creating the sar with the name rhq-agent.sar that should be deployed in the JBossAS server</echo>
- <move file="${project.build.directory}/${project.build.finalName}" tofile="${project.build.directory}/rhq-agent.sar" />
--->
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
-
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- </build>
-
- <profiles>
-
- <profile>
- <id>dev</id>
-
- <properties>
- <rhq.rootDir>../../../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.devContainerServerPath}</rhq.containerDir>
- <rhq.deploymentName>${project.build.finalName}.sar</rhq.deploymentName>
- <rhq.deploymentDir>${rhq.containerDir}/jbossas/standalone/deployments/${rhq.deploymentName}</rhq.deploymentDir>
- </properties>
-
- <build>
- <plugins>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
-
- <execution>
- <id>deploy</id>
- <phase>package</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Copying updated files from target${file.separator}classes${file.separator} to ${deployment.dir}${file.separator}...</echo>
- <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
- <fileset dir="target/rhq-agent" />
- </copy>
- <property name="deployment.descriptor.file" location="${deployment.dir}/META-INF/jboss-service.xml" />
- <echo>*** Touching ${deployment.descriptor.file} to force redeployment of ${rhq.deploymentName}...</echo>
- <touch file="${deployment.descriptor.file}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Deleting ${deployment.dir}${file.separator}...</echo>
- <delete dir="${deployment.dir}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
-
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
-
diff --git a/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapService.java b/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapService.java
deleted file mode 100644
index d39e05e..0000000
--- a/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapService.java
+++ /dev/null
@@ -1,795 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.server.agent;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.net.InetAddress;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Map;
-import java.util.Properties;
-import java.util.prefs.BackingStoreException;
-import java.util.prefs.InvalidPreferencesFormatException;
-import java.util.prefs.Preferences;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.rhq.core.util.StringPropertyReplacer;
-import org.rhq.core.util.stream.StreamUtil;
-import org.rhq.enterprise.agent.AgentConfiguration;
-import org.rhq.enterprise.agent.AgentConfigurationConstants;
-import org.rhq.enterprise.agent.AgentConfigurationUpgrade;
-
-/**
- * This is an MBean service that can be used to bootstrap a RHQ Agent that is embedded in a RHQ Server. This will create
- * a standalone classloader that will completely isolate the agent from any RHQ Server classloader (other than the
- * top-level system classloader). Note that this service MBean interface does not expose any agent-specific classes to
- * clients and it does not have direct access to any class outside of a select few classes found in the agent jar that
- * is in this service's classpath.
- *
- * <p>Note that because this service is deployed with the agent jars in it, you must deploy it in exploded form.</p>
- *
- * @author John Mazzitelli
- */
-public class EmbeddedAgentBootstrapService implements EmbeddedAgentBootstrapServiceMBean {
- private Log log = LogFactory.getLog(EmbeddedAgentBootstrapService.class);
-
- /**
- * The agent itself.
- */
- private Object agent = null;
-
- /**
- * The location of the configuration file - can be a file path or path within classloader.
- */
- private String configFile = "embedded-agent-configuration.xml";
-
- /**
- * The location of the configuration overrides properties file - can be a URL, file path or path within classloader.
- */
- private String overridesFile = null; // the jboss-service.xml service descriptor must set this
-
- /**
- * The preferences node name that identifies the configuration set used to configure the services.
- */
- private String preferencesNodeName;
-
- /**
- * Properties that will be used to override preferences found in the preferences node and the configuration
- * preferences file.
- */
- private Properties configurationOverrides = new Properties();
-
- /**
- * Arguments passed to the agent's main method.
- */
- private String[] arguments = null;
-
- /**
- * The location of the agent's resources, like jar files (jar files are located under the lib subdirectory).
- */
- private File embeddedAgentDirectory = null;
-
- /**
- * If <code>true</code>, this service will be told to start the agent immediately at startup by the RHQ Server.
- */
- private Boolean enabled = Boolean.FALSE;
-
- /**
- * If <code>true</code>, this bootstrap service will revert the agent's configuration back to the original
- * configuration file. Otherwise, the configuration will be that which is currently persisted in the preferences
- * store.
- */
- private Boolean resetConfigurationAtStartup = Boolean.FALSE;
-
- /**
- * This starts the agent in a completely isolated classloader in a completely isolated thread.
- *
- * @see EmbeddedAgentBootstrapServiceMBean#startAgent()
- */
- @Override
- public void startAgent() throws Exception {
- //-- if this method signature changes, you must also change StartupBean.startEmbeddedAgent
-
- if (!enabled.booleanValue()) {
- log.info("Will not start the embedded RHQ agent - it is disabled");
- return;
- }
-
- if ((agent == null) && (embeddedAgentDirectory != null)) {
- log.info("Starting the embedded RHQ Agent...");
-
- // we need to store the preferences prior to starting the agent
- if (resetConfigurationAtStartup.booleanValue()) {
- log.debug("Resetting the embedded agent's configuration back to its original factory settings");
- reloadAgentConfiguration();
- cleanDataDirectory();
- } else {
- log.debug("Loading the embedded agent's pre-existing configuration from preferences");
- prepareConfigurationPreferences();
- }
-
- // We need to build the agent's classloader so it is completely isolated.
- final URL[] jars = getEmbeddedAgentClasspath();
- final URL[] nativeDirs = getEmbeddedAgentNativeLibraryDirectories();
- final ClassLoader agentClassLoader = new EmbeddedAgentClassLoader(jars, nativeDirs);
-
- // we need to instantiate and start the agent in its own thread so it can have
- // a default context classloader that is our isolated classloader
- final Exception[] error = new Exception[1];
- final Object[] agentObject = new Object[1];
-
- Runnable agentRunnable = new Runnable() {
- public void run() {
- try {
- Class<?> agentClass = agentClassLoader.loadClass("org.rhq.enterprise.agent.AgentMain");
- Constructor<?> agentConstructor = agentClass.getConstructor(new Class[] { String[].class });
- Object agentInstance = agentConstructor
- .newInstance(new Object[] { getAgentArgumentsAsArray() });
-
- agentClass.getMethod("start", new Class[0]).invoke(agentInstance, new Object[0]);
-
- agentObject[0] = agentInstance;
- error[0] = null;
- } catch (Throwable t) {
- agentObject[0] = null;
- error[0] = new Exception("Cannot start the embedded agent. Cause: " + t, t);
- }
- }
- };
-
- // create our thread that starts the agent with the isolated class loader as its context
- Thread agentThread = new Thread(agentRunnable, "Embedded RHQ Agent Main");
- agentThread.setDaemon(true);
- agentThread.setContextClassLoader(agentClassLoader);
- agentThread.start();
- agentThread.join();
-
- // at this point in time, the embedded agent bootstrap thread has finished and
- // the agent should have been started
- if (error[0] != null) {
- log.error("Failed to start the embedded RHQ Agent. Cause: " + error[0]);
- throw error[0];
- }
-
- log.info("Embedded RHQ Agent has been started!");
- this.agent = agentObject[0];
- }
-
- return;
- }
-
- @Override
- public void stopAgent() throws Exception {
- if (agent != null) {
- log.info("Stopping the embedded RHQ Agent...");
-
- // all this funky threading/reflection is so we execute the command
- // in the isoloated context of the embedded agent
- final Exception[] error = new Exception[] { null };
- final Runnable agentRunnable = new Runnable() {
- public void run() {
- try {
- agent.getClass().getMethod("shutdown", new Class[0]).invoke(agent, new Object[0]);
- } catch (Throwable t) {
- error[0] = new Exception("Failed to stop the embedded RHQ Agent. Cause: " + t);
- }
- }
- };
-
- // create our thread that executes the agent command with the isolated class loader as its context
- Thread agentThread = new Thread(agentRunnable, "Embedded RHQ Agent Shutdown Request");
- agentThread.setDaemon(true);
- agentThread.setContextClassLoader(agent.getClass().getClassLoader());
- agentThread.start();
-
- try {
- agentThread.join();
- } catch (InterruptedException ignore) {
- }
-
- if (error[0] == null) {
- agent = null;
- log.info("Embedded RHQ Agent has been stopped!");
- } else {
- log.warn(error[0].toString());
- throw error[0];
- }
-
- return;
- }
- }
-
- public void start() throws Exception {
- return; // no-op
- }
-
- // this method is needed so the JBossAS server will call it when shutting down the service
- @Override
- public void stop() throws Exception {
- stopAgent();
- }
-
- @Override
- public boolean isAgentStarted() {
- return agent != null;
- }
-
- @Override
- public String getAgentEnabled() {
- //-- if this method signature changes, you must also change StartupBean.startEmbeddedAgent
- return enabled.toString();
- }
-
- @Override
- public void setAgentEnabled(String flag) {
- enabled = Boolean.valueOf(replaceProperties(flag));
- }
-
- @Override
- public String getResetConfiguration() {
- return resetConfigurationAtStartup.toString();
- }
-
- @Override
- public void setResetConfiguration(String flag) {
- resetConfigurationAtStartup = Boolean.valueOf(replaceProperties(flag));
- }
-
- @Override
- public String getEmbeddedAgentDirectory() {
- return embeddedAgentDirectory.getAbsolutePath();
- }
-
- @Override
- public void setEmbeddedAgentDirectory(String directoryStr) {
- File directory = null;
-
- if (directoryStr != null) {
- directoryStr = replaceProperties(directoryStr);
- directory = new File(directoryStr);
- }
-
- if (directory == null || !directory.exists() || !directory.isDirectory()) {
- enabled = Boolean.FALSE;
- directory = null;
- log.warn("Invalid embedded agent directory specified - embedded agent has been disabled: " + directory);
- }
-
- embeddedAgentDirectory = directory;
- }
-
- @Override
- public String getConfigurationFile() {
- return configFile;
- }
-
- @Override
- public void setConfigurationFile(String location) {
- configFile = replaceProperties(replaceProperties(location));
- }
-
- @Override
- public String getPreferencesNodeName() {
- return preferencesNodeName;
- }
-
- @Override
- public void setPreferencesNodeName(String node) {
- if (node != null) {
- node = replaceProperties(node);
- }
-
- if (node == null || node.trim().length() == 0) {
- try {
- node = InetAddress.getLocalHost().getCanonicalHostName();
- } catch (UnknownHostException e) {
- node = "${jboss.bind.address}";
- }
- node = node + "-embedded";
- }
- preferencesNodeName = replaceProperties(node);
- System.setProperty("rhq.server.embedded-agent.preferences-node", preferencesNodeName);
- }
-
- @Override
- public Properties getConfigurationOverrides() {
- //-- if this method signature changes, you must also change StartupBean.startEmbeddedAgent
- return configurationOverrides;
- }
-
- @Override
- public void setConfigurationOverrides(Properties overrides) {
- //-- if this method signature changes, you must also change StartupBean.startEmbeddedAgent
-
- if (overrides == null) {
- return; // do nothing
- }
-
- for (String propName : overrides.stringPropertyNames()) {
- String origValue = overrides.getProperty(propName);
- String newValue = replaceProperties(origValue);
- overrides.setProperty(propName, newValue);
- }
-
- configurationOverrides.clear();
- configurationOverrides.putAll(overrides);
-
- // perform some checking to setup defaults if need be
-
- String agent_name = configurationOverrides.getProperty("rhq.agent.name", "");
- if (agent_name.trim().length() == 0 || "-".equals(agent_name)) {
- // the rhq.server.embedded-agent.name was not specified or left blank,
- // that is the system propery used to define the rhq.agent.name - so let's create our own name
- try {
- agent_name = InetAddress.getLocalHost().getCanonicalHostName();
- } catch (UnknownHostException e) {
- agent_name = "${jboss.bind.address}";
- }
- agent_name = agent_name + "-embedded";
- agent_name = replaceProperties(agent_name);
- configurationOverrides.put("rhq.agent.name", agent_name);
- }
-
- return;
- }
-
- @Override
- public String getAgentArguments() {
- // this only returns a human readable string - to use the args, use getAgentArgumentsAsArray instead
- String[] allArgs = getAgentArgumentsAsArray();
- return Arrays.toString(allArgs);
- }
-
- // we want to use this because it adds some required args
- private String[] getAgentArgumentsAsArray() {
- ArrayList<String> args = new ArrayList<String>();
-
- if (arguments != null) {
- for (String argument : arguments) {
- String realArg = replaceProperties(argument);
- args.add(realArg);
- }
- }
-
- args.add("--pref=" + getPreferencesNodeName());
-
- return args.toArray(new String[args.size()]);
- }
-
- @Override
- public void setAgentArguments(String args) {
- if (args != null) {
- arguments = args.split(",");
- } else {
- arguments = new String[0];
- }
- }
-
- @Override
- public void reloadAgentConfiguration() throws Exception {
- getPreferencesNode().clear();
-
- prepareConfigurationPreferences();
- }
-
- @Override
- public void cleanDataDirectory() {
- AgentConfiguration config = new AgentConfiguration(getPreferencesNode());
- File data_dir = config.getDataDirectory();
-
- cleanDataFile(data_dir);
-
- // it is conceivable the comm services data directory was configured in a different
- // place than where the agent's data directory is - make sure we clean out that other data dir
- File comm_data_dir = config.getServiceContainerPreferences().getDataDirectory();
- if (!comm_data_dir.getAbsolutePath().equals(data_dir.getAbsolutePath())) {
- cleanDataFile(comm_data_dir);
- }
-
- return;
- }
-
- @Override
- public Properties getAgentConfiguration() {
- try {
- Properties properties = new Properties();
- Preferences prefs = getPreferencesNode();
-
- for (String key : prefs.keys()) {
- properties.setProperty(key, prefs.get(key, "?"));
- }
-
- return properties;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void executeAgentPromptCommand(final String command) {
- // all this funky threading/reflection is so we execute the command
- // in the isoloated context of the embedded agent
- final Exception[] error = new Exception[] { null };
- final Runnable agentRunnable = new Runnable() {
- public void run() {
- try {
- Class<?> agentClass = agent.getClass();
- Method agentMethod = agentClass.getMethod("executePromptCommand", new Class[] { String.class });
-
- agentMethod.invoke(agent, new Object[] { command });
- } catch (Throwable t) {
- error[0] = new Exception("Cannot execute embedded agent prompt command [" + command + "]. Cause: "
- + t);
- }
- }
- };
-
- // create our thread that executes the agent command with the isolated class loader as its context
- Thread agentThread = new Thread(agentRunnable, "Embedded RHQ Agent Prompt Command");
- agentThread.setDaemon(true);
- agentThread.setContextClassLoader(agent.getClass().getClassLoader());
- agentThread.start();
-
- try {
- agentThread.join();
- if (error[0] == null) {
- log.info("Embedded agent executed the command [" + command
- + "] - see the embedded agent output file for the results");
- } else {
- log.warn(error[0].toString());
- }
- } catch (InterruptedException ignore) {
- }
-
- return;
- }
-
- @Override
- public String getConfigurationOverridesFile() {
- return overridesFile;
- }
-
- @Override
- public void setConfigurationOverridesFile(String location) {
- if (location == null) {
- overridesFile = null;
- } else {
- // substitute ${} replacement variables found in the location string
- overridesFile = replaceProperties(location);
- try {
- loadConfigurationOverridesFromFile();
- } catch (Exception e) {
- log.warn("Cannot load embedded agent config overrides file [" + overridesFile + "]", e);
- }
- }
- }
-
- private void loadConfigurationOverridesFromFile() throws Exception {
- if (overridesFile == null) {
- return; // nothing to do
- }
-
- InputStream is = getFileInputStream(overridesFile);
- try {
- Properties props = new Properties();
- props.load(is);
- setConfigurationOverrides(props);
- } finally {
- is.close(); // if we got here, "is" will never be null
- }
-
- return;
- }
-
- /**
- * Loads a file either from file system, from URL or from classloader. If file
- * can't be found, exception is thrown.
- * @param file_name the file whose input stream is to be returned
- * @return input stream of the file - will never be null
- * @throws IOException if the file input stream cannot be obtained
- */
- private InputStream getFileInputStream(String file_name) throws IOException {
- // first see if the file was specified as a path on the local file system
- InputStream config_file_input_stream = null;
- try {
- File config_file = new File(file_name);
-
- if (config_file.exists()) {
- config_file_input_stream = new FileInputStream(config_file);
- }
- } catch (Exception e) {
- // isn't really an error - this just isn't a file on the local file system
- }
-
- // see if the file was specified as a URL
- if (config_file_input_stream == null) {
- try {
- URL config_file = new URL(file_name);
-
- config_file_input_stream = config_file.openStream();
- } catch (Exception e) {
- // isn't really an error - this just isn't a URL
- }
- }
-
- // if neither a file path or URL, assume the config file can be found in the classloader
- if (config_file_input_stream == null) {
- config_file_input_stream = this.getClass().getClassLoader().getResourceAsStream(file_name);
- }
-
- if (config_file_input_stream == null) {
- throw new IOException("Cannot find config file for embedded agent: " + file_name);
- }
- return config_file_input_stream;
- }
-
- /**
- * This will return URLs to all of the jars and resources that the embedded agent will have access to in its
- * isolated classloader. Only those classes within these jars will be accessible to the embedded agent. Even classes
- * that are in this bootstrap service are not going to be available to it.
- *
- * @return URLs to embedded agent jars that will be in the embedded agent's classloader
- *
- * @throws Exception if failed to find the jars
- */
- private URL[] getEmbeddedAgentClasspath() throws Exception {
- File lib = new File(embeddedAgentDirectory, "lib");
-
- if (!lib.exists() || !lib.isDirectory()) {
- throw new Exception("There is no lib directory under [" + embeddedAgentDirectory
- + "]; cannot get agent jars");
- }
-
- File[] jarFiles = lib.listFiles();
- ArrayList<URL> classpathUrls = new ArrayList<URL>(jarFiles.length + 1);
-
- classpathUrls.add(embeddedAgentDirectory.toURI().toURL()); // allows the agent to find resourcees in here, like log4j.xml
-
- for (File jarFile : jarFiles) {
- classpathUrls.add(jarFile.toURI().toURL());
- }
-
- // we need jboss-modules.jar because in AS7 it is used to override JAXP impl classes and we can't not use it
- URL jbossModules = null;
- String cp = System.getProperty("java.class.path");
- if (cp != null && cp.contains("jboss-modules.jar")) {
- for (String cpPath : cp.split(File.pathSeparator)) {
- if (cpPath.contains("jboss-modules.jar")) {
- jbossModules = new File(cpPath).toURI().toURL();
- classpathUrls.add(jbossModules);
- break;
- }
- }
- }
-
- if (jbossModules == null) {
- File rootLocation = new File(System.getProperty("jboss.home.dir"), "jboss-modules.jar");
- if (rootLocation.exists()) {
- jbossModules = rootLocation.toURI().toURL();
- classpathUrls.add(jbossModules);
- } else {
- throw new IllegalStateException(
- "Cannot find jboss-modules.jar - it is necessary for embedded agent to run.");
- }
- }
- return classpathUrls.toArray(new URL[classpathUrls.size()]);
- }
-
- /**
- * Returns URLs to all directories where the agent's native libraries can be found.
- *
- * @return URLs where native libraries can be found
- *
- * @throws Exception if failed to find the native library directories
- */
- private URL[] getEmbeddedAgentNativeLibraryDirectories() throws Exception {
- ArrayList<URL> nativeLibraryDirUrls = new ArrayList<URL>();
-
- // we will assume our native libraries are under the same lib directory where the jars are
- // we will also look for native libraries in subdirectories under lib
- File lib = new File(embeddedAgentDirectory, "lib");
-
- if (!lib.exists() || !lib.isDirectory()) {
- throw new Exception("There is no lib directory under [" + embeddedAgentDirectory
- + "]; cannot get native library directories");
- }
-
- addDirectories(lib, nativeLibraryDirUrls);
-
- return nativeLibraryDirUrls.toArray(new URL[nativeLibraryDirUrls.size()]);
- }
-
- private void addDirectories(File dir, ArrayList<URL> list) throws Exception {
- if (dir.isDirectory()) {
- // add the given directory to the list and add all its subdirectories to the list
- list.add(dir.toURI().toURL());
-
- for (File dirEntry : dir.listFiles()) {
- addDirectories(dirEntry, list);
- }
- }
-
- return;
- }
-
- /**
- * This will ensure the agent's configuration preferences are populated. If need be, the configuration file is
- * loaded and all overrides are overlaid on top of the preferences. The preferences are also upgraded to ensure they
- * conform to the latest configuration schema version.
- *
- * @return the agent configuration
- *
- * @throws Exception
- */
- private AgentConfiguration prepareConfigurationPreferences() throws Exception {
- Preferences preferences_node = getPreferencesNode();
- AgentConfiguration config = new AgentConfiguration(preferences_node);
-
- if (config.getAgentConfigurationVersion() == 0) {
- config = loadConfigurationFile();
- }
-
- // now that the configuration preferences are loaded, we need to override them with any bootstrap override properties
- Properties overrides = getConfigurationOverrides();
- if (overrides != null) {
- for (Map.Entry<Object, Object> entry : overrides.entrySet()) {
- String key = entry.getKey().toString();
- String value = entry.getValue().toString();
-
- // allow ${var} notation in the values so we can provide variable replacements in the values
- value = replaceProperties(value);
-
- preferences_node.put(key, value);
- }
- }
-
- // let's make sure our configuration is upgraded to the latest schema
- AgentConfigurationUpgrade.upgradeToLatest(config.getPreferences());
-
- return config;
- }
-
- /**
- * Loads the {@link #getConfigurationFile() configuration file}. The file location will first be checked for
- * existence on the file system and then as a URL. If it cannot be found, it will be assumed the file location
- * specifies the file as found in the current class loader and the file will be searched there. An exception is
- * thrown if the file cannot be found anywhere.
- *
- * @return the configuration that was loaded
- *
- * @throws IOException if failed to load the configuration file
- * @throws InvalidPreferencesFormatException if the configuration file had an invalid format
- * @throws BackingStoreException if failed to access the preferences persistence store
- * @throws Exception on other failures
- */
- private AgentConfiguration loadConfigurationFile() throws Exception {
- String file_name = getConfigurationFile();
- String preferences_node_name = getPreferencesNodeName();
-
- InputStream config_file_input_stream = getFileInputStream(file_name);
-
- // We need to clear out any previous configuration in case the current config file doesn't specify a preference
- // that already exists in the preferences node. In this case, the configuration file wants to fall back on the
- // default value and if we don't clear the preferences, we aren't guaranteed the value stored in the backing
- // store is the default value.
- // But first we need to backup these original preferences in case the config file fails to load -
- // we'll restore the original values in that case.
-
- try {
- Preferences preferences_node = getPreferencesNode();
- ByteArrayOutputStream backup = new ByteArrayOutputStream();
- preferences_node.exportSubtree(backup);
- preferences_node.clear();
-
- // now load in the preferences
- try {
- ByteArrayOutputStream raw_config_file = new ByteArrayOutputStream();
- StreamUtil.copy(config_file_input_stream, raw_config_file, true);
- String new_config = replaceProperties(raw_config_file.toString());
- ByteArrayInputStream new_config_input_stream = new ByteArrayInputStream(new_config.getBytes());
- Preferences.importPreferences(new_config_input_stream);
-
- if (new AgentConfiguration(preferences_node).getAgentConfigurationVersion() == 0) {
- throw new IllegalArgumentException("Bad node name: " + preferences_node_name);
- }
- } catch (Exception e) {
- // a problem occurred importing the config file; let's restore our original values
- try {
- Preferences.importPreferences(new ByteArrayInputStream(backup.toByteArray()));
- } catch (Exception e1) {
- // its conceivable the same problem occurred here as with the original exception (backing store problem?)
- // let's throw the original exception, not this one
- }
-
- throw e;
- }
-
- AgentConfiguration agent_configuration = new AgentConfiguration(preferences_node);
-
- return agent_configuration;
- } finally {
- // we know this is not null; if it was, we would have thrown the IOException earlier.
- config_file_input_stream.close();
- }
- }
-
- /**
- * Returns the preferences for this agent. The node returned is where all preferences are to be stored.
- *
- * @return the agent preferences
- */
- private Preferences getPreferencesNode() {
- Preferences top_node = Preferences.userRoot().node(AgentConfigurationConstants.PREFERENCE_NODE_PARENT);
- Preferences preferences_node = top_node.node(getPreferencesNodeName());
-
- return preferences_node;
- }
-
- /**
- * This will delete the given file and if its a directory, will recursively delete its contents and its
- * subdirectories.
- *
- * @param file the file/directory to delete
- */
- private void cleanDataFile(File file) {
- boolean deleted;
-
- File[] doomed_files = file.listFiles();
- if (doomed_files != null) {
- for (File doomed_file : doomed_files) {
- cleanDataFile(doomed_file); // call this method recursively
- }
- }
-
- deleted = file.delete();
-
- if (!deleted) {
- log.warn("Cannot clean data file [" + file + "]");
- }
-
- return;
- }
-
- private String replaceProperties(String str) {
- if (str == null) {
- return null;
- }
-
- // keep replacing properties until no more ${} tokens are left that are replaceable
- String newValue = "";
- String oldValue = str;
- while (!newValue.equals(oldValue)) {
- oldValue = str;
- newValue = StringPropertyReplacer.replaceProperties(str);
- str = newValue;
- }
- return newValue;
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapServiceMBean.java b/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapServiceMBean.java
deleted file mode 100644
index 0adeb17..0000000
--- a/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentBootstrapServiceMBean.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.server.agent;
-
-import java.util.Properties;
-
-/**
- * The interface to the MBean that embeds a JON Agent in the JON Server.
- *
- * @author John Mazzitelli
- */
-public interface EmbeddedAgentBootstrapServiceMBean {
- /**
- * The object name that the MBean service will be registered under.
- */
- String OBJECT_NAME = "rhq:service=EmbeddedAgentBootstrap";
-
- /**
- * If <code>true</code>, this indicates that the agent should be started when the JON Server is started. This
- * service is will not start the agent at its own startup, regardless of the value of this attribute. Instead, this
- * attribute is examined by the JON Server itself - if the JON Server sees that the embedded agent should be started
- * at startup, the JON Server will call {@link #startAgent()}.
- *
- * @return enabled flag, boolean string
- */
- String getAgentEnabled();
-
- /**
- * If <code>true</code>, this indicates that the agent should be started when the JON Server is started. This
- * service is will not start the agent at its own startup, regardless of the value of this attribute. Instead, this
- * attribute is examined by the JON Server itself - if the JON Server sees that the embedded agent should be started
- * at startup, the JON Server will call {@link #startAgent()}.
- *
- * @param enabled (a boolean string)
- */
- void setAgentEnabled(String enabled);
-
- /**
- * Returns <code>true</code> if the embedded agent should reset its configuration at startup. Resetting the
- * configuration means to clear out any configuration settings currently persisted in the preferences store and
- * reload the configuration from its configuration file. If <code>false</code>, the embedded agent will retain the
- * configuration it had when it last was running - which may be different from its original configuration if a user
- * changed its configuration settings from the UI.
- *
- * @return reset configuration flag, as a String
- */
- String getResetConfiguration();
-
- /**
- * Sets the flag to determine if the agent should reset its configuration to its original configuration as defined
- * in the configuration file, or if it should retain its configuration from when it last ran. See
- * {@link #getResetConfiguration()} for more information.
- *
- * @param reset
- */
- void setResetConfiguration(String reset);
-
- /**
- * Indicates the location where the embedded agent and all its resources will be found. There must be a <code>
- * lib</code> subdirectory under this directory which will include all jar files that are to be included in the
- * embedded agent's classloader.
- *
- * @return location of the embedded agent and its resources
- */
- String getEmbeddedAgentDirectory();
-
- /**
- * Indicates the location where the embedded agent and all its resources will be found. There must be a <code>
- * lib</code> subdirectory under this directory which will include all jar files that are to be included in the
- * embedded agent's classloader.
- *
- * @param directory location of the embedded agent and its resources
- */
- void setEmbeddedAgentDirectory(String directory);
-
- /**
- * Returns the location of the configuration file where all agent preferences are defined. The file location can be
- * either a URL, a local file system path or a path within this service's classloader.
- *
- * @return configuration file location
- */
- String getConfigurationFile();
-
- /**
- * Defines the location of the configuration file where all agent preferences are defined.
- *
- * @param location
- */
- void setConfigurationFile(String location);
-
- /**
- * Returns the preferences node name used to identify the configuration set to use. See the Java Preferences API for
- * the definition of a preference node name.
- *
- * @return the name of the Java Preferences node where the agent's configuration lives
- */
- String getPreferencesNodeName();
-
- /**
- * Defines the preferences node name used to identify the configuration set to use. See the Java Preferences API for
- * the definition of a preference node name.
- *
- * <p>If this isn't specified, a suitable default will be used.</p>
- *
- * @param node the name of the Java Preferences node where the agent's configuration will or already lives
- */
- void setPreferencesNodeName(String node);
-
- /**
- * Returns a set of properties that will override the configuration preferences. If this returns <code>null</code>,
- * then the configuration preferences takes effect as-is.
- *
- * @return configuration setting overrides (may be <code>null</code>)
- */
- Properties getConfigurationOverrides();
-
- /**
- * This allows you to explicitly override configuration preferences found in the configuration file. If this isn't
- * set, then the settings specified by the configuration preferences file take effect as-is. These overrides can be
- * set in the bootstrap deployment file (and thus allow you to be able to use any app-server specific settings, like
- * <code>${jboss.server.data.dir}</code>, in the configuration preference values).
- *
- * @param overrides configuration settings that override the configuration preferences (may be<code>null</code>)
- */
- void setConfigurationOverrides(Properties overrides);
-
- /**
- * This allows you to explicitly override configuration preferences found in the configuration file. If this isn't
- * set, then the settings specified by the configuration preferences file take effect as-is. If this is set,
- * this file is a properties file whose values will override the config file prefs.
- *
- * @param overrides configuration settings file that override the configuration preferences (may be<code>null</code>)
- */
- void setConfigurationOverridesFile(String overridesFile);
-
- String getConfigurationOverridesFile();
-
- /**
- * Returns the arguments that are passed to the agent's main startup method.
- *
- * @return agent arguments
- */
- String getAgentArguments();
-
- /**
- * Sets the arguments that will be passed to the agent's main startup method.
- *
- * @param args
- */
- void setAgentArguments(String args);
-
- /**
- * This will clear any and all current configuration preferences and then reload the
- * {@link #getConfigurationFile() configuration file}. The agent will need to be restarted for the configuration to
- * take effect.
- *
- * @throws Exception if failed to clear and reload the configuration
- */
- void reloadAgentConfiguration() throws Exception;
-
- /**
- * This will clean out the embedded agent's data directory. You usually invoke if you want to start the agent in a
- * clean state (i.e. use this in conjunction with {@link #reloadAgentConfiguration()}).
- */
- void cleanDataDirectory();
-
- /**
- * Returns the configuration preferencese the agent is or will be using.
- *
- * @return the server configuration, as a set of properties
- */
- Properties getAgentConfiguration();
-
- /**
- * Passes the given prompt command to the agent so it can be executed. Note that if the command requires additional
- * input, the embedded agent must have a valid input stream (System.in) or the command will fail. This means the JON
- * Server must be running in a console that can have keyboard input in order to execute those prompt commands that
- * ask for additional input from the user.
- *
- * @param command the agent prompt command to execute
- */
- void executeAgentPromptCommand(String command);
-
- /**
- * <code>true</code> indicates that the agent has been {@link #startAgent() started}. <code>false</code> means the
- * agent has not been started yet, or it was started but has since been {@link #stopAgent() stopped}.
- *
- * @return state of the agent
- */
- boolean isAgentStarted();
-
- /**
- * Starts the agent. Note that this will not start the agent if {@link #getAgentEnabled() the agent is not enabled}.
- *
- * @throws Exception if failed to start the agent successfully
- */
- void startAgent() throws Exception;
-
- /**
- * Stops the agent. Note that this will do nothing if {@link #getAgentEnabled() the agent is not enabled} or was
- * never {@link #startAgent() started}.
- *
- * @throws Exception if failed to stop the agent successfully
- */
- void stopAgent() throws Exception;
-
- /**
- * Stops this service - if the agent has been {@link #startAgent() started}, it will also be
- * {@link #stopAgent() stopped}.
- *
- * @throws Exception if failed to stop the agent
- */
- void stop() throws Exception;
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentClassLoader.java b/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentClassLoader.java
deleted file mode 100644
index affbdee..0000000
--- a/modules/enterprise/server/sars/agent-sar/src/main/java/org/rhq/enterprise/server/agent/EmbeddedAgentClassLoader.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.server.agent;
-
-import java.io.File;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLClassLoader;
-
-/**
- * This is the classloader used by the embedded JON Agent. This class loader is absolutely and completely isolated from
- * any other classloader in the system except for the top-most system classloader. There is no application server
- * classes or loaders accessible to this class loader.
- *
- * @author John Mazzitelli
- */
-public class EmbeddedAgentClassLoader extends URLClassLoader {
- private final URL[] nativeLibraryUrls;
-
- public EmbeddedAgentClassLoader(URL[] classUrls, URL[] nativeUrls) {
- super(classUrls, getTopMostClassLoader());
- nativeLibraryUrls = (nativeUrls != null) ? nativeUrls : new URL[0];
- }
-
- @Override
- public Class<?> loadClass(String name) throws ClassNotFoundException {
- // attempt to workaround http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6434149
- if (name.indexOf('[') > -1) {
- return Class.forName(name, false, this);
- }
-
- // we are not being asked to load an array - so we can load it
- return super.loadClass(name);
- }
-
- @Override
- protected String findLibrary(String libname) {
- String platformLibraryName = System.mapLibraryName(libname);
-
- // see if we can find the platform-specific library filename anywhere in our native library directories
- for (URL nativeLibraryUrl : nativeLibraryUrls) {
- try {
- // look at each file in the directory and see if it matches the platform-specific library filename
- File nativeLibraryDir = new File(nativeLibraryUrl.toURI());
- File[] files = nativeLibraryDir.listFiles();
- if (files != null) {
- for (File file : files) {
- if (!file.isDirectory() && file.getName().equals(platformLibraryName)) {
- return file.getAbsolutePath();
- }
- }
- }
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException("Bad embedded native library URL: " + nativeLibraryUrl, e);
- }
- }
-
- // we couldn't find it - see if the default mechanism can (via java.library.path)
- return super.findLibrary(libname);
- }
-
- private static final ClassLoader getTopMostClassLoader() {
- ClassLoader top = ClassLoader.getSystemClassLoader();
-
- while (top.getParent() != null) {
- top = top.getParent();
- }
-
- return top;
- }
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent/log4j.xml b/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent/log4j.xml
deleted file mode 100644
index fbcbdf6..0000000
--- a/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent/log4j.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <param name="Threshold" value="INFO"/>
- <param name="Target" value="System.out"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t] (%c{5}) - %m%n"/>
- </layout>
- </appender>
-
- <!-- ================================= -->
- <!-- Append messages to a rolling file -->
- <!-- ================================= -->
- <appender name="FILE" class="org.apache.log4j.RollingFileAppender">
-
- <param name="Threshold" value="DEBUG"/>
- <param name="File" value="../../logs/embedded-agent.log"/>
- <param name="MaxBackupIndex" value="2"/>
- <param name="MaxFileSize" value="5000KB"/>
- <param name="Append" value="true"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t] (%c{5})- %m%n"/>
- </layout>
-
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <!-- JBoss ON -->
- <!--
- <category name="org.jboss.on">
- <priority value="INFO"/>
- </category>
- -->
-
- <!-- JBoss/Remoting : for low level communications layer tracing -->
- <!--
- <category name="org.jboss.remoting">
- <priority value="TRACE" class="org.jboss.logging.XLevel"/>
- </category>
- -->
-
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <priority value="INFO"/>
- <appender-ref ref="FILE"/>
- <!-- <appender-ref ref="CONSOLE"/> -->
- </root>
-
-</log4j:configuration>
diff --git a/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-deployment-structure.xml b/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-deployment-structure.xml
deleted file mode 100644
index afbe075..0000000
--- a/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-deployment-structure.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
- <deployment>
- <resources>
- <resource-root path="lib/rhq-enterprise-agent-${project.version}.jar" />
- <resource-root path="lib/rhq-enterprise-comm-${project.version}.jar" />
- <resource-root path="lib/rhq-core-comm-api-${project.version}.jar" />
- <resource-root path="lib/rhq-core-util-${project.version}.jar" />
- <resource-root path="lib/i18nlog-${i18nlog.version}.jar" />
- </resources>
- </deployment>
-</jboss-deployment-structure>
\ No newline at end of file
diff --git a/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-service.xml b/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-service.xml
deleted file mode 100644
index b8f3359..0000000
--- a/modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/jboss-service.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server xmlns="urn:jboss:service:7.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">
-
- <mbean code="org.rhq.enterprise.server.agent.EmbeddedAgentBootstrapService"
- name="rhq:service=EmbeddedAgentBootstrap">
-
- <attribute name="AgentEnabled">${rhq.server.embedded-agent.enabled:false}</attribute>
- <attribute name="ResetConfiguration">${rhq.server.embedded-agent.reset-configuration:false}</attribute>
- <attribute name="PreferencesNodeName">${rhq.server.embedded-agent.name:}</attribute>
- <attribute name="EmbeddedAgentDirectory">${jboss.server.base.dir}/deployments/rhq-agent.sar/META-INF/embedded-agent</attribute>
- <attribute name="ConfigurationOverridesFile">embedded-agent-configuration-overrides.properties</attribute>
-
- <!-- comma-separated arguments passed to agent main method; do not pass the -c or -p arguments -->
- <attribute name="AgentArguments">--daemon,--output=${jboss.server.log.dir}/embedded-agent.out</attribute>
- </mbean>
-
-</server>
diff --git a/modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration-overrides.properties b/modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration-overrides.properties
deleted file mode 100644
index c14c614..0000000
--- a/modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration-overrides.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# name of the embedded agent
-rhq.agent.name=${rhq.server.embedded-agent.name:}
-# the agent's server will point to the location of the server where it is embedded
-rhq.agent.server.transport=${rhq.communications.connector.transport:servlet}
-rhq.agent.server.bind-address=${rhq.communications.connector.bind-address}
-rhq.agent.server.bind-port=${rhq.communications.connector.bind-port}
-rhq.agent.server.transport-params=${rhq.communications.connector.transport-params:/jboss-remoting-servlet-invoker/ServerInvokerServlet}
-# the binding address/port for the agent's server socket
-rhq.communications.connector.bind-address=${rhq.communications.connector.bind-address}
-rhq.communications.connector.bind-port=${rhq.server.embedded-agent.bind-port:26163}
-# location where data files can be stored
-rhq.agent.data-directory=${jboss.server.data.dir}/embedded-agent
-# location of the plugins
-rhq.agent.plugins.directory=${rhq.server.home}/modules/org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/rhq.ear/rhq-downloads/rhq-plugins
-# Client-side SSL Security Configuration (for sending messages to the server)
-rhq.agent.client.security.secure-socket-protocol=${rhq.communications.connector.security.secure-socket-protocol:TLS}
-rhq.agent.client.security.keystore.file=${rhq.communications.connector.security.keystore.file}
-rhq.agent.client.security.keystore.algorithm=${rhq.communications.connector.security.keystore.algorithm:SunX509}
-rhq.agent.client.security.keystore.type=${rhq.communications.connector.security.keystore.type:JKS}
-rhq.agent.client.security.keystore.password=${rhq.communications.connector.security.keystore.password:rhqpwd}
-rhq.agent.client.security.keystore.key-password=${rhq.communications.connector.security.keystore.key-password:rhqpwd}
-rhq.agent.client.security.keystore.alias=${rhq.communications.connector.security.keystore.alias:rhq}
-rhq.agent.client.security.truststore.file=${rhq.communications.connector.security.truststore.file}
-rhq.agent.client.security.truststore.algorithm=${rhq.communications.connector.security.truststore.algorithm:SunX509}
-rhq.agent.client.security.truststore.type=${rhq.communications.connector.security.truststore.type:JKS}
-rhq.agent.client.security.truststore.password=${rhq.communications.connector.security.truststore.password}
-rhq.agent.client.security.server-auth-mode-enabled=${rhq.server.client.security.server-auth-mode-enabled:false}
-# indicate if you do not want the native system to be used by the embedded agent
-rhq.agent.disable-native-system=${rhq.server.embedded-agent.disable-native-system:false}
diff --git a/modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration.xml b/modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration.xml
deleted file mode 100644
index a9a8b77..0000000
--- a/modules/enterprise/server/sars/agent-sar/src/main/resources/embedded-agent-configuration.xml
+++ /dev/null
@@ -1,1062 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd'>
-
-<!--
-==============================================================================
-Embedded RHQ Agent Configuration
-==============================================================================
--->
-
-<preferences EXTERNAL_XML_VERSION="1.0">
- <root type="user">
- <map />
- <node name="rhq-agent">
- <map />
- <node name="${rhq.server.embedded-agent.preferences-node}">
- <map>
- <!--
- _______________________________________________________________
- rhq.agent.configuration-schema-version
-
- Defines what version of the agent configuration schema this
- file conforms to. This is the schema for the rhq.agent
- preferences.
- -->
- <entry key="rhq.agent.configuration-schema-version" value="6" />
-
- <!--
- _______________________________________________________________
- rhq.agent.configuration-setup-flag
-
- If true, the agent will assume it is fully configured and
- will not ask setup questions when it starts up. If false,
- the agent assumes the configuration is not complete and
- will ask a series of setup questions to the user in order
- to be fully configured.
-
- If you write your own custom agent configuration file, you
- will probably want to set this flag to true since you
- probably will set all of your configuration right in the
- configuration file itself. However, you may wish to
- distribute agent configuration files with only a subset
- of configuration preferences set and rely on each agent's
- startup setup mechanism to finish its configuration - in this
- case, you'll want to leave this as false.
-
- EMBEDDED: this is true - we ensure the agent is fully
- configured; we have to since the agent has no console
- interface and must start in daemon mode
- -->
- <entry key="rhq.agent.configuration-setup-flag" value="true" />
-
- <!--
- _______________________________________________________________
- rhq.agent.name
-
- Explicitly defines what the agent's name is. This will
- default to the agent's fully qualified domain name (that is,
- the FQDN of the platform where the agent is running). However,
- you can set this to any value you want, so long as it is
- unique among all other agents. You will need to explicitly set
- this if the agent platform's FQDN cannot be reliably determined
- at runtime.
-
- EMBEDDED: this will usually be overridden so the deployer can
- provide a unique embedded agent name
- -->
- <entry key="rhq.agent.name" value="127.0.0.1"/>
-
- <!--
- _______________________________________________________________
- rhq.agent.server.transport
- rhq.agent.server.bind-address
- rhq.agent.server.bind-port
- rhq.agent.server.transport-params
-
- The RHQ Server endpoint configuration.
-
- Note that because this is an XML file, you must specify
- "&" in the transport-params value when needing an ampersand
- to separate the transport parameters.
-
- EMBEDDED: these will usually be overridden in the
- jboss-service.xml of the embedded agent service
- -->
- <entry key="rhq.agent.server.transport" value="servlet" />
- <entry key="rhq.agent.server.bind-port" value="7080" />
- <entry key="rhq.agent.server.bind-address" value="127.0.0.1" />
- <entry key="rhq.agent.server.transport-params" value="/jboss-remoting-servlet-invoker/ServerInvokerServlet" />
-
- <!--
- _______________________________________________________________
- rhq.agent.server-auto-detection
-
- If true, the agent will attempt to auto-detect the RHQ Server
- coming online and going offline. This is more efficient
- than server polling but it requires multicast traffic to be
- enabled on your network and also requires the multicast
- detector be enabled.
-
- EMBEDDED: we disable this since we know if the agent is started
- the server must be started (since the agent lives inside the
- server!)
- -->
- <entry key="rhq.agent.server-auto-detection" value="false" />
-
- <!--
- _______________________________________________________________
- rhq.agent.register-with-server-at-startup
-
- If true, the agent will attempt to register itself with the
- RHQ Server when the agent starts up. If false, the agent will
- not automatically register itself at startup; the agent must
- be manually registered via some other mechanism (e.g. the
- 'register' prompt command). The agent must be registered
- at least once in order to notify the RHQ Server about its
- existence and to assign the agent a valid security token.
- Note that even if this is true, the registration may not happen
- immediately if the RHQ Server itself is not up - once the RHQ
- Server comes up, the registration attempt will occur.
- -->
- <entry key="rhq.agent.register-with-server-at-startup" value="true" />
-
- <!--
- _______________________________________________________________
- rhq.agent.wait-for-server-at-startup-msecs
-
- This defines how many milliseconds the agent should wait at
- startup for the RHQ Server to be detected. If the RHQ Server
- has not started up in the given amount of time, the agent will
- continue initializing and expect the server to come up later.
- If this is 0, the agent will not wait at all.
-
- EMBEDDED: we still give an initial pause to let the server
- finish starting up before its embedded agent starts talking
- to it.
- -->
- <entry key="rhq.agent.wait-for-server-at-startup-msecs" value="10000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.update-plugins-at-startup
-
- If true, the agent will attempt to update its current set
- of plugins to their latest versions at startup. If false, the
- agent will not automatically update the plugins; the agent
- will use its current plugins. To update the plugins, you must
- manually do so via some other mechanism (e.g. the
- 'plugins' prompt command).
- Note that even if this is true, the update may not happen
- immediately if the RHQ Server itself is not up - once the RHQ
- Server comes up, the update attempt will occur.
-
- EMBEDDED: we do not need to update the plugins because the
- embedded agent will just share the plugins that the server
- serves to other agents.
- -->
- <entry key="rhq.agent.update-plugins-at-startup" value="false" />
-
- <!--
- _______________________________________________________________
- rhq.agent.test-failover-list-at-startup
-
- If true, the agent will test connectivity to all server
- endpoints found in the agent's failover list. This helps
- provide a mechanism to quickly detect problems with the
- public endpoints configured for all RHQ Servers.
- -->
- <!--
- <entry key="rhq.agent.test-failover-list-at-startup" value="false" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.agent-update.enabled
-
- If true, the agent will be allowed to update itself if it
- finds there is a new agent update binary available.
- If this feature is not enabled, the agent will never
- be allowed to update itself.
-
- EMBEDDED: we never have to worry about being up-to-date,
- the embedded agent will always be the latest
- when embedded in its server.
- -->
- <entry key="rhq.agent.agent-update.enabled" value="false" />
-
- <!--
- _______________________________________________________________
- rhq.agent.agent-update.version-url
-
- If this is defined, it will be the URL the agent uses when it
- needs to retrieve information about the latest available
- agent update binary. If this is not defined, the agent will
- ask its server for the agent update binary version information.
- -->
- <!--
- <entry key="rhq.agent.agent-update.version-url" value="http://127.0.0.1:7080/agentupdate/version" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.agent-update.download-url
-
- If this is defined, it will be the URL the agent uses when it
- needs to download the latest available agent update binary.
- If this is not defined, the agent will download the agent
- update binary from its server.
- -->
- <!--
- <entry key="rhq.agent.agent-update.download-url" value="http://127.0.0.1:7080/agentupdate/download" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.primary-server-switchover-check-interval-msecs
-
- The agent will periodically check to ensure that the server
- it is connected to is its primary server (as opposed to one
- of its failover servers). This preference defines how many
- milliseconds the agent should wait in between these checks.
- A side-effect of this check is that the agent will also
- download an updated version of its failover list. So if
- new servers have been added to the cloud, the agent will
- now know about it.
-
- If this is 0, this check is never performed. You should never
- set this to 0 unless your agent will never participate in
- an RHQ HA environment.
- -->
- <entry key="rhq.agent.primary-server-switchover-check-interval-msecs" value="3600000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.vm-health-check.interval-msecs
-
- The agent will periodically check the health of its JVM if
- this preference is larger than 0. This check will allow the
- agent to attempt to correct possibly fatal problems that are
- detected (such as the JVM getting critically low on memory).
- The value of this preference, if larger than 0, is the number
- of milliseconds the agent should wait in between checks.
-
- EMBEDDED: disabled - will not check the VM health
- -->
- <entry key="rhq.agent.vm-health-check.interval-msecs" value="0" />
-
- <!--
- _______________________________________________________________
- rhq.agent.vm-health-check.low-heap-mem-threshold
- rhq.agent.vm-health-check.low-nonheap-mem-threshold
-
- The threshold percentage (as a floating decimal) that must be
- crossed if the agent's VM health check thread is to consider
- the JVM with critically low memory. For example, if
- the agent's maximum heap size is 100MB and the heap
- threshold is set to 0.90, the agent's VM health check thread
- will consider the agent critically low on memory if the agent
- is using over 90MB of heap space.
- Note that he heap and non-heap memory thresholds are specified
- as separate preferences.
- -->
- <entry key="rhq.agent.vm-health-check.low-heap-mem-threshold" value="0.90" />
- <entry key="rhq.agent.vm-health-check.low-nonheap-mem-threshold" value="0.90" />
-
- <!--
- _______________________________________________________________
- rhq.agent.data-directory
-
- Location of a directory where the agent can write its internal
- cache of data.
-
- EMBEDDED: will be overridden to the server's data directory
- -->
- <!--
- <entry key="rhq.agent.data-directory" value="data" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.client.queue-size
-
- The maximum size of the client command queue - this is the
- maximum number of commands that can be queued for sending to
- the server. If this is 0, then the queue is unbounded.
- WARNING! Setting this to 0 could lead to resources being used
- up if for some reason commands keep getting queued but are
- not getting sent.
- -->
- <entry key="rhq.agent.client.queue-size" value="50000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.max-concurrent
-
- The maximum number of concurrent commands that can be in the
- process of being sent to the server at any one time.
- -->
- <entry key="rhq.agent.client.max-concurrent" value="5" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.command-timeout-msecs
-
- The time in milliseconds that the client sender will wait
- before aborting a command. This is the amount of time in
- milliseconds that the server has in order to process commands.
- This value is only the default if a command has not specified
- its own timeout. A command can override this by setting its
- own timeout in the command's configuration, so this value may
- not be used for all commands that are sent. If this value is
- less than or equal to 0, there will be no default timeout
- and commands will therefore be allowed to take as long as they
- need (again, this is the default, individual commands may
- override this and set their own timeout). While this infinite
- timeout default could conceivably cause a thread to hang
- waiting for a rogue command that never finishes, it also reduces
- the amount of short-lived threads created by the system
- and will increase throughput, dramatically in some cases.
- -->
- <entry key="rhq.agent.client.command-timeout-msecs" value="600000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.retry-interval-msecs
-
- This is the minimum amount of time, in milliseconds, the client
- sender will wait before trying to resend a guaranteed command
- that previously failed. This is not a guarantee of when
- a command is retried - all that can be inferred is that a
- command that fails to be sent will not be retried until at
- least this amount of time passes.
- Note: if the sender is currently waiting in this retry pause
- period, the agent will not be able to be shutdown until that
- retry period is over. In other words, if the agent is asked
- to shutdown, it will wait for those commands waiting in this
- retry interval to wake up. This is to help ensure those
- commands are not lost. Keep this time period short enough
- to make agent shutdowns fairly responsive but long enough
- to avoid spinning the process with continuous resending of
- commands during periods of RHQ Server downtime. It is
- recommended to use auto-detection or server polling in order
- to automatically stop the client sender from continuously
- trying to retry commands during long periods of RHQ
- Server downtime.
- -->
- <entry key="rhq.agent.client.retry-interval-msecs" value="15000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.max-retries
-
- If a guaranteed delivery message is sent, but the agent fails
- to connect to the server and deliver the message, it will
- always be retried. However, if the error was something other
- than a "cannot connect" error, the command will only be retried
- this amount of times before the command is dropped. When this
- happens, the guaranteed command will never be delivered. This
- will normally happen under very odd and rare circumstances.
- Also, this setting only effects asynchronous messages that
- are sent with guaranteed delivery. This setting has no effect
- on other messages.
- -->
- <entry key="rhq.agent.client.max-retries" value="10" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.server-polling-interval-msecs
-
- If this value is larger than 0, it indicates the client sender
- should periodically poll the RHQ Server to make sure it's still
- up or (if it was down) see when it comes back up. The value is
- the number of milliseconds to wait in between polls. If the
- value is 0 or less, server polling is disabled. Server polling
- is less efficient that the agent's auto-detection mechanism,
- but server polling does not use multicasting, and thus might
- be the only way for the agent to detect the server.
-
- EMBEDDED: we do not need to poll since we know the server is
- always up
- -->
- <entry key="rhq.agent.client.server-polling-interval-msecs" value="0" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.command-spool-file.name
-
- This defines the name of the command spool file. This
- file must be located in the data directory (if one does not
- exist, it will be created). Note that if you do not define
- this setting, the default is to not spool commands to disk
- and thus implicitly disable guaranteed delivery.
- -->
- <entry key="rhq.agent.client.command-spool-file.name" value="embedded-agent-command-spool.dat" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.command-spool-file.params
-
- This defines the parameters for the command spool file.
- The spool file is where the agent persists commands that
- are flagged for guaranteed delivery and need to be sent.
- The format is defined as "max-file-size:purge-percentage".
- The first number is the size, in bytes, of the maximum file
- size threshold. If the spool file grows larger than this, a
- "purge" will be triggered in order to shrink the file.
- The second number is the purge percentage which indicates how
- large the file is allowed to be after a purge. This is
- specified as a percentage of the first parameter - the max
- file size threshold. For example, if the max file size is
- 100000 (i.e. 100KB) and the purge percentage is 90, then when
- the spool file grows larger than 100KB, a purge will be
- triggered and the file will be shrunk to no more than
- 90% of 100KB - which is 90KB. In effect, 10KB will be freed
- to allow room for new commands to be spooled. When this
- occurs, unused space is freed first and if that does not
- free up enough space, the oldest commands in the spool file
- will be sacrificed in order to make room for the newer
- commands.
- -->
- <entry key="rhq.agent.client.command-spool-file.params" value="10000000:75" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.command-spool-file.compressed
-
- If this flag is true, the commands stored in the spool file
- will be compressed. This can potentially save about 30%-40% in
- disk space (give or take), however, it slows down the
- persistence mechanism considerably. Recommended setting for
- this should be true unless something on the agent deployment
- box warrants persistence performance over disk-saving . The
- performance hit will only appear when unusual conditions occur,
- such as shutting down while some guaranteed commands have not
- been sent yet or if the RHQ Server is down. It will not affect
- the agent under normal conditions (while running with the RHQ
- Server up and successfully communicating with the agent).
- In those unusual/rare conditions, having performance degradation
- may not be as important.
- -->
- <entry key="rhq.agent.client.command-spool-file.compressed" value="true" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.send-throttling
-
- If this setting is defined, it will enable send throttling to
- occur while sending commands to the server. The format is
- defined as "max-commands:quiet-period-milliseconds"
- where the maximum commands defines the maximum number
- of commands that will be sent before the start of a quiet
- period. The quiet period defines the number of milliseconds
- in which no commands should be sent. After this duration
- expires, commands can again be sent, up to the maximum defined.
- Note that send throttling only affects those commands that
- are "throttle-able". Some commands are sent as soon as
- possible, regardless of the throttling settings.
-
- This affects sending commands synchronously and asynchronously.
- -->
- <entry key="rhq.agent.client.send-throttling" value="100:1000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.queue-throttling
-
- If this setting is defined, it will enable queue throttling to
- occur while sending commands to the server. The format is
- defined as "max-commands-per-burst:burst-period-milliseconds"
- where the maximum commands per burst defines the maximum number
- of commands that can be dequeued within a burst period. The
- burst period defines the number of milliseconds in which the
- defined maximum number of commands can be dequeued. If more
- than the maximum number of commands are queued within this
- time period, they will wait until the next burst period starts
- before being able to be dequeued.
-
- This does not affect sending commands synchronously. It only
- effects commands queued to be sent asynchronously.
- -->
- <entry key="rhq.agent.client.queue-throttling" value="200:2000" />
-
- <!--
- _______________________________________________________________
- rhq.agent.client.command-preprocessors
-
- Defines what class or classes will handle preprocessing of all
- commands that are sent by the agent. To define multiple
- classes, separate them with colon characters (:).
- You should never have to change this unless you know what
- you are doing.
- -->
- <entry key="rhq.agent.client.command-preprocessors" value="org.rhq.enterprise.agent.SecurityTokenCommandPreprocessor:org.rhq.enterprise.agent.ExternalizableStrategyCommandPreprocessor" />
-
- <!--
- _______________________________________________________________
- rhq.agent.disable-native-system
-
- The agent has a native system (JNI native libraries) on certain
- supported platforms to help the plugin container perform
- discovery of native components on those platforms. If the
- native libraries are causing errors within the agent or if you
- simply do not want to load native components in the agent,
- you can disable this native system by setting this preference
- setting to true.
- -->
- <entry key="rhq.agent.disable-native-system" value="false"/>
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.directory
-
- Defines where the plugins can be located.
-
- EMBEDDED: this will be overridden to point to the
- server's location where it stores the plugins that it uses
- to send to other agents
- -->
- <!--
- <entry key="rhq.agent.plugins.directory" value="plugins"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.operation-invocation-timeout-secs
-
- When an operation is invoked, it will be aborted if it takes
- longer than the given amount of seconds. This is just the
- default operation invocation timeout - a plugin can override
- this default by defining its own timeout in the operation
- metadata within its plugin descriptor.
- -->
- <!--
- <entry key="rhq.agent.plugins.operation-invocation-timeout-secs" value="600"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.operation-invoker.threadpool-size
-
- When an operation is to be invoked, the execution of the
- operation will be performed by threads from a thread pool.
- This defines the number of threads within that thread pool,
- effectively defining the number of operations that can be
- invoked concurrently.
- -->
- <!--
- <entry key="rhq.agent.plugins.operation-invoker.threadpool-size" value="5"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.server-discovery.initial-delay-secs
-
- Defines the delay before the first server discovery scan is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.server-discovery.initial-delay-secs" value="10"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.server-discovery.period-secs
-
- Defines how often a server discovery scan is run. This type
- of scan is used to determine changes in the platform
- as well as to find new servers that have been added or
- old server that have been removed. The value is specified
- in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.server-discovery.period-secs" value="900"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.service-discovery.initial-delay-secs
-
- Defines the delay before the first service discovery scan is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.service-discovery.initial-delay-secs" value="20"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.service-discovery.period-secs
-
- Defines how often a service discovery scan is run. This type
- of scan is used to find new services that have been added or
- removed from existing platforms and servers. Technically,
- this kind of discovery is used to find any child resource
- to an existing parent resource (like a platform or server).
- The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.service-discovery.period-secs" value="86400"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.availability-scan.initial-delay-secs
-
- Defines the delay before the first availability scan is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.availability-scan.initial-delay-secs" value="5"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.availability-scan.period-secs
-
- Defines how often an availability scan is run. This type
- of scan is used to determine what resources are up and running
- and what resources have gone down. The value is specified in
- seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.availability-scan.period-secs" value="300"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.measurement-collection.threadpool-size
-
- When measurement's are scheduled for collection, the collection
- will be performed by threads from a thread pool. This defines
- the number of threads within that thread pool, effectively
- defining the number of measurements that can be collected
- concurrently.
- -->
- <!--
- <entry key="rhq.agent.plugins.measurement-collection.threadpool-size" value="5"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.measurement-collection.initial-delay-secs
-
- Defines the delay before the first measurement collection is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.measurement-collection.initial-delay-secs" value="30"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.drift-detection.initial-delay-secs
-
- Defines the delay before the first drift detection scan is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.drift-detection.initial-delay-secs" value="30"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.drift-detection.period-secs
-
- Defines how often a drift detection scan is run. This type
- of scan is used to determine what, if any, file changes (such
- as additions, deletions, modifications) occurred within
- specific file system locations that are being monitored.
- -->
- <!--
- <entry key="rhq.agent.plugins.drift-detection.period-secs" value="60"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.content-discovery.threadpool-size
-
- When plugins are scheduled to discover content, the discovery
- will be performed by threads from a thread pool. This defines
- the number of threads within that thread pool.
- -->
- <!--
- <entry key="rhq.agent.plugins.content-discovery.threadpool-size" value="10"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.content-discovery.initial-delay-secs
-
- Defines the delay before the first content discovery is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.content-discovery.initial-delay-secs" value="60"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.content-discovery.period-secs
-
- Defines how often content discoveries are run. The value is
- specified in seconds. If this value is 0 or less, content
- discovery will be disabled. Content discovery is used to
- detect new or changed content that are associated with
- resources in inventory.
- -->
- <!--
- <entry key="rhq.agent.plugins.content-discovery.period-secs" value="30"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.configuration-discovery.initial-delay-secs
-
- Defines the delay before the first configuration discovery is
- run. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.configuration-discovery.initial-delay-secs" value="300"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.configuration-discovery.period-secs
-
- Defines how often configuration discoveries are run. The value is
- specified in seconds. If this value is 0 or less, configuration
- discovery will be disabled. Configuration discovery is
- performed to detect changes in a managed resource's
- configuration settings.
- -->
- <!--
- <entry key="rhq.agent.plugins.configuration-discovery.period-secs" value="3600"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.event-sender.initial-delay-secs
-
- Defines the delay before the first event report gets sent
- to the server. The value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.event-sender.initial-delay-secs" value="30"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.event-sender.period-secs
-
- Defines how often event reports get sent to the server. The
- value is specified in seconds.
- -->
- <!--
- <entry key="rhq.agent.plugins.event-sender.period-secs" value="30"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.event-report.max-per-source
-
- Defines the maximum number of events for any given event source
- that can be placed in a single event report that is sent up
- to the server. If this number is larger than the max-total
- setting, then this setting is ignored.
- -->
- <!--
- <entry key="rhq.agent.plugins.event-report.max-per-source" value="200"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.event-report.max-total
-
- Defines the total maximum number of events that can be placed
- in a single event report that is sent up to the server.
- -->
- <!--
- <entry key="rhq.agent.plugins.event-report.max-total" value="400"/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.agent.plugins.disabled
-
- Defines the names of the plugins that are to be disabled.
- This is a comma-separated list of plugin names, where a
- plugin name is found in the name attribute in the root XML
- element in the plugin descriptor. A disabled plugin will
- simply not be loaded in the plugin container.
-
- By default, all plugins are enabled. If a plugin was marked
- as disabled by the server, the agent will not download it and
- will not load it, regardless of the value of this preference.
- If a plugin is enabled on the server, this
- preference will override that enable setting (in other words,
- an agent is able to disable a plugin, effectively overriding
- the server setting, by placing the plugin name in this
- preference). If the agent already has a plugin jar in
- its local plugins directory, but that plugin is disabled
- via this preference, that local plugin jar file will be
- deleted and the plugin will not be loaded.
- -->
- <!--
- <entry key="rhq.agent.plugins.disabled" value=""/>
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.configuration-schema-version
-
- Defines what version of the agent configuration schema this
- file conforms to. This is the schema for the
- rhq.communications preferences.
- -->
- <entry key="rhq.communications.configuration-schema-version" value="1" />
-
- <!--
- _______________________________________________________________
- rhq.communications.service-container.mbean-server-name
-
- Name of the MBean Server that houses the communications MBean
- services. This is actually the default domain name of the
- MBean Server and if an MBean Server has already been registered
- with this name, it will be used to house the communications
- services. If an MBean Server has not yet been registered with
- this name as its default domain, one will be created. Typically
- this can be left undefined which means the fallback MBeanServer
- to be used is the built-in JVM platform MBeanServer.
- -->
- <entry key="rhq.communications.service-container.mbean-server-name" value="embedded-agent" />
-
- <!--
- _______________________________________________________________
- rhq.communications.data-directory
-
- The location where the communication services write internal
- data files. If not defined, the data directory will be the
- same as the agent's.
- -->
- <!--
- <entry key="rhq.communications.data-directory" value="data" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.global-concurrency-limit
-
- The maximum number of incoming commands that are allowed to be
- received concurrently. Zero or less indicates there is to
- be no limit and the agent can accept as many incoming
- commands as possible. By default, there is no limit
- and you typically did not have to change this from its
- default.
- -->
- <entry key="rhq.communications.global-concurrency-limit" value="-1" />
-
- <!--
- _______________________________________________________________
- rhq.communications.multicast-detector.enabled
- rhq.communications.multicast-detector.multicast-address
- rhq.communications.multicast-detector.bind-address
- rhq.communications.multicast-detector.port
- rhq.communications.multicast-detector.default-time-delay
- rhq.communications.multicast-detector.heartbeat-time-delay
-
- The multicast detector configuration. This is the service that
- listens for new remote servers coming on and going offline and
- is required if you want server auto-detection. If you do not
- have server auto-detection enabled or your network will not
- support multicast traffic, you should disable the multicast
- detector.
-
- The multicast-address is used to broadcast detection messages.
- To be more specific, it is the IP address of the
- multicast group the detector will join. The bind-address
- is the IP that is bound by the network interface.
-
- The detector will send heartbeat messages every X milliseconds
- (this is the heartbeat-time-delay). If external servers'
- detectors do not send their heartbeat messages within the
- default-time-delay, our detector will assume that external
- server has gone down. These settings affect the timeliness
- of our auto-detection mechanism.
-
- EMBEDDED: since the agent is running inside the server, no need
- to try to auto-discover it since, if the agent is up, it knows
- the server is, too.
- -->
- <entry key="rhq.communications.multicast-detector.enabled" value="false" />
- <entry key="rhq.communications.multicast-detector.multicast-address" value="224.16.16.16" />
- <entry key="rhq.communications.multicast-detector.bind-address" value="0.0.0.0" />
- <entry key="rhq.communications.multicast-detector.port" value="16162" />
- <entry key="rhq.communications.multicast-detector.default-time-delay" value="5000" />
- <entry key="rhq.communications.multicast-detector.heartbeat-time-delay" value="1000" />
-
- <!--
- _______________________________________________________________
- rhq.communications.connector.rhqtype
- rhq.communications.connector.transport
- rhq.communications.connector.bind-port
- rhq.communications.connector.bind-address
- rhq.communications.connector.transport-params
- rhq.communications.connector.lease-period
-
- The agent's connector configuration. This is the service that
- listens for incoming client requests and passes them to the
- appropriate server-side components for processing. See the
- JBoss/Remoting documentation for a full list of options
- that can be specified. Note that because this is an XML file,
- you must specify "&" in the transport-params value
- when needing an ampersand to separate the parameters.
-
- EMBEDDED: the bind address will be overridden to be the
- one used by the server. The bind port is normally overridden
- in the jboss-service.xml also.
- -->
- <entry key="rhq.communications.connector.rhqtype" value="agent" />
- <entry key="rhq.communications.connector.transport" value="socket" />
- <!--
- <entry key="rhq.communications.connector.bind-address" value="127.0.0.1" />
- <entry key="rhq.communications.connector.bind-port" value="26163" />
- -->
- <!--
- <entry key="rhq.communications.connector.transport-params" value="clientConnectAddress=127.0.0.1&clientConnectPort=16163&numAcceptThreads=3&maxPoolSize=303&clientMaxPoolSize=304&socketTimeout=60000&enableTcpNoDelay=true&backlog=200" />
- <entry key="rhq.communications.connector.lease-period" value="5000" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.connector.security.secure-socket-protocol
- rhq.communications.connector.security.keystore.file
- rhq.communications.connector.security.keystore.algorithm
- rhq.communications.connector.security.keystore.type
- rhq.communications.connector.security.keystore.password
- rhq.communications.connector.security.keystore.key-password
- rhq.communications.connector.security.keystore.alias
- rhq.communications.connector.security.truststore.file
- rhq.communications.connector.security.truststore.algorithm
- rhq.communications.connector.security.truststore.type
- rhq.communications.connector.security.truststore.password
- rhq.communications.connector.security.client-auth-mode
-
- rhq.agent.client.security.secure-socket-protocol
- rhq.agent.client.security.keystore.file
- rhq.agent.client.security.keystore.algorithm
- rhq.agent.client.security.keystore.type
- rhq.agent.client.security.keystore.password
- rhq.agent.client.security.keystore.key-password
- rhq.agent.client.security.keystore.alias
- rhq.agent.client.security.truststore.file
- rhq.agent.client.security.truststore.algorithm
- rhq.agent.client.security.truststore.type
- rhq.agent.client.security.truststore.password
- rhq.agent.client.security.server-auth-mode-enabled
-
- These are the settings that are used if SSL is to be used for
- either the server or client communications. These can be left
- unset since the defaults will normally suffice. These
- properties are here just in case some use case occurs that
- require one or more of these settings to be customized.
-
- Note that if client-auth-mode is specified, it must be one of:
- "none", "want", "need".
-
- EMBEDDED: the agent is in the same VM as the server so there
- is no need for transport security since traffic is never
- actually routed outside of the VM.
- -->
- <!--
- <entry key="rhq.communications.connector.security.secure-socket-protocol" value="TLS" />
- <entry key="rhq.communications.connector.security.keystore.file" value="data/keystore.dat" />
- <entry key="rhq.communications.connector.security.keystore.algorithm" value="SunX509" />
- <entry key="rhq.communications.connector.security.keystore.type" value="JKS" />
- <entry key="rhq.communications.connector.security.keystore.password" value="rhqpwd" />
- <entry key="rhq.communications.connector.security.keystore.key-password" value="rhqpwd" />
- <entry key="rhq.communications.connector.security.keystore.alias" value="rhq" />
- <entry key="rhq.communications.connector.security.truststore.file" value="data/truststore.dat" />
- <entry key="rhq.communications.connector.security.truststore.algorithm" value="SunX509" />
- <entry key="rhq.communications.connector.security.truststore.type" value="JKS" />
- <entry key="rhq.communications.connector.security.truststore.password" value="" />
- <entry key="rhq.communications.connector.security.client-auth-mode" value="none" />
-
- <entry key="rhq.agent.client.security.secure-socket-protocol" value="TLS" />
- <entry key="rhq.agent.client.security.keystore.file" value="data/keystore.dat" />
- <entry key="rhq.agent.client.security.keystore.algorithm" value="SunX509" />
- <entry key="rhq.agent.client.security.keystore.type" value="JKS" />
- <entry key="rhq.agent.client.security.keystore.password" value="rhqpwd" />
- <entry key="rhq.agent.client.security.keystore.key-password" value="rhqpwd" />
- <entry key="rhq.agent.client.security.keystore.alias" value="rhq" />
- <entry key="rhq.agent.client.security.truststore.file" value="data/truststore.dat" />
- <entry key="rhq.agent.client.security.truststore.algorithm" value="SunX509" />
- <entry key="rhq.agent.client.security.truststore.type" value="JKS" />
- <entry key="rhq.agent.client.security.truststore.password" value="" />
- <entry key="rhq.agent.client.security.server-auth-mode-enabled" value="false" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.remote-stream-max-idle-time-msecs
-
- The maximum amount of milliseconds a remoted stream
- is allowed to be idle before it is automatically closed and
- removed from the server. This means that a client must
- attempt to access the remoted stream every X milliseconds
- (where X is the value of this setting) or that stream will no
- longer be available. Note that this does not mean a client
- must read or write the entire stream in this amount of time,
- it only means a client must make a request on the stream every
- X milliseconds (be it to read or write one byte, see how many
- bytes are available to be read, etc).
- -->
- <entry key="rhq.communications.remote-stream-max-idle-time-msecs" value="300000" />
-
- <!--
- _______________________________________________________________
- rhq.communications.command-service-directory.allow-dynamic-discovery
-
- Flag to allow new command services to be added to the command
- services directory during runtime. If this is false, only
- those services defined in the
- rhq.communications.command-services preference will be available
- during the lifetime of the command service directory.
- -->
- <entry key="rhq.communications.command-service-directory.allow-dynamic-discovery" value="true" />
-
- <!--
- _______________________________________________________________
- rhq.communications.command-services
-
- Command Services that are to be added immediately at startup.
- -->
- <entry key="rhq.communications.command-services" value="org.rhq.enterprise.communications.command.impl.echo.server.EchoCommandService, org.rhq.enterprise.communications.command.impl.identify.server.IdentifyCommandService" />
-
- <!--
- _______________________________________________________________
- rhq.communications.remote-pojos
-
- Objects that are to be created and their remote interfaces
- deployed immediately at startup. The format of the value is
- a comma separated list of implementation/interface names:
- class.to.instantiate.via.noarg.constructor:interface.to.expose
- -->
- <entry key="rhq.communications.remote-pojos" value="org.rhq.enterprise.communications.PingImpl:org.rhq.enterprise.communications.Ping" />
-
- <!--
- _______________________________________________________________
- rhq.agent.do-not-override-prefs-with-sysprops
-
- EMBEDDED: To avoid having the embedded agent pick up
- configuration settings that belong to the server in which it is
- embedded, we want to disable the system property overlay
- feature of the agent configuration.
- -->
- <entry key="rhq.agent.do-not-override-prefs-with-sysprops" value="true" />
-
- </map>
- </node>
- </node>
- </root>
-</preferences>
\ No newline at end of file
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml
deleted file mode 100644
index 1f3081e..0000000
--- a/modules/enterprise/server/sars/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-parent</artifactId>
- <version>4.9.0-SNAPSHOT</version>
- <relativePath>../../../../pom.xml</relativePath>
- </parent>
-
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <packaging>pom</packaging>
-
- <name>RHQ Enterprise Server JBoss AS SARs</name>
- <description>parent POM for all JBoss AS SARs</description>
-
- <build>
- <plugins>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jboss-packaging-maven-plugin</artifactId>
- <version>1.9.99</version>
- <extensions>true</extensions> <!-- allows Maven to grok the sar packaging type -->
- </plugin>
-
- </plugins>
- </build>
-
- <modules>
- <!--
- <module>agent-sar</module>
- -->
- </modules>
-
- <pluginRepositories>
- <pluginRepository>
- <id>jboss-deprecated-repository</id>
- <name>JBoss Deprecated</name>
- <url>https://repository.jboss.org/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
-
-</project>
-
10 years, 10 months
[rhq] modules/enterprise
by snegrea
modules/enterprise/server/data-migration/src/main/java/org/rhq/server/metrics/migrator/DataMigratorRunner.java | 19 ++++------
1 file changed, 9 insertions(+), 10 deletions(-)
New commits:
commit 82e21e6ae2e3a92dd6f36e7f67f2609dc785692f
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon Jul 1 09:14:06 2013 -0500
[BZ 976790] Updated the parsing of rqh server properties to be consistent with the rest of the code.
diff --git a/modules/enterprise/server/data-migration/src/main/java/org/rhq/server/metrics/migrator/DataMigratorRunner.java b/modules/enterprise/server/data-migration/src/main/java/org/rhq/server/metrics/migrator/DataMigratorRunner.java
index f18bea1..8a0f64c 100644
--- a/modules/enterprise/server/data-migration/src/main/java/org/rhq/server/metrics/migrator/DataMigratorRunner.java
+++ b/modules/enterprise/server/data-migration/src/main/java/org/rhq/server/metrics/migrator/DataMigratorRunner.java
@@ -367,22 +367,21 @@ public class DataMigratorRunner {
if (serverProperties.getProperty("rhq.cassandra.seeds") != null
&& !serverProperties.getProperty("rhq.cassandra.seeds").trim().isEmpty()) {
- StringBuffer seedHosts = new StringBuffer();
- String cassandraPort = null;
- for (String seed : serverProperties.getProperty("rhq.cassandra.seeds").split(",")) {
- String[] params = seed.split("\\|");
+ String[] unparsedSeeds =serverProperties.getProperty("rhq.cassandra.seeds").split(",");
+ String[] seedHosts = new String[unparsedSeeds.length];
+ Integer cassandraPort = null;
+ for (int index = 0; index < unparsedSeeds.length; index++) {
+ String[] params = unparsedSeeds[index].split("\\|");
if (params.length != 3) {
throw new IllegalArgumentException(
- "Expected string of the form, hostname|jmxPort|nativeTransportPort: [" + seed + "]");
+ "Expected string of the form, hostname|jmxPort|nativeTransportPort: [" + unparsedSeeds[index] + "]");
}
- seedHosts.append(params[0]).append(',');
- cassandraPort = tryParseInteger(params[2], DEFAULT_CASSANDRA_PORT) + "";
+ seedHosts[index] = params[0];
+ cassandraPort = tryParseInteger(params[2], DEFAULT_CASSANDRA_PORT);
}
- seedHosts.deleteCharAt(seedHosts.length() - 1);
-
- configuration.put(cassandraHostsOption, seedHosts.toString());
+ configuration.put(cassandraHostsOption, seedHosts);
configuration.put(cassandraPortOption, cassandraPort);
}
}
10 years, 10 months
[rhq] modules/enterprise
by Thomas Segismont
modules/enterprise/server/ear/pom.xml | 62 +-----
modules/enterprise/server/pom.xml | 2
modules/enterprise/server/sars/pom.xml | 1
modules/enterprise/server/sars/services-sar/pom.xml | 97 ----------
modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml | 70 -------
5 files changed, 20 insertions(+), 212 deletions(-)
New commits:
commit e05abe75da0424192f5d516f896eedf0a4ffca1e
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Mon Jul 1 11:15:13 2013 +0200
Services SAR removed
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index 9a82877..691d23c 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -82,13 +82,6 @@
</dependency>
<!-- ** SARs -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-enterprise-server-services-sar</artifactId>
- <version>${project.version}</version>
- <type>sar</type>
- </dependency>
-
<!--
<dependency>
<groupId>${project.groupId}</groupId>
@@ -271,13 +264,6 @@
<!-- The Maven ear plugin has a bug that causes SARs to be marked as <connector> modules -->
<!-- and there is no way to tell it not to put the SAR in the application.xml so we have -->
<!-- to do things with SARs separately using another maven plugin below -->
- <sarModule>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-enterprise-server-services-sar</artifactId>
- <bundleFileName>rhq-services.sar</bundleFileName>
- <excluded>true</excluded>
- </sarModule>
-
<!--
<sarModule>
<groupId>${project.groupId}</groupId>
@@ -348,35 +334,25 @@
<artifactId>maven-dependency-plugin</artifactId>
<executions>
- <execution>
- <id>copy-sars</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-enterprise-server-services-sar</artifactId>
- <version>${project.version}</version>
- <type>sar</type>
- </artifactItem>
-
- <!--
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-enterprise-server-agent-sar</artifactId>
- <version>${project.version}</version>
- <type>sar</type>
- </artifactItem>
- -->
-
- </artifactItems>
- <outputDirectory>${earDirectory}</outputDirectory>
- <stripVersion>true</stripVersion>
- </configuration>
- </execution>
+ <!--<execution>-->
+ <!--<id>copy-sars</id>-->
+ <!--<phase>process-resources</phase>-->
+ <!--<goals>-->
+ <!--<goal>copy</goal>-->
+ <!--</goals>-->
+ <!--<configuration>-->
+ <!--<artifactItems>-->
+ <!--<artifactItem>-->
+ <!--<groupId>${project.groupId}</groupId>-->
+ <!--<artifactId>rhq-enterprise-server-agent-sar</artifactId>-->
+ <!--<version>${project.version}</version>-->
+ <!--<type>sar</type>-->
+ <!--</artifactItem>-->
+ <!--</artifactItems>-->
+ <!--<outputDirectory>${earDirectory}</outputDirectory>-->
+ <!--<stripVersion>true</stripVersion>-->
+ <!--</configuration>-->
+ <!--</execution>-->
<execution>
<id>copy-core-agent-plugins</id>
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index 6ee3b70..725f18f 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -28,7 +28,7 @@
<module>server-metrics</module>
<module>data-migration</module>
<module>jar</module>
- <module>sars</module>
+ <!--<module>sars</module>-->
<module>plugins</module>
<module>ear</module>
<module>startup-subsystem</module>
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml
index e9d63d5..1f3081e 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -33,7 +33,6 @@
<!--
<module>agent-sar</module>
-->
- <module>services-sar</module>
</modules>
<pluginRepositories>
diff --git a/modules/enterprise/server/sars/services-sar/pom.xml b/modules/enterprise/server/sars/services-sar/pom.xml
deleted file mode 100644
index 0ffd88d..0000000
--- a/modules/enterprise/server/sars/services-sar/pom.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.9.0-SNAPSHOT</version>
- </parent>
-
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-services-sar</artifactId>
- <packaging>jboss-sar</packaging>
-
- <name>RHQ Enterprise Server Internal Services SAR</name>
- <description>The SAR that provides the server with some necessary internal RHQ services.</description>
-
- <properties>
- <sarDirectory>${project.build.directory}/${project.build.finalName}</sarDirectory>
- </properties>
-
- <build>
- <finalName>rhq-enterprise-server-services-sar</finalName>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- </build>
-
- <profiles>
-
- <profile>
- <id>dev</id>
-
- <properties>
- <rhq.rootDir>../../../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.devContainerServerPath}</rhq.containerDir>
- <rhq.deploymentName>${project.build.finalName}.sar</rhq.deploymentName>
- <rhq.deploymentDir>${rhq.containerDir}/${rhq.earDeployDir}/${rhq.deploymentName}</rhq.deploymentDir>
- </properties>
-
- <build>
- <plugins>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
-
- <execution>
- <id>deploy</id>
- <phase>package</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Copying updated files
- from
- target${file.separator}classes${file.separator}
- to
- ${deployment.dir}${file.separator}...</echo>
- <jar destfile="${deployment.dir}">
- <fileset dir="target/${project.build.finalName}" />
- </jar>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Deleting ${deployment.dir}${file.separator}...</echo>
- <delete file="${deployment.dir}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
-
- </plugins>
- </build>
-
- </profile>
-
- </profiles>
-
-</project>
diff --git a/modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml b/modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml
deleted file mode 100644
index c427db8..0000000
--- a/modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server xmlns="urn:jboss:service:7.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">
-
- <!--<mbean code="org.rhq.enterprise.server.core.CustomJaasDeploymentService"-->
- <!--name="rhq:service=CustomJaasDeployment" />-->
-
- <!--<mbean code="org.rhq.enterprise.server.core.CoreServer"-->
- <!--name="rhq:service=CoreServer" />-->
-
- <!--<mbean code="org.rhq.enterprise.server.measurement.instrumentation.MeasurementMonitor"-->
- <!--name="rhq:service=MeasurementMonitor" />-->
-
- <!--<mbean code="org.rhq.enterprise.server.alert.engine.mbean.AlertConditionCacheMonitor"-->
- <!--name="rhq:service=AlertConditionCacheMonitor" />-->
-
- <!--<mbean code="org.rhq.enterprise.server.resource.group.definition.mbean.GroupDefinitionRecalculationThreadMonitor"-->
- <!--name="rhq:service=GroupDefinitionRecalculationThreadMonitor" />-->
-
- <!--<mbean code="org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner"-->
- <!--name="rhq:service=PluginDeploymentScanner">-->
- <!--<attribute name="ScanPeriod">${rhq.server.plugin-scan-period-ms:300000}</attribute>-->
- <!--</mbean>-->
-
- <!--<mbean code="org.rhq.enterprise.server.scheduler.SchedulerService"-->
- <!--name="rhq:service=scheduler">-->
- <!--<attribute name="QuartzProperties">-->
-<!--# RHQ custom property that defines the default timeout for all operations.-->
-<!--# This is specified in seconds. If any operation takes longer than this, it is assumed to have failed.-->
-<!--rhq.server.operation-timeout = ${rhq.server.operation-timeout:600}-->
-
-<!--# scheduler factory config-->
-<!--org.quartz.scheduler.instanceName = RHQScheduler-->
-<!--org.quartz.scheduler.instanceId = AUTO-->
-
-<!--# thread pool config-->
-<!--org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool-->
-<!--org.quartz.threadPool.threadCount = 5-->
-
-<!--# database config-->
-<!--# note that the delegate class property should be set at build/installation time-->
-<!--org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT-->
-<!--org.quartz.jobStore.driverDelegateClass = ${rhq.server.quartz.driverDelegateClass}-->
-<!--org.quartz.jobStore.isClustered = true-->
-<!--org.quartz.jobStore.clusterCheckinInterval = 30000-->
-<!--org.quartz.jobStore.tablePrefix = RHQ_QRTZ_-->
-<!--org.quartz.jobStore.useProperties = true-->
-<!--org.quartz.jobStore.selectWithLockSQL = ${rhq.server.quartz.selectWithLockSQL}-->
-<!--org.quartz.jobStore.dataSource = RHQDS-->
-<!--org.quartz.dataSource.RHQDS.jndiURL = java:jboss/datasources/RHQDS-->
-<!--org.quartz.dataSource.RHQDS.maxConnections = 10-->
-<!--org.quartz.jobStore.nonManagedTXDataSource = NoTxRHQDS-->
-<!--org.quartz.dataSource.NoTxRHQDS.jndiURL = java:jboss/datasources/NoTxRHQDS-->
-<!--org.quartz.dataSource.NoTxRHQDS.maxConnections = 10-->
-<!--org.quartz.jobStore.lockHandler.class = ${rhq.server.quartz.lockHandlerClass}-->
- <!--</attribute>-->
- <!--</mbean>-->
-
- <!--<mbean code="org.rhq.enterprise.server.core.comm.ServerCommunicationsService"-->
- <!--name="rhq:service=ServerCommunications" />-->
-
- <!--<mbean code="org.rhq.enterprise.server.plugin.pc.ServerPluginService"-->
- <!--name="rhq:service=ServerPluginService" />-->
-
- <!-- TODO: first, see if we need this and if so we need to refactor this to work inside AS7
- <mbean code="org.rhq.jndi.mbean.AccessCheckingInitialContextFactoryBuilderInstaller"
- name="org.rhq:service=AccessCheckingInitialContextFactoryBuilderInstaller" />
- -->
-</server>
10 years, 10 months