[rhq] modules/core
by John Sanda
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftInputStream.java | 93 ++++++
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java | 78 ++++-
modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftManagerTest.java | 133 ++++++++--
3 files changed, 270 insertions(+), 34 deletions(-)
New commits:
commit 66085d0afba8abd80f7288924ec1b34c2b7f7043
Author: John Sanda <jsanda(a)redhat.com>
Date: Fri Aug 26 13:53:47 2011 -0400
Updating clean up code in DriftManager to not delete files until streams are closed
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftInputStream.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftInputStream.java
new file mode 100644
index 0000000..126ab58
--- /dev/null
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftInputStream.java
@@ -0,0 +1,93 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 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.core.pc.drift;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * DriftInputStream is a simple wrapper the delegates to another input stream and executes
+ * a task after the underlying stream is closed. {@link DriftManager} uses this class to perform
+ * clean up after streaming change set reports and change set content to the server.
+ */
+// TODO come up with a better, more intuitive class name
+public class DriftInputStream extends InputStream {
+
+ private InputStream stream;
+
+ private Runnable cleanupTask;
+
+ /**
+ * Createa a new DriftInputStream.
+ *
+ * @param stream The stream to which this object delegates all calls
+ * @param cleanupTask A task to execute immediately after the stream is closed
+ */
+ public DriftInputStream(InputStream stream, Runnable cleanupTask) {
+ this.stream = stream;
+ this.cleanupTask = cleanupTask;
+ }
+
+ @Override
+ public int read() throws IOException {
+ return stream.read();
+ }
+
+ @Override
+ public int read(byte[] b) throws IOException {
+ return stream.read(b);
+ }
+
+ @Override
+ public int read(byte[] b, int off, int len) throws IOException {
+ return stream.read(b, off, len);
+ }
+
+ @Override
+ public long skip(long n) throws IOException {
+ return stream.skip(n);
+ }
+
+ @Override
+ public int available() throws IOException {
+ return stream.available();
+ }
+
+ @Override
+ public void close() throws IOException {
+ stream.close();
+ cleanupTask.run();
+ }
+
+ @Override
+ public void mark(int readlimit) {
+ stream.mark(readlimit);
+ }
+
+ @Override
+ public void reset() throws IOException {
+ stream.reset();
+ }
+
+ @Override
+ public boolean markSupported() {
+ return stream.markSupported();
+ }
+}
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
index a3512dc..4bffe9e 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
@@ -24,7 +24,6 @@ import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
-import java.io.FilenameFilter;
import java.io.IOException;
import java.util.List;
import java.util.Set;
@@ -52,7 +51,6 @@ import org.rhq.core.pc.inventory.ResourceContainer;
import org.rhq.core.pc.measurement.MeasurementManager;
import org.rhq.core.util.stream.StreamUtil;
-import static org.rhq.core.util.ZipUtil.zipFileOrDirectory;
import static org.rhq.core.util.file.FileUtil.purge;
public class DriftManager extends AgentService implements DriftAgentService, DriftClient, ContainerService {
@@ -130,6 +128,15 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
/**
* This method is provided as a test hook.
+ *
+ * @param changeSetMgr
+ */
+ void setChangeSetMgr(ChangeSetManager changeSetMgr) {
+ this.changeSetMgr = changeSetMgr;
+ }
+
+ /**
+ * This method is provided as a test hook.
* @return The schedule queue
*/
ScheduleQueue getSchedulesQueue() {
@@ -165,12 +172,29 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
DriftServerService driftServer = pluginContainerConfiguration.getServerServices().getDriftServerService();
// TODO Include the version in the change set file name to ensure the file name is unique
- File zipFile = new File(pluginContainerConfiguration.getTemporaryDirectory(), "changeset-" + resourceId
- + driftConfiguration.getName() + ".zip");
- zipFileOrDirectory(changeSetFile, zipFile);
+ String fileName = "changeset_" + System.currentTimeMillis() + ".zip";
+ final File zipFile = new File(changeSetFile.getParentFile(), fileName);
+ ZipOutputStream stream = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile)));
+
+ FileInputStream fis = new FileInputStream(changeSetFile);
+ stream.putNextEntry(new ZipEntry(changeSetFile.getName()));
+ StreamUtil.copy(fis, stream, false);
+ fis.close();
+ stream.close();
+
+ // We want to clean up after we send the zip file to the server. We do this by
+ // deleting the files in the content directory and the content zip itself. They
+ // are no longer needed after being sent to the server. We cannot immediately
+ // delete the content zip file though because it is sent asynchronously, and we
+ // wind up deleting it before it is sent. The following approach allows us to
+ // safely delete it when the comm layer closes the remote input stream.
+ //
+ // jsanda
+ DriftInputStream inputStream = new DriftInputStream(new BufferedInputStream(new FileInputStream(zipFile)),
+ new DeleteFile(zipFile));
+
+ driftServer.sendChangesetZip(resourceId, zipFile.length(), remoteInputStream(inputStream));
- driftServer.sendChangesetZip(resourceId, zipFile.length(), remoteInputStream(new BufferedInputStream(
- new FileInputStream(zipFile))));
} catch (IOException e) {
log.error("An error occurred while trying to send changeset[resourceId: " + resourceId
+ ", driftConfiguration: " + driftConfiguration.getName() + "]", e);
@@ -180,17 +204,11 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
@Override
public void sendChangeSetContentToServer(int resourceId, String driftConfigurationName, final File contentDir) {
try {
- File zipFile = new File(contentDir, "content.zip");
+ String contentFileName = "content_" + System.currentTimeMillis() + ".zip";
+ final File zipFile = new File(contentDir.getParentFile(), contentFileName);
ZipOutputStream stream = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile)));
- FilenameFilter contentZipFilter = new FilenameFilter() {
- @Override
- public boolean accept(File dir, String name) {
- return dir.equals(contentDir) && !name.equals("content.zip");
- }
- };
-
- for (File file : contentDir.listFiles(contentZipFilter)) {
+ for (File file : contentDir.listFiles()) {
FileInputStream fis = new FileInputStream(file);
stream.putNextEntry(new ZipEntry(file.getName()));
StreamUtil.copy(fis, stream, false);
@@ -198,9 +216,19 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
}
stream.close();
+ // We want to clean up after we send the zip file to the server. We do this by
+ // deleting the files in the content directory and the content zip itself. They
+ // are no longer needed after being sent to the server. We cannot immediately
+ // delete the content zip file though because it is sent asynchronously, and we
+ // wind up deleting it before it is sent. The following approach allows us to
+ // safely delete it when the comm layer closes the remote input stream.
+ //
+ // jsanda
+ DriftInputStream inputStream = new DriftInputStream(new BufferedInputStream(new FileInputStream(zipFile)),
+ new DeleteFile(zipFile));
+
DriftServerService driftServer = pluginContainerConfiguration.getServerServices().getDriftServerService();
- driftServer.sendFilesZip(resourceId, zipFile.length(), remoteInputStream(new BufferedInputStream(
- new FileInputStream(zipFile))));
+ driftServer.sendFilesZip(resourceId, zipFile.length(), remoteInputStream(inputStream));
} catch (IOException e) {
log.error("An error occurred while trying to send content for changeset[resourceId: " + resourceId
+ ", driftConfiguration: " + driftConfigurationName + "]", e);
@@ -381,4 +409,18 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
protected MeasurementManager getMeasurementManager() {
return PluginContainer.getInstance().getMeasurementManager();
}
+
+ private static class DeleteFile implements Runnable {
+
+ private File file;
+
+ public DeleteFile(File file) {
+ this.file = file;
+ }
+
+ @Override
+ public void run() {
+ file.delete();
+ }
+ }
}
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftManagerTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftManagerTest.java
index 5a53ee6..226e84b 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftManagerTest.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftManagerTest.java
@@ -20,6 +20,7 @@
package org.rhq.core.pc.drift;
import java.io.File;
+import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
@@ -31,6 +32,8 @@ import org.rhq.core.domain.drift.DriftConfiguration;
import org.rhq.core.pc.PluginContainerConfiguration;
import org.rhq.core.pc.ServerServices;
+import static org.apache.commons.io.FileUtils.deleteDirectory;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
import static org.rhq.core.util.ZipUtil.unzipFile;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
@@ -64,15 +67,72 @@ public class DriftManagerTest extends DriftTest {
driftMgr.setConfiguration(pcConfig);
}
-// @AfterMethod
-// public void shutDownDriftManager() {
-// driftMgr.shutdown();
-// }
+ @Test
+ public void writeChangeSetZipFileToChangeSetDirectory() throws Exception {
+ final DriftConfiguration config = driftConfiguration("write-changeset-file", resourceDir.getAbsolutePath());
+ final File changeSetDir = changeSetDir(config.getName());
+ createRandomFile(changeSetDir, "changeset.txt");
+
+ setDriftServiceCallback(new DriftServiceCallback() {
+ @Override
+ public void execute() {
+ assertThatZipFileExists(changeSetDir, "changeset_",
+ "Expected to find change set zip file " +
+ "in " + changeSetDir.getPath() + ". The file name should follow the pattern " +
+ "changeset_<integer_timestamp>.zip");
+ }
+ });
+
+ driftMgr.setChangeSetMgr(changeSetMgr);
+ driftMgr.getSchedulesQueue().addSchedule(new DriftDetectionSchedule(resourceId(), config));
+ driftMgr.sendChangeSetToServer(resourceId(), config, COVERAGE);
+ }
+
+ @Test
+ public void sendChangeSetReportInZipFile() throws Exception {
+ final DriftConfiguration config = driftConfiguration("send-changeset-in-zip", resourceDir.getAbsolutePath());
+ final File changeSetDir = changeSetDir(config.getName());
+ final File changeSetFile = createRandomFile(changeSetDir, "changeset.txt");
+
+ setDriftServiceCallback(new DriftServiceCallback() {
+ @Override
+ public void execute() {
+ assertZipFileMatches(driftServerService.inputStream, changeSetFile);
+ }
+ });
+
+ driftMgr.setChangeSetMgr(changeSetMgr);
+ driftMgr.getSchedulesQueue().addSchedule(new DriftDetectionSchedule(resourceId(), config));
+ driftMgr.sendChangeSetToServer(resourceId(), config, COVERAGE);
+ }
+
+ @Test
+ public void cleanUpAfterSendingChangeSetToServer() throws Exception {
+ final DriftConfiguration config = driftConfiguration("send-changeset-in-zip", resourceDir.getAbsolutePath());
+ final File changeSetDir = changeSetDir(config.getName());
+ createRandomFile(changeSetDir, "changeset.txt");
+
+ driftMgr.setChangeSetMgr(changeSetMgr);
+ driftMgr.getSchedulesQueue().addSchedule(new DriftDetectionSchedule(resourceId(), config));
+ driftMgr.sendChangeSetToServer(resourceId(), config, COVERAGE);
+
+ // clean up should not happen until after the input stream is closed. The remote
+ // input stream is consumed asynchronously; so, we have to wait until the stream
+ // is closed. We could otherwise disrupt the transmission of bits.
+
+ File changeSetZip = assertThatZipFileExists(changeSetDir, "changeset_", "Expected to find change set zip " +
+ "zip file in " + changeSetDir.getPath() + ". The file name should follow the pattern " +
+ "changeset_<integer_timestamp>.zip");
+
+ driftServerService.inputStream.close();
+
+ assertFalse(changeSetZip.exists(), "The change set zip should be deleted when the remote input stream is closed.");
+ }
@Test
public void writeContentZipFileToChangeSetContentDirectory() throws Exception {
String configName = "send-content-in-zip";
- File changeSetDir = changeSetDir(configName);
+ final File changeSetDir = changeSetDir(configName);
final File contentDir = mkdir(changeSetDir, "content");
createRandomFile(contentDir, "content-1");
@@ -81,9 +141,9 @@ public class DriftManagerTest extends DriftTest {
setDriftServiceCallback(new DriftServiceCallback() {
@Override
public void execute() {
- File contentZip = new File(contentDir, "content.zip");
- assertTrue(contentZip.exists(), "Expected content zip file to be written to the change set content " +
- "directory: " + contentDir.getPath());
+ assertThatZipFileExists(changeSetDir, "content_", "Expected to find content zip file in " +
+ changeSetDir.getPath() + ". The file name should follow the pattern " +
+ "content_<integer_timestamp>.zip");
}
});
@@ -102,7 +162,7 @@ public class DriftManagerTest extends DriftTest {
setDriftServiceCallback(new DriftServiceCallback() {
@Override
public void execute() {
- assertZipFileMatches(driftServerService.filesZipStream, content1, content2);
+ assertZipFileMatches(driftServerService.inputStream, content1, content2);
}
});
@@ -120,6 +180,16 @@ public class DriftManagerTest extends DriftTest {
driftMgr.sendChangeSetContentToServer(resourceId(), configName, contentDir);
+ // clean up should not happen until after the input stream is closed. The remote
+ // input stream is consumed asynchronously; so, we have to wait until the stream
+ // is closed. We could otherwise disrupt the transmission of bits.
+ File contentZipFile = assertThatZipFileExists(changeSetDir, "content_",
+ "Expected to find content zip file in " +
+ changeSetDir.getPath() + ". The file name should have a pattern of content_integer_timestamp>.zip");
+
+ driftServerService.inputStream.close();
+
+ assertFalse(contentZipFile.exists(), "The content zip should be deleted when the remote input stream is closed");
assertThatDirectoryIsEmpty(contentDir);
}
@@ -183,9 +253,11 @@ public class DriftManagerTest extends DriftTest {
private void assertZipFileMatches(InputStream zipStream, File... expectedFiles) {
File zipDir = new File(tmpDir, "output");
try {
+ deleteDirectory(zipDir);
+ zipDir.mkdirs();
unzipFile(zipStream, zipDir);
} catch (IOException e) {
- fail("Failed to unzip zip file from intput stream into " + zipDir.getPath(), e);
+ fail("An error occurred while trying to unzip " + zipDir.getPath(), e);
}
assertEquals(zipDir.listFiles().length, expectedFiles.length, "The zip file has the wrong number of files");
@@ -217,6 +289,28 @@ public class DriftManagerTest extends DriftTest {
}
/**
+ * This method searches the specified directory for a zip file with the specified
+ * prefix. The file name must start with the prefix and end with an extension of .zip.
+ * This method assumes that there should be one and only one match. If there is not
+ * exactly one match, it will fail the test.
+ *
+ * @param dir The directory to search (sub directories are not searched)
+ * @param fileNamePrefix The zip file name prefix
+ * @param msg An error message
+ * @return The matching zip file
+ */
+ private File assertThatZipFileExists(final File dir, final String fileNamePrefix, String msg) {
+ File[] files = dir.listFiles(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return name.startsWith(fileNamePrefix) && name.endsWith(".zip");
+ }
+ });
+ assertEquals(files.length, 1, msg);
+ return files[0];
+ }
+
+ /**
* Sets a callback that will be invoked immediately after DriftManager calls
* {@link DriftServerService#sendChangesetZip(int, long, java.io.InputStream)} or
* {@link DriftServerService#sendFilesZip(int, long, java.io.InputStream)}. The callback
@@ -231,21 +325,28 @@ public class DriftManagerTest extends DriftTest {
private static class TestDriftServerService implements DriftServerService {
- public int filesZipResourceId;
- public long filesZipSize;
- public InputStream filesZipStream;
+ public int resourceId;
+ public long fileSize;
+ public InputStream inputStream;
public DriftServiceCallback callback;
@Override
public void sendChangesetZip(int resourceId, long zipSize, InputStream zipStream) {
+ this.resourceId = resourceId;
+ fileSize = zipSize;
+ inputStream = zipStream;
+
+ if (callback != null) {
+ callback.execute();
+ }
}
@Override
public void sendFilesZip(int resourceId, long zipSize, InputStream zipStream) {
- filesZipResourceId = resourceId;
- filesZipSize = zipSize;
- filesZipStream = zipStream;
+ this.resourceId = resourceId;
+ fileSize = zipSize;
+ inputStream = zipStream;
if (callback != null) {
callback.execute();
12 years, 8 months
[rhq] 5 commits - modules/plugins
by snegrea
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java | 93 ++
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java | 24
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java | 21
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java | 58 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java | 39 -
modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml | 2
modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java | 49 +
modules/plugins/mod-cluster/src/test/resources/xml_config/mod_cluster-jboss-beans.xml | 337 ++++++++++
modules/plugins/mod-cluster/src/test/resources/xml_config/server.xml | 157 ++++
9 files changed, 733 insertions(+), 47 deletions(-)
New commits:
commit 300308759921d5cc2315dbb85b49a29e9f0983c3
Merge: 5956151 8db63e0
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 18:29:29 2011 -0500
Merge branch 'mod_cluster_plugin'
commit 8db63e00ec03b5c0257925becda0b984351b6664
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 18:27:05 2011 -0500
Refactoring configuration file classes to accept files in the constructor to allow testing. Also, added basic configuration files for testing.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
index dee2f81..d49ce88 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -39,11 +39,16 @@ import org.xml.sax.SAXException;
* @author Stefan Negrea
*/
public abstract class AbstractConfigurationFile {
- private String fileName;
+ private File configurationFile;
private Document document;
public AbstractConfigurationFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
- this.fileName = fileName;
+ this(new File(fileName));
+ }
+
+ public AbstractConfigurationFile(File configurationFile) throws ParserConfigurationException, SAXException,
+ IOException {
+ this.configurationFile = configurationFile;
loadConfiguratonFile();
}
@@ -53,13 +58,6 @@ public abstract class AbstractConfigurationFile {
abstract String getPropertyValue(String propertyName);
/**
- * @return the fileName
- */
- public String getFileName() {
- return fileName;
- }
-
- /**
* @return the doc
*/
public Document getDocument() {
@@ -67,8 +65,7 @@ public abstract class AbstractConfigurationFile {
}
public void saveConfigurationFile() throws Exception {
- File file = new File(this.getFileName());
- StreamResult result = new StreamResult(file);
+ StreamResult result = new StreamResult(this.configurationFile);
Source source = new DOMSource(this.getDocument());
Transformer transformer = TransformerFactory.newInstance().newTransformer();
@@ -79,6 +76,6 @@ public abstract class AbstractConfigurationFile {
private void loadConfiguratonFile() throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
- this.document = docBuilder.parse(this.getFileName());
+ this.document = docBuilder.parse(this.configurationFile);
}
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 45204e1..01f992e 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -19,6 +19,7 @@
package org.rhq.plugins.modcluster.config;
+import java.io.File;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
@@ -47,6 +48,12 @@ public class JBossWebServerFile extends AbstractConfigurationFile {
listenerNode = this.getListenerNode();
}
+ public JBossWebServerFile(File configurationFile) throws ParserConfigurationException, SAXException, IOException {
+ super(configurationFile);
+
+ listenerNode = this.getListenerNode();
+ }
+
@Override
public void setPropertyValue(String propertyName, String value) {
NamedNodeMap attributeList = listenerNode.getAttributes();
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index c2cf3a8..9ff7752 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -18,6 +18,7 @@
*/
package org.rhq.plugins.modcluster.config;
+import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -44,7 +45,19 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @throws SAXException
* @throws IOException
*/
- public ModClusterBeanFile(String className, String configurationFile) throws ParserConfigurationException,
+ public ModClusterBeanFile(String className, String configurationFileName) throws ParserConfigurationException,
+ SAXException, IOException {
+ this(className, new File(configurationFileName));
+ }
+
+ /**
+ * @param className
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, File configurationFile) throws ParserConfigurationException,
SAXException, IOException {
super(configurationFile);
@@ -59,7 +72,20 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @throws SAXException
* @throws IOException
*/
- public ModClusterBeanFile(String className, String constructorArgumentClassName, String configurationFile)
+ public ModClusterBeanFile(String className, String constructorArgumentClassName, String configurationFileName)
+ throws ParserConfigurationException, SAXException, IOException {
+ this(className, constructorArgumentClassName, new File(configurationFileName));
+ }
+
+ /**
+ * @param className
+ * @param constructorArgumentClassName
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, String constructorArgumentClassName, File configurationFile)
throws ParserConfigurationException, SAXException, IOException {
super(configurationFile);
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index b8fca4c..871b082 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -18,6 +18,9 @@
*/
package org.rhq.plugins.modcluster.test;
+import java.io.File;
+import java.net.URL;
+
import org.testng.annotations.Test;
import org.rhq.plugins.modcluster.config.JBossWebServerFile;
@@ -26,12 +29,12 @@ import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
public class ServerConfigTest {
@Test
- public void TestModClusterConfig() {
-
+ public void TestSimpleBeanModClusterConfig() {
try {
- //Test simple bean configuration
- ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ URL testConfigURL = getClass().getResource("/xml_config/mod_cluster-jboss-beans.xml");
+ File testFile = new File(testConfigURL.toURI());
+
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService", testFile);
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
@@ -40,11 +43,19 @@ public class ServerConfigTest {
config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void TestBeanWithDependenciesModClusterConfig() {
+ try {
+ URL testConfigURL = getClass().getResource("/xml_config/mod_cluster-jboss-beans.xml");
+ File testFile = new File(testConfigURL.toURI());
- //Test bean configuration with constructor dependency
- config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
- "org.jboss.modcluster.config.ha.HAModClusterConfig",
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
+ "org.jboss.modcluster.config.ha.HAModClusterConfig", testFile);
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
@@ -53,18 +64,17 @@ public class ServerConfigTest {
config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
} catch (Exception e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
@Test
public void TestJBossWebConfig() {
-
try {
- //Test simple bean configuration
- JBossWebServerFile config = new JBossWebServerFile(
- "/home/snegrea/Downloads/jboss42/server/all/deploy/jboss-web.deployer/server.xml");
+ URL testConfigURL = getClass().getResource("/xml_config/server.xml");
+ File testFile = new File(testConfigURL.toURI());
+
+ JBossWebServerFile config = new JBossWebServerFile(testFile);
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
@@ -74,7 +84,6 @@ public class ServerConfigTest {
config.saveConfigurationFile();
} catch (Exception e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
diff --git a/modules/plugins/mod-cluster/src/test/resources/xml_config/mod_cluster-jboss-beans.xml b/modules/plugins/mod-cluster/src/test/resources/xml_config/mod_cluster-jboss-beans.xml
new file mode 100644
index 0000000..1ef344b
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/test/resources/xml_config/mod_cluster-jboss-beans.xml
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ Beans that provide JBoss AS-side functionality for mod_cluster. These
+ beans are all "On Demand", i.e. that are not installed unless requested.
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- Entry point: catalina lifecycle listener -->
+ <bean class="org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter" name="ModClusterListener">
+ <constructor>
+ <parameter class="org.jboss.modcluster.ContainerEventHandler">
+<inject bean="HAModClusterService"/>
+</parameter>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ </constructor>
+ <depends>WebServer</depends>
+ </bean>
+
+ <!-- The core mod_cluster service -->
+ <bean class="org.jboss.modcluster.ModClusterService" mode="On Demand" name="ModClusterService">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ModClusterServiceMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.config.ModClusterConfig">
+<inject bean="ModClusterConfig"/>
+</parameter>
+ <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider">
+<inject bean="DynamicLoadBalanceFactorProvider"/>
+</parameter>
+ </constructor>
+ </bean>
+
+ <!-- The core mod_cluster service, implemented as an HA singleton -->
+ <bean class="org.jboss.modcluster.ha.HAModClusterService" mode="On Demand" name="HAModClusterService">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ha.HAModClusterServiceMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.config.ha.HAModClusterConfig">
+<inject bean="ModClusterConfig"/>
+</parameter>
+ <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider">
+<inject bean="DynamicLoadBalanceFactorProvider"/>
+</parameter>
+ <parameter class="org.jboss.ha.framework.interfaces.HAPartition">
+<inject bean="HAPartition"/>
+</parameter>
+ <parameter class="org.jboss.ha.framework.interfaces.HASingletonElectionPolicy">
+<bean class="org.jboss.ha.singleton.HASingletonElectionPolicySimple"/>
+</parameter>
+ </constructor>
+
+</bean>
+
+ <!-- Configure this node's communication with the load balancer -->
+ <bean class="org.jboss.modcluster.config.ha.HAModClusterConfig" mode="On Demand" name="ModClusterConfig">
+
+ <!-- Comma separated list of address:port listing the httpd servers
+ where mod_cluster is running. -->
+ <property name="proxyList">${jboss.mod_cluster.proxyList,jboss.modcluster.proxyList:}</property>
+ <!-- URL prefix to send with commands to mod_cluster. Default is no prefix. -->
+ <!--property name="proxyURL"></property-->
+
+ <!-- mod_advertise is a small httpd module that advertises the
+ availability of httpd servers via multicast, allowing
+ ModClusterService to discover the httpd front-end instead of/in
+ addition to having them defined in proxyList. -->
+ <!-- Whether to listen for advertise messages -->
+ <property name="advertise">${jboss.mod_cluster.advertise:true}</property>
+ <!-- Multicast address on which to listen for advertisements -->
+ <property name="advertiseGroupAddress">${jboss.mod_cluster.advertise.address,jboss.modcluster.advertise.address,jboss.partition.udpGroup:224.0.1.105}</property>
+ <!-- Port to listen to for advertisements -->
+ <property name="advertisePort">${jboss.mod_cluster.advertise.port,jboss.modcluster.advertise.port:23364}</property>
+
+ <!-- Comma delimited list of contexts that should *not* be auto-registered with httpd. -->
+ <!-- ROOT indicates the root context. -->
+ <!-- Context may be qualified by host using a colon, e.g. host1:context1 -->
+ <!-- If no host is defined, localhost is assumed. -->
+ <property name="excludedContexts">${jboss.mod_cluster.excludedContexts,jboss.modcluster.excludedContexts:ROOT,admin-console,invoker,jbossws,jmx-console}</property>
+ <property name="autoEnableContexts">${jboss.mod_cluster.autoEnableContexts:true}</property>
+
+ <!-- Security key the proxy is going to send with advertise messages.
+ Default is none. -->
+ <!--property name="advertiseSecurityKey"></property-->
+
+ <!-- Whether to use SSL to communicate with mod_cluster. Note this
+ has nothing to do with handling of https requests by JBoss Web -->
+ <property name="ssl">false</property>
+
+ <!-- Configuration values for the load balancer itself (must be the
+ same on all nodes in the cluster). These will be passed to the
+ load balancer. -->
+ <property name="stickySession">true</property>
+ <property name="stickySessionForce">false</property>
+ <property name="stickySessionRemove">false</property>
+ <property name="maxAttempts">1</property>
+ <property name="workerTimeout">-1</property>
+ </bean>
+
+ <!-- Provides information to ModClusterService informing it how much load
+ this server should take. This impl calculates load factor from a
+ number of metrics and adjusts the value periodically based on runtime
+ conditions, using to the JBossWeb engine's backgroundProcessorDelay. -->
+ <bean class="org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProvider" mode="On Demand" name="DynamicLoadBalanceFactorProvider">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor",exposedInterface=org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProviderMBean.class)</annotation>
+ <constructor>
+ <parameter>
+ <!-- Define the load metrics to use in your load balance factor calculation here -->
+ <set elementClass="org.jboss.modcluster.load.metric.LoadMetric">
+ <inject bean="BusyConnectorsLoadMetric"/>
+ <inject bean="HeapMemoryUsageLoadMetric"/>
+ </set>
+ </parameter>
+ </constructor>
+ <!-- The number of historical load values used to determine load factor -->
+ <!--property name="history">9</property-->
+ <!-- The exponential decay factor for historical load values -->
+ <!--property name="decayFactor">2</property-->
+ </bean>
+
+ <!-- Default load metrics/sources -->
+ <!-- The JBossWeb connector thread pool usage as a ratio of busy threads to max thread pool size -->
+ <!-- Analogous to method=B in mod_jk -->
+ <bean class="org.jboss.modcluster.load.metric.impl.BusyConnectorsLoadMetric" mode="On Demand" name="BusyConnectorsLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=BusyConnectors",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="ThreadPoolLoadMetricSource"/>
+</parameter>
+ </constructor>
+ <!-- The weight determines the significance of this metric with respect
+ to others in the overall load balance factor calculation -->
+ <property name="weight">2</property>
+ </bean>
+ <!-- Queries all JBossWeb ThreadPool mbeans -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ThreadPoolLoadMetricSource" mode="On Demand" name="ThreadPoolLoadMetricSource">
+ <constructor>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ <!-- Object name pattern for connector thread pools -->
+ <!--parameter>jboss.web:type=ThreadPool,*</parameter-->
+ </constructor>
+ </bean>
+
+ <!-- The heap memory usage as a ratio of used heap to max heap size -->
+ <!-- N.B. This load metric is its own source -->
+ <bean class="org.jboss.modcluster.load.metric.impl.HeapMemoryUsageLoadMetric" mode="On Demand" name="HeapMemoryUsageLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=HeapMemoryUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <!--property name="weight">1</property-->
+ </bean>
+
+
+ <!-- Alternative load balance factor providers -->
+
+ <!-- Basic impl that returns a static load balance factor.
+ This would replace the DynamicLoadBalanceFactorProvider
+ used above.
+ -->
+ <bean class="org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProvider" mode="On Demand" name="SimpleLoadBalanceFactorProvider">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor",exposedInterface=org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProviderMBean.class)</annotation>
+ <property name="loadBalanceFactor">1</property>
+ </bean>
+
+ <!--
+ Alternative load metrics, grouped by source.
+ To use these, inject them into the set passed to the
+ DynamicLoadBalanceFactorProvider bean's constructor above.
+ -->
+
+ <!-- CPU usage -->
+ <!-- Perhaps the best metric for determining system load - but only available on Java 1.6 or later -->
+ <bean class="org.jboss.modcluster.load.metric.impl.AverageSystemLoadMetric" mode="On Demand" name="AverageSystemLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=AverageSystemLoad",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="OperatingSystemLoadMetricSource"/>
+</parameter>
+ </constructor>
+ </bean>
+ <!-- The system memory usage as ratio of used memory to total memory size -->
+ <!-- Requires com.sun.management.OperatingSystemMXBean, i.e. Sun or OpenJDK JVM -->
+ <bean class="org.jboss.modcluster.load.metric.impl.SystemMemoryUsageLoadMetric" mode="On Demand" name="SystemMemoryUsageLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=SystemMemoryUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="OperatingSystemLoadMetricSource"/>
+</parameter>
+ </constructor>
+ </bean>
+ <!-- Uses the platform's OperatingSystemMXBean -->
+ <bean class="org.jboss.modcluster.load.metric.impl.OperatingSystemLoadMetricSource" mode="On Demand" name="OperatingSystemLoadMetricSource">
+ </bean>
+
+
+ <!-- The number of requests/sec processed by the JBossWeb connectors, with respect to the defined capacity -->
+ <!-- Analogous to method=R in mod_jk -->
+ <bean class="org.jboss.modcluster.load.metric.impl.RequestCountLoadMetric" mode="On Demand" name="RequestCountLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=RequestCount",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource">
+<inject bean="RequestProcessorLoadMetricSource"/>
+</parameter>
+ <!--parameter>requestCount</parameter-->
+ </constructor>
+ <!-- This metric requires an explicit capacity, e.g. maximum capacity of 1000 requests/sec -->
+ <property name="capacity">1000</property>
+ </bean>
+ <!-- The incoming traffic received by JBossWeb connectors in KB/sec, with respect to the defined capacity -->
+ <!-- Analogous to method=T in mod_jk -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ReceiveTrafficLoadMetric" mode="On Demand" name="ReceiveTrafficLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ReceiveTraffic",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource">
+<inject bean="RequestProcessorLoadMetricSource"/>
+</parameter>
+ <!--parameter>bytesReceived</parameter-->
+ </constructor>
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 1024 KB/s -->
+ <property name="capacity">1024</property>
+ </bean>
+ <!-- The outgoing traffic sent by JBossWeb connectors in KB/sec, with respect to the defined capacity -->
+ <bean class="org.jboss.modcluster.load.metric.impl.SendTrafficLoadMetric" mode="On Demand" name="SendTrafficLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=SendTraffic",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource">
+<inject bean="RequestProcessorLoadMetricSource"/>
+</parameter>
+ <!--parameter>bytesSent</parameter-->
+ </constructor>
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 512 KB/s -->
+ <property name="capacity">512</property>
+ </bean>
+ <!-- Queries all JBossWeb GlobalRequestProcessor mbeans -->
+ <bean class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource" mode="On Demand" name="RequestProcessorLoadMetricSource">
+ <constructor>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ <!-- Object name pattern for request processors -->
+ <!--parameter>jboss.web:type=GlobalRequestProcessor,*</parameter-->
+ </constructor>
+ </bean>
+
+
+ <!-- The number of active sessions, with respect to the defined capacity -->
+ <!-- Analogous to method=S in mod_jk -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ActiveSessionsLoadMetric" mode="On Demand" name="ActiveSessionsLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ActiveSessions",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="SessionLoadMetricSource"/>
+</parameter>
+ <!--parameter>activeSessions</parameter-->
+ </constructor>
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 1000 active sessions -->
+ <property name="capacity">1000</property>
+ </bean>
+ <!-- Queries all JBossWeb session manager mbeans -->
+ <bean class="org.jboss.modcluster.load.metric.impl.SessionLoadMetricSource" mode="On Demand" name="SessionLoadMetricSource">
+ <constructor>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ <!-- Object name pattern for session managers -->
+ <!--parameter>jboss.web:type=Manager,*</parameter-->
+ </constructor>
+ </bean>
+
+
+ <!-- Returns the connection pool usage as a ratio of used to max pool size -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ConnectionPoolUsageLoadMetric" mode="On Demand" name="ConnectionPoolUsageMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ConnectionPoolUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="ConnectionPoolLoadMetricSource"/>
+</parameter>
+ <!--parameter>InUseConnectionCount</parameter-->
+ <!--parameter>MaxSize</parameter-->
+ </constructor>
+ </bean>
+ <!-- Queries all JCA connection pools -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ConnectionPoolLoadMetricSource" mode="On Demand" name="ConnectionPoolLoadMetricSource">
+ <constructor>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ <!-- Object name pattern for connector thread pools -->
+ <!--parameter>jboss.jca:service=ManagedConnectionPool,*</parameter-->
+ </constructor>
+ </bean>
+
+ <!-- Generic load metrics/sources -->
+
+ <!-- Uses the sum of the values of the specified attribute for each
+ mbean matching the query, with respect to a defined capacity. -->
+ <bean class="org.jboss.modcluster.load.metric.impl.MBeanAttributeLoadMetric" mode="On Demand" name="MBeanAttributeLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=MBeanAttribute",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="MBeanQueryLoadMetricSource"/>
+</parameter>
+ <parameter>
+<!-- mbean attribute -->
+</parameter>
+ </constructor>
+ <property name="capacity">1</property>
+ </bean>
+ <!-- Uses the ratio of the sum of the values of the specified dividend attribute,
+ to the sum of the values of the specified divisor attribute for each mbean
+ matching the query. -->
+ <bean class="org.jboss.modcluster.load.metric.impl.MBeanAttributeRatioLoadMetric" mode="On Demand" name="MBeanAttributeRatioLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=MBeanAttributeRatio",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="MBeanQueryLoadMetricSource"/>
+</parameter>
+ <parameter>
+<!-- dividend attribute -->
+</parameter>
+ <parameter>
+<!-- divisor attribute -->
+</parameter>
+ </constructor>
+ </bean>
+ <!-- Queries for mbeans matching the specified pattern -->
+ <bean class="org.jboss.modcluster.load.metric.impl.MBeanQueryLoadMetricSource" mode="On Demand" name="MBeanQueryLoadMetricSource">
+ <constructor>
+ <parameter>
+<!-- ObjectName pattern -->
+</parameter>
+ <parameter>
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ </constructor>
+ </bean>
+
+</deployment>
diff --git a/modules/plugins/mod-cluster/src/test/resources/xml_config/server.xml b/modules/plugins/mod-cluster/src/test/resources/xml_config/server.xml
new file mode 100644
index 0000000..51fb479
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/test/resources/xml_config/server.xml
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<Server>
+
+ <Listener advertise="true" className="org.jboss.modcluster.catalina.ModClusterListener" smax="124"/>
+
+ <!--APR library loader. Documentation at /docs/apr.html -->
+ <Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
+ <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
+ <Listener className="org.apache.catalina.core.JasperListener"/>
+
+ <!-- Use a custom version of StandardService that allows the
+ connectors to be started independent of the normal lifecycle
+ start to allow web apps to be deployed before starting the
+ connectors.
+ -->
+ <Service name="jboss.web">
+
+ <!-- A "Connector" represents an endpoint by which requests are received
+ and responses are returned. Documentation at :
+ Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
+ Java AJP Connector: /docs/config/ajp.html
+ APR (HTTP/AJP) Connector: /docs/apr.html
+ Define a non-SSL HTTP/1.1 Connector on port 8080
+ -->
+ <Connector acceptCount="100" address="${jboss.bind.address}" connectionTimeout="20000" disableUploadTimeout="true" emptySessionPath="true" enableLookups="false" maxHttpHeaderSize="8192" maxThreads="250" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
+
+ <!-- Define a SSL HTTP/1.1 Connector on port 8443
+ This connector uses the JSSE configuration, when using APR, the
+ connector should be using the OpenSSL style configuration
+ described in the APR documentation -->
+ <!--
+ <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
+ maxThreads="150" scheme="https" secure="true"
+ clientAuth="false" sslProtocol="TLS" />
+ -->
+
+ <!-- Define an AJP 1.3 Connector on port 8009 -->
+ <Connector address="${jboss.bind.address}" emptySessionPath="true" enableLookups="false" port="8009" protocol="AJP/1.3" redirectPort="8443"/>
+
+ <Engine defaultHost="localhost" name="jboss.web">
+
+ <!-- The JAAS based authentication and authorization realm implementation
+ that is compatible with the jboss 3.2.x realm implementation.
+ - certificatePrincipal : the class name of the
+ org.jboss.security.auth.certs.CertificatePrincipal impl
+ used for mapping X509[] cert chains to a Princpal.
+ - allRolesMode : how to handle an auth-constraint with a role-name=*,
+ one of strict, authOnly, strictAuthOnly
+ + strict = Use the strict servlet spec interpretation which requires
+ that the user have one of the web-app/security-role/role-name
+ + authOnly = Allow any authenticated user
+ + strictAuthOnly = Allow any authenticated user only if there are no
+ web-app/security-roles
+ -->
+ <Realm allRolesMode="authOnly" certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping" className="org.jboss.web.tomcat.security.JBossSecurityMgrRealm"/>
+ <!-- A subclass of JBossSecurityMgrRealm that uses the authentication
+ behavior of JBossSecurityMgrRealm, but overrides the authorization
+ checks to use JACC permissions with the current java.security.Policy
+ to determine authorized access.
+ - allRolesMode : how to handle an auth-constraint with a role-name=*,
+ one of strict, authOnly, strictAuthOnly
+ + strict = Use the strict servlet spec interpretation which requires
+ that the user have one of the web-app/security-role/role-name
+ + authOnly = Allow any authenticated user
+ + strictAuthOnly = Allow any authenticated user only if there are no
+ web-app/security-roles
+ <Realm className="org.jboss.web.tomcat.security.JaccAuthorizationRealm"
+ certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
+ allRolesMode="authOnly"
+ />
+ -->
+
+ <Host autoDeploy="false" configClass="org.jboss.web.tomcat.security.config.JBossContextConfig" deployOnStartup="false" deployXML="false" name="localhost">
+
+ <!-- Uncomment to enable request dumper. This Valve "logs interesting
+ contents from the specified Request (before processing) and the
+ corresponding Response (after processing). It is especially useful
+ in debugging problems related to headers and cookies."
+ -->
+ <!--
+ <Valve className="org.apache.catalina.valves.RequestDumperValve" />
+ -->
+
+ <!-- Access logger -->
+ <!--
+ <Valve className="org.apache.catalina.valves.AccessLogValve"
+ prefix="localhost_access_log." suffix=".log"
+ pattern="common" directory="${jboss.server.log.dir}"
+ resolveHosts="false" />
+ -->
+
+ <!-- Uncomment to enable single sign-on across web apps
+ deployed to this host. Does not provide SSO across a cluster.
+
+ If this valve is used, do not use the JBoss ClusteredSingleSignOn
+ valve shown below.
+
+ A new configuration attribute is available beginning with
+ release 4.0.4:
+
+ cookieDomain configures the domain to which the SSO cookie
+ will be scoped (i.e. the set of hosts to
+ which the cookie will be presented). By default
+ the cookie is scoped to "/", meaning the host
+ that presented it. Set cookieDomain to a
+ wider domain (e.g. "xyz.com") to allow an SSO
+ to span more than one hostname.
+ -->
+ <!--
+ <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+ -->
+
+ <!-- Uncomment to enable single sign-on across web apps
+ deployed to this host AND to all other hosts in the cluster.
+
+ If this valve is used, do not use the standard Tomcat SingleSignOn
+ valve shown above.
+
+ Valve uses a JBossCache instance to support SSO credential
+ caching and replication across the cluster. The JBossCache
+ instance must be configured separately. By default, the valve
+ shares a JBossCache with the service that supports HttpSession
+ replication. See the "jboss-web-cluster-service.xml" file in the
+ server/all/deploy directory for cache configuration details.
+
+ Besides the attributes supported by the standard Tomcat
+ SingleSignOn valve (see the Tomcat docs), this version also
+ supports the following attributes:
+
+ cookieDomain see above
+
+ treeCacheName JMX ObjectName of the JBossCache MBean used to
+ support credential caching and replication across
+ the cluster. If not set, the default value is
+ "jboss.cache:service=TomcatClusteringCache", the
+ standard ObjectName of the JBossCache MBean used
+ to support session replication.
+ -->
+ <!--
+ <Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn" />
+ -->
+
+ <!-- Check for unclosed connections and transaction terminated checks
+ in servlets/jsps.
+
+ Important: The dependency on the CachedConnectionManager
+ in META-INF/jboss-service.xml must be uncommented, too
+ -->
+ <Valve cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager" className="org.jboss.web.tomcat.service.jca.CachedConnectionValve" transactionManagerObjectName="jboss:service=TransactionManager"/>
+
+ </Host>
+
+ </Engine>
+
+ </Service>
+
+</Server>
commit dc131685f088d8915bf2516e25a37cf916cf07e3
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 17:50:23 2011 -0500
All the node lists are zero based index. Fixing for the incorrect indexing of lists.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 8cff302..c2cf3a8 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -75,9 +75,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
*/
public void setPropertyValue(String propertyName, String value) {
boolean propertyFound = false;
+ NodeList nodeList = beanNode.getChildNodes();
- for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
- Node currentNode = beanNode.getChildNodes().item(i);
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node currentNode = nodeList.item(i);
if (currentNode.getNodeName().equals("property")
&& currentNode.getAttributes().getNamedItem("name") != null
@@ -131,7 +132,7 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
private Node getBeanNodeByClass(String className) {
NodeList nodeList = this.getDocument().getElementsByTagName("bean");
- for (int i = 1; i < nodeList.getLength(); i++) {
+ for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
if (node.getAttributes().getNamedItem("class") != null
@@ -150,7 +151,7 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
private Node getBeanNodeByName(String beanName) {
NodeList nodeList = this.getDocument().getElementsByTagName("bean");
- for (int i = 1; i < nodeList.getLength(); i++) {
+ for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
if (node.getAttributes().getNamedItem("name") != null
commit d1e6d46e89fb5876446fcfe42c04cf4c48a11bce
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 17:43:08 2011 -0500
Add property persistance functionality to catalina JMX listener for mod_cluster by saving the configuration directly into the server.xml file.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
new file mode 100644
index 0000000..1b390c5
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
@@ -0,0 +1,93 @@
+/*
+ * 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.plugins.modcluster;
+
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.config.JBossWebServerFile;
+
+@SuppressWarnings({ "rawtypes", "deprecation" })
+public class CatalinaServiceComponent extends MBeanResourceComponent {
+ private static final String SERVER_HOME_DIR = "serverHomeDir";
+ private static final String CONFIGURATION_FILE_RELATIVE_PATH = "/deploy/jboss-web.deployer/server.xml";
+
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ super.updateResourceConfiguration(report);
+
+ try {
+ saveResouceConfigurationToFile(report, true);
+ } catch (Exception e) {
+ }
+ }
+
+ private void saveResouceConfigurationToFile(ConfigurationUpdateReport report, boolean ignoreReadOnly) {
+ ConfigurationDefinition configurationDefinition = this.getResourceContext().getResourceType()
+ .getResourceConfigurationDefinition();
+
+ // assume we succeed - we'll set to failure if we can't set all properties
+ report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+
+ try {
+ JBossWebServerFile jbossWebServerFile = getJBossWebServerFileInstance();
+
+ for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
+ PropertySimple property = report.getConfiguration().getSimple(key);
+ if (property != null) {
+ try {
+ PropertyDefinitionSimple def = configurationDefinition.getPropertyDefinitionSimple(property
+ .getName());
+ if (!(ignoreReadOnly && def.isReadOnly())) {
+ jbossWebServerFile.setPropertyValue(property.getName(), property.getStringValue());
+ }
+ } catch (Exception e) {
+ property.setErrorMessage(ThrowableUtil.getStackAsString(e));
+ report
+ .setErrorMessage("Failed setting resource configuration - see property error messages for details");
+ log.info("Failure setting MBean Resource configuration value for " + key, e);
+ }
+ }
+ }
+
+ jbossWebServerFile.saveConfigurationFile();
+ } catch (Exception e) {
+ log.debug("Unable to save mod_cluster configuration file.", e);
+ }
+ }
+
+ private JBossWebServerFile getJBossWebServerFileInstance() throws Exception {
+ ModClusterServerComponent modClusterComponent = (ModClusterServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ PropertySimple property = modClusterComponent.getResourceContext().getPluginConfiguration()
+ .getSimple(SERVER_HOME_DIR);
+
+ if (property != null) {
+ String fileName = property.getStringValue() + CONFIGURATION_FILE_RELATIVE_PATH;
+ return new JBossWebServerFile(fileName);
+ }
+
+ return null;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 354fa99..45204e1 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -23,6 +23,11 @@ import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
+import org.apache.commons.lang.NotImplementedException;
+import org.w3c.dom.Attr;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
/**
@@ -31,20 +36,52 @@ import org.xml.sax.SAXException;
*/
public class JBossWebServerFile extends AbstractConfigurationFile {
- public JBossWebServerFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
- super(fileName);
- // TODO Auto-generated constructor stub
+ private static final String CATALINA_LISTENER_CLASS_NAME = "org.jboss.modcluster.catalina.ModClusterListener";
+
+ private Node listenerNode;
+
+ public JBossWebServerFile(String configurationFileName) throws ParserConfigurationException, SAXException,
+ IOException {
+ super(configurationFileName);
+
+ listenerNode = this.getListenerNode();
}
@Override
- void setPropertyValue(String propertyName, String value) {
- // TODO Auto-generated method stub
+ public void setPropertyValue(String propertyName, String value) {
+ NamedNodeMap attributeList = listenerNode.getAttributes();
+ if (attributeList.getNamedItem(propertyName) != null && value != null) {
+ Node attributeNode = attributeList.getNamedItem(propertyName);
+ attributeNode.setTextContent(value);
+ } else if (attributeList.getNamedItem(propertyName) != null && value == null) {
+ attributeList.removeNamedItem(propertyName);
+ } else if (attributeList.getNamedItem(propertyName) == null && value != null) {
+ Attr property = this.getDocument().createAttribute(propertyName);
+ property.setValue(propertyName);
+ property.setTextContent(value);
+ attributeList.setNamedItem(property);
+ }
}
@Override
- String getPropertyValue(String propertyName) {
- // TODO Auto-generated method stub
+ public String getPropertyValue(String propertyName) {
+ throw new NotImplementedException(
+ "Property values should be retrieved from the JMX interface not from the configuration file.");
+ }
+
+ private Node getListenerNode() {
+ NodeList nodeList = this.getDocument().getElementsByTagName("Listener");
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
+
+ if (node.getAttributes().getNamedItem("className") != null
+ && CATALINA_LISTENER_CLASS_NAME.equals(node.getAttributes().getNamedItem("className").getTextContent())) {
+ return node;
+ }
+ }
+
return null;
}
}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 3e523f7..dafb18f 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -325,7 +325,7 @@
</service>
<!-- End - Configuration for ModClusterService -->
- <service name="Catalina Service" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="Catalina Service Listener" singleton="true">
+ <service name="Catalina Service" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="CatalinaServiceComponent" supportsManualAdd="true" description="Catalina Service Listener" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*" />
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index cba5672..b8fca4c 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -20,12 +20,13 @@ package org.rhq.plugins.modcluster.test;
import org.testng.annotations.Test;
+import org.rhq.plugins.modcluster.config.JBossWebServerFile;
import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
public class ServerConfigTest {
@Test
- public void TestConfig() {
+ public void TestModClusterConfig() {
try {
//Test simple bean configuration
@@ -57,4 +58,25 @@ public class ServerConfigTest {
}
}
+ @Test
+ public void TestJBossWebConfig() {
+
+ try {
+ //Test simple bean configuration
+ JBossWebServerFile config = new JBossWebServerFile(
+ "/home/snegrea/Downloads/jboss42/server/all/deploy/jboss-web.deployer/server.xml");
+ config.setPropertyValue("processStatusFrequency", "4");
+ config.setPropertyValue("test", "5");
+ config.setPropertyValue("test", "123");
+
+ config.setPropertyValue("test", null);
+ config.setPropertyValue("processStatusFrequency", null);
+
+ config.saveConfigurationFile();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
}
commit 616b14c59c03a04144e887c73e2c290a149c202d
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 17:35:02 2011 -0500
Moved private method at the bottom fo the file to follow standard java file structure.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
index 3eb7cbe..31530d7 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -57,18 +57,6 @@ public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponen
}
/**
- * @param context
- * @param objectName
- * @return
- */
- public String getBeanConfiguredClassName(ResourceDiscoveryContext<JMXComponent> context, String objectName) {
- EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
- EmsBean emsBean = loadBean(connection, objectName);
-
- return emsBean.getClassTypeName();
- }
-
- /**
* Loads the bean with the given object name.
*
* Subclasses are free to override this method in order to load the bean.
@@ -89,4 +77,16 @@ public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponen
}
return bean;
}
+
+ /**
+ * @param context
+ * @param objectName
+ * @return
+ */
+ private String getBeanConfiguredClassName(ResourceDiscoveryContext<JMXComponent> context, String objectName) {
+ EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
+ EmsBean emsBean = loadBean(connection, objectName);
+
+ return emsBean.getClassTypeName();
+ }
}
12 years, 8 months
[rhq] Branch 'mod_cluster_plugin' - modules/plugins
by snegrea
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java | 21
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java | 7
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java | 30
modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java | 39 -
modules/plugins/mod-cluster/src/test/resources/xml_config/mod_cluster-jboss-beans.xml | 337 ++++++++++
modules/plugins/mod-cluster/src/test/resources/xml_config/server.xml | 157 ++++
6 files changed, 562 insertions(+), 29 deletions(-)
New commits:
commit 8db63e00ec03b5c0257925becda0b984351b6664
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 18:27:05 2011 -0500
Refactoring configuration file classes to accept files in the constructor to allow testing. Also, added basic configuration files for testing.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
index dee2f81..d49ce88 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -39,11 +39,16 @@ import org.xml.sax.SAXException;
* @author Stefan Negrea
*/
public abstract class AbstractConfigurationFile {
- private String fileName;
+ private File configurationFile;
private Document document;
public AbstractConfigurationFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
- this.fileName = fileName;
+ this(new File(fileName));
+ }
+
+ public AbstractConfigurationFile(File configurationFile) throws ParserConfigurationException, SAXException,
+ IOException {
+ this.configurationFile = configurationFile;
loadConfiguratonFile();
}
@@ -53,13 +58,6 @@ public abstract class AbstractConfigurationFile {
abstract String getPropertyValue(String propertyName);
/**
- * @return the fileName
- */
- public String getFileName() {
- return fileName;
- }
-
- /**
* @return the doc
*/
public Document getDocument() {
@@ -67,8 +65,7 @@ public abstract class AbstractConfigurationFile {
}
public void saveConfigurationFile() throws Exception {
- File file = new File(this.getFileName());
- StreamResult result = new StreamResult(file);
+ StreamResult result = new StreamResult(this.configurationFile);
Source source = new DOMSource(this.getDocument());
Transformer transformer = TransformerFactory.newInstance().newTransformer();
@@ -79,6 +76,6 @@ public abstract class AbstractConfigurationFile {
private void loadConfiguratonFile() throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
- this.document = docBuilder.parse(this.getFileName());
+ this.document = docBuilder.parse(this.configurationFile);
}
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 45204e1..01f992e 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -19,6 +19,7 @@
package org.rhq.plugins.modcluster.config;
+import java.io.File;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
@@ -47,6 +48,12 @@ public class JBossWebServerFile extends AbstractConfigurationFile {
listenerNode = this.getListenerNode();
}
+ public JBossWebServerFile(File configurationFile) throws ParserConfigurationException, SAXException, IOException {
+ super(configurationFile);
+
+ listenerNode = this.getListenerNode();
+ }
+
@Override
public void setPropertyValue(String propertyName, String value) {
NamedNodeMap attributeList = listenerNode.getAttributes();
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index c2cf3a8..9ff7752 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -18,6 +18,7 @@
*/
package org.rhq.plugins.modcluster.config;
+import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -44,7 +45,19 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @throws SAXException
* @throws IOException
*/
- public ModClusterBeanFile(String className, String configurationFile) throws ParserConfigurationException,
+ public ModClusterBeanFile(String className, String configurationFileName) throws ParserConfigurationException,
+ SAXException, IOException {
+ this(className, new File(configurationFileName));
+ }
+
+ /**
+ * @param className
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, File configurationFile) throws ParserConfigurationException,
SAXException, IOException {
super(configurationFile);
@@ -59,7 +72,20 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @throws SAXException
* @throws IOException
*/
- public ModClusterBeanFile(String className, String constructorArgumentClassName, String configurationFile)
+ public ModClusterBeanFile(String className, String constructorArgumentClassName, String configurationFileName)
+ throws ParserConfigurationException, SAXException, IOException {
+ this(className, constructorArgumentClassName, new File(configurationFileName));
+ }
+
+ /**
+ * @param className
+ * @param constructorArgumentClassName
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, String constructorArgumentClassName, File configurationFile)
throws ParserConfigurationException, SAXException, IOException {
super(configurationFile);
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index b8fca4c..871b082 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -18,6 +18,9 @@
*/
package org.rhq.plugins.modcluster.test;
+import java.io.File;
+import java.net.URL;
+
import org.testng.annotations.Test;
import org.rhq.plugins.modcluster.config.JBossWebServerFile;
@@ -26,12 +29,12 @@ import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
public class ServerConfigTest {
@Test
- public void TestModClusterConfig() {
-
+ public void TestSimpleBeanModClusterConfig() {
try {
- //Test simple bean configuration
- ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ URL testConfigURL = getClass().getResource("/xml_config/mod_cluster-jboss-beans.xml");
+ File testFile = new File(testConfigURL.toURI());
+
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService", testFile);
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
@@ -40,11 +43,19 @@ public class ServerConfigTest {
config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void TestBeanWithDependenciesModClusterConfig() {
+ try {
+ URL testConfigURL = getClass().getResource("/xml_config/mod_cluster-jboss-beans.xml");
+ File testFile = new File(testConfigURL.toURI());
- //Test bean configuration with constructor dependency
- config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
- "org.jboss.modcluster.config.ha.HAModClusterConfig",
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
+ "org.jboss.modcluster.config.ha.HAModClusterConfig", testFile);
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
@@ -53,18 +64,17 @@ public class ServerConfigTest {
config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
} catch (Exception e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
@Test
public void TestJBossWebConfig() {
-
try {
- //Test simple bean configuration
- JBossWebServerFile config = new JBossWebServerFile(
- "/home/snegrea/Downloads/jboss42/server/all/deploy/jboss-web.deployer/server.xml");
+ URL testConfigURL = getClass().getResource("/xml_config/server.xml");
+ File testFile = new File(testConfigURL.toURI());
+
+ JBossWebServerFile config = new JBossWebServerFile(testFile);
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
@@ -74,7 +84,6 @@ public class ServerConfigTest {
config.saveConfigurationFile();
} catch (Exception e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
diff --git a/modules/plugins/mod-cluster/src/test/resources/xml_config/mod_cluster-jboss-beans.xml b/modules/plugins/mod-cluster/src/test/resources/xml_config/mod_cluster-jboss-beans.xml
new file mode 100644
index 0000000..1ef344b
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/test/resources/xml_config/mod_cluster-jboss-beans.xml
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ Beans that provide JBoss AS-side functionality for mod_cluster. These
+ beans are all "On Demand", i.e. that are not installed unless requested.
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- Entry point: catalina lifecycle listener -->
+ <bean class="org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter" name="ModClusterListener">
+ <constructor>
+ <parameter class="org.jboss.modcluster.ContainerEventHandler">
+<inject bean="HAModClusterService"/>
+</parameter>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ </constructor>
+ <depends>WebServer</depends>
+ </bean>
+
+ <!-- The core mod_cluster service -->
+ <bean class="org.jboss.modcluster.ModClusterService" mode="On Demand" name="ModClusterService">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ModClusterServiceMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.config.ModClusterConfig">
+<inject bean="ModClusterConfig"/>
+</parameter>
+ <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider">
+<inject bean="DynamicLoadBalanceFactorProvider"/>
+</parameter>
+ </constructor>
+ </bean>
+
+ <!-- The core mod_cluster service, implemented as an HA singleton -->
+ <bean class="org.jboss.modcluster.ha.HAModClusterService" mode="On Demand" name="HAModClusterService">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ha.HAModClusterServiceMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.config.ha.HAModClusterConfig">
+<inject bean="ModClusterConfig"/>
+</parameter>
+ <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider">
+<inject bean="DynamicLoadBalanceFactorProvider"/>
+</parameter>
+ <parameter class="org.jboss.ha.framework.interfaces.HAPartition">
+<inject bean="HAPartition"/>
+</parameter>
+ <parameter class="org.jboss.ha.framework.interfaces.HASingletonElectionPolicy">
+<bean class="org.jboss.ha.singleton.HASingletonElectionPolicySimple"/>
+</parameter>
+ </constructor>
+
+</bean>
+
+ <!-- Configure this node's communication with the load balancer -->
+ <bean class="org.jboss.modcluster.config.ha.HAModClusterConfig" mode="On Demand" name="ModClusterConfig">
+
+ <!-- Comma separated list of address:port listing the httpd servers
+ where mod_cluster is running. -->
+ <property name="proxyList">${jboss.mod_cluster.proxyList,jboss.modcluster.proxyList:}</property>
+ <!-- URL prefix to send with commands to mod_cluster. Default is no prefix. -->
+ <!--property name="proxyURL"></property-->
+
+ <!-- mod_advertise is a small httpd module that advertises the
+ availability of httpd servers via multicast, allowing
+ ModClusterService to discover the httpd front-end instead of/in
+ addition to having them defined in proxyList. -->
+ <!-- Whether to listen for advertise messages -->
+ <property name="advertise">${jboss.mod_cluster.advertise:true}</property>
+ <!-- Multicast address on which to listen for advertisements -->
+ <property name="advertiseGroupAddress">${jboss.mod_cluster.advertise.address,jboss.modcluster.advertise.address,jboss.partition.udpGroup:224.0.1.105}</property>
+ <!-- Port to listen to for advertisements -->
+ <property name="advertisePort">${jboss.mod_cluster.advertise.port,jboss.modcluster.advertise.port:23364}</property>
+
+ <!-- Comma delimited list of contexts that should *not* be auto-registered with httpd. -->
+ <!-- ROOT indicates the root context. -->
+ <!-- Context may be qualified by host using a colon, e.g. host1:context1 -->
+ <!-- If no host is defined, localhost is assumed. -->
+ <property name="excludedContexts">${jboss.mod_cluster.excludedContexts,jboss.modcluster.excludedContexts:ROOT,admin-console,invoker,jbossws,jmx-console}</property>
+ <property name="autoEnableContexts">${jboss.mod_cluster.autoEnableContexts:true}</property>
+
+ <!-- Security key the proxy is going to send with advertise messages.
+ Default is none. -->
+ <!--property name="advertiseSecurityKey"></property-->
+
+ <!-- Whether to use SSL to communicate with mod_cluster. Note this
+ has nothing to do with handling of https requests by JBoss Web -->
+ <property name="ssl">false</property>
+
+ <!-- Configuration values for the load balancer itself (must be the
+ same on all nodes in the cluster). These will be passed to the
+ load balancer. -->
+ <property name="stickySession">true</property>
+ <property name="stickySessionForce">false</property>
+ <property name="stickySessionRemove">false</property>
+ <property name="maxAttempts">1</property>
+ <property name="workerTimeout">-1</property>
+ </bean>
+
+ <!-- Provides information to ModClusterService informing it how much load
+ this server should take. This impl calculates load factor from a
+ number of metrics and adjusts the value periodically based on runtime
+ conditions, using to the JBossWeb engine's backgroundProcessorDelay. -->
+ <bean class="org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProvider" mode="On Demand" name="DynamicLoadBalanceFactorProvider">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor",exposedInterface=org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProviderMBean.class)</annotation>
+ <constructor>
+ <parameter>
+ <!-- Define the load metrics to use in your load balance factor calculation here -->
+ <set elementClass="org.jboss.modcluster.load.metric.LoadMetric">
+ <inject bean="BusyConnectorsLoadMetric"/>
+ <inject bean="HeapMemoryUsageLoadMetric"/>
+ </set>
+ </parameter>
+ </constructor>
+ <!-- The number of historical load values used to determine load factor -->
+ <!--property name="history">9</property-->
+ <!-- The exponential decay factor for historical load values -->
+ <!--property name="decayFactor">2</property-->
+ </bean>
+
+ <!-- Default load metrics/sources -->
+ <!-- The JBossWeb connector thread pool usage as a ratio of busy threads to max thread pool size -->
+ <!-- Analogous to method=B in mod_jk -->
+ <bean class="org.jboss.modcluster.load.metric.impl.BusyConnectorsLoadMetric" mode="On Demand" name="BusyConnectorsLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=BusyConnectors",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="ThreadPoolLoadMetricSource"/>
+</parameter>
+ </constructor>
+ <!-- The weight determines the significance of this metric with respect
+ to others in the overall load balance factor calculation -->
+ <property name="weight">2</property>
+ </bean>
+ <!-- Queries all JBossWeb ThreadPool mbeans -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ThreadPoolLoadMetricSource" mode="On Demand" name="ThreadPoolLoadMetricSource">
+ <constructor>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ <!-- Object name pattern for connector thread pools -->
+ <!--parameter>jboss.web:type=ThreadPool,*</parameter-->
+ </constructor>
+ </bean>
+
+ <!-- The heap memory usage as a ratio of used heap to max heap size -->
+ <!-- N.B. This load metric is its own source -->
+ <bean class="org.jboss.modcluster.load.metric.impl.HeapMemoryUsageLoadMetric" mode="On Demand" name="HeapMemoryUsageLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=HeapMemoryUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <!--property name="weight">1</property-->
+ </bean>
+
+
+ <!-- Alternative load balance factor providers -->
+
+ <!-- Basic impl that returns a static load balance factor.
+ This would replace the DynamicLoadBalanceFactorProvider
+ used above.
+ -->
+ <bean class="org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProvider" mode="On Demand" name="SimpleLoadBalanceFactorProvider">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor",exposedInterface=org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProviderMBean.class)</annotation>
+ <property name="loadBalanceFactor">1</property>
+ </bean>
+
+ <!--
+ Alternative load metrics, grouped by source.
+ To use these, inject them into the set passed to the
+ DynamicLoadBalanceFactorProvider bean's constructor above.
+ -->
+
+ <!-- CPU usage -->
+ <!-- Perhaps the best metric for determining system load - but only available on Java 1.6 or later -->
+ <bean class="org.jboss.modcluster.load.metric.impl.AverageSystemLoadMetric" mode="On Demand" name="AverageSystemLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=AverageSystemLoad",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="OperatingSystemLoadMetricSource"/>
+</parameter>
+ </constructor>
+ </bean>
+ <!-- The system memory usage as ratio of used memory to total memory size -->
+ <!-- Requires com.sun.management.OperatingSystemMXBean, i.e. Sun or OpenJDK JVM -->
+ <bean class="org.jboss.modcluster.load.metric.impl.SystemMemoryUsageLoadMetric" mode="On Demand" name="SystemMemoryUsageLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=SystemMemoryUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="OperatingSystemLoadMetricSource"/>
+</parameter>
+ </constructor>
+ </bean>
+ <!-- Uses the platform's OperatingSystemMXBean -->
+ <bean class="org.jboss.modcluster.load.metric.impl.OperatingSystemLoadMetricSource" mode="On Demand" name="OperatingSystemLoadMetricSource">
+ </bean>
+
+
+ <!-- The number of requests/sec processed by the JBossWeb connectors, with respect to the defined capacity -->
+ <!-- Analogous to method=R in mod_jk -->
+ <bean class="org.jboss.modcluster.load.metric.impl.RequestCountLoadMetric" mode="On Demand" name="RequestCountLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=RequestCount",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource">
+<inject bean="RequestProcessorLoadMetricSource"/>
+</parameter>
+ <!--parameter>requestCount</parameter-->
+ </constructor>
+ <!-- This metric requires an explicit capacity, e.g. maximum capacity of 1000 requests/sec -->
+ <property name="capacity">1000</property>
+ </bean>
+ <!-- The incoming traffic received by JBossWeb connectors in KB/sec, with respect to the defined capacity -->
+ <!-- Analogous to method=T in mod_jk -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ReceiveTrafficLoadMetric" mode="On Demand" name="ReceiveTrafficLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ReceiveTraffic",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource">
+<inject bean="RequestProcessorLoadMetricSource"/>
+</parameter>
+ <!--parameter>bytesReceived</parameter-->
+ </constructor>
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 1024 KB/s -->
+ <property name="capacity">1024</property>
+ </bean>
+ <!-- The outgoing traffic sent by JBossWeb connectors in KB/sec, with respect to the defined capacity -->
+ <bean class="org.jboss.modcluster.load.metric.impl.SendTrafficLoadMetric" mode="On Demand" name="SendTrafficLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=SendTraffic",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource">
+<inject bean="RequestProcessorLoadMetricSource"/>
+</parameter>
+ <!--parameter>bytesSent</parameter-->
+ </constructor>
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 512 KB/s -->
+ <property name="capacity">512</property>
+ </bean>
+ <!-- Queries all JBossWeb GlobalRequestProcessor mbeans -->
+ <bean class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource" mode="On Demand" name="RequestProcessorLoadMetricSource">
+ <constructor>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ <!-- Object name pattern for request processors -->
+ <!--parameter>jboss.web:type=GlobalRequestProcessor,*</parameter-->
+ </constructor>
+ </bean>
+
+
+ <!-- The number of active sessions, with respect to the defined capacity -->
+ <!-- Analogous to method=S in mod_jk -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ActiveSessionsLoadMetric" mode="On Demand" name="ActiveSessionsLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ActiveSessions",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="SessionLoadMetricSource"/>
+</parameter>
+ <!--parameter>activeSessions</parameter-->
+ </constructor>
+ <!-- This metric requires an explicit capacity, e.g. max capacity of 1000 active sessions -->
+ <property name="capacity">1000</property>
+ </bean>
+ <!-- Queries all JBossWeb session manager mbeans -->
+ <bean class="org.jboss.modcluster.load.metric.impl.SessionLoadMetricSource" mode="On Demand" name="SessionLoadMetricSource">
+ <constructor>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ <!-- Object name pattern for session managers -->
+ <!--parameter>jboss.web:type=Manager,*</parameter-->
+ </constructor>
+ </bean>
+
+
+ <!-- Returns the connection pool usage as a ratio of used to max pool size -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ConnectionPoolUsageLoadMetric" mode="On Demand" name="ConnectionPoolUsageMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ConnectionPoolUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="ConnectionPoolLoadMetricSource"/>
+</parameter>
+ <!--parameter>InUseConnectionCount</parameter-->
+ <!--parameter>MaxSize</parameter-->
+ </constructor>
+ </bean>
+ <!-- Queries all JCA connection pools -->
+ <bean class="org.jboss.modcluster.load.metric.impl.ConnectionPoolLoadMetricSource" mode="On Demand" name="ConnectionPoolLoadMetricSource">
+ <constructor>
+ <parameter class="javax.management.MBeanServer">
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ <!-- Object name pattern for connector thread pools -->
+ <!--parameter>jboss.jca:service=ManagedConnectionPool,*</parameter-->
+ </constructor>
+ </bean>
+
+ <!-- Generic load metrics/sources -->
+
+ <!-- Uses the sum of the values of the specified attribute for each
+ mbean matching the query, with respect to a defined capacity. -->
+ <bean class="org.jboss.modcluster.load.metric.impl.MBeanAttributeLoadMetric" mode="On Demand" name="MBeanAttributeLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=MBeanAttribute",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="MBeanQueryLoadMetricSource"/>
+</parameter>
+ <parameter>
+<!-- mbean attribute -->
+</parameter>
+ </constructor>
+ <property name="capacity">1</property>
+ </bean>
+ <!-- Uses the ratio of the sum of the values of the specified dividend attribute,
+ to the sum of the values of the specified divisor attribute for each mbean
+ matching the query. -->
+ <bean class="org.jboss.modcluster.load.metric.impl.MBeanAttributeRatioLoadMetric" mode="On Demand" name="MBeanAttributeRatioLoadMetric">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=MBeanAttributeRatio",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+ <constructor>
+ <parameter>
+<inject bean="MBeanQueryLoadMetricSource"/>
+</parameter>
+ <parameter>
+<!-- dividend attribute -->
+</parameter>
+ <parameter>
+<!-- divisor attribute -->
+</parameter>
+ </constructor>
+ </bean>
+ <!-- Queries for mbeans matching the specified pattern -->
+ <bean class="org.jboss.modcluster.load.metric.impl.MBeanQueryLoadMetricSource" mode="On Demand" name="MBeanQueryLoadMetricSource">
+ <constructor>
+ <parameter>
+<!-- ObjectName pattern -->
+</parameter>
+ <parameter>
+<inject bean="JMXKernel" property="mbeanServer"/>
+</parameter>
+ </constructor>
+ </bean>
+
+</deployment>
diff --git a/modules/plugins/mod-cluster/src/test/resources/xml_config/server.xml b/modules/plugins/mod-cluster/src/test/resources/xml_config/server.xml
new file mode 100644
index 0000000..51fb479
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/test/resources/xml_config/server.xml
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<Server>
+
+ <Listener advertise="true" className="org.jboss.modcluster.catalina.ModClusterListener" smax="124"/>
+
+ <!--APR library loader. Documentation at /docs/apr.html -->
+ <Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
+ <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
+ <Listener className="org.apache.catalina.core.JasperListener"/>
+
+ <!-- Use a custom version of StandardService that allows the
+ connectors to be started independent of the normal lifecycle
+ start to allow web apps to be deployed before starting the
+ connectors.
+ -->
+ <Service name="jboss.web">
+
+ <!-- A "Connector" represents an endpoint by which requests are received
+ and responses are returned. Documentation at :
+ Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
+ Java AJP Connector: /docs/config/ajp.html
+ APR (HTTP/AJP) Connector: /docs/apr.html
+ Define a non-SSL HTTP/1.1 Connector on port 8080
+ -->
+ <Connector acceptCount="100" address="${jboss.bind.address}" connectionTimeout="20000" disableUploadTimeout="true" emptySessionPath="true" enableLookups="false" maxHttpHeaderSize="8192" maxThreads="250" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
+
+ <!-- Define a SSL HTTP/1.1 Connector on port 8443
+ This connector uses the JSSE configuration, when using APR, the
+ connector should be using the OpenSSL style configuration
+ described in the APR documentation -->
+ <!--
+ <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
+ maxThreads="150" scheme="https" secure="true"
+ clientAuth="false" sslProtocol="TLS" />
+ -->
+
+ <!-- Define an AJP 1.3 Connector on port 8009 -->
+ <Connector address="${jboss.bind.address}" emptySessionPath="true" enableLookups="false" port="8009" protocol="AJP/1.3" redirectPort="8443"/>
+
+ <Engine defaultHost="localhost" name="jboss.web">
+
+ <!-- The JAAS based authentication and authorization realm implementation
+ that is compatible with the jboss 3.2.x realm implementation.
+ - certificatePrincipal : the class name of the
+ org.jboss.security.auth.certs.CertificatePrincipal impl
+ used for mapping X509[] cert chains to a Princpal.
+ - allRolesMode : how to handle an auth-constraint with a role-name=*,
+ one of strict, authOnly, strictAuthOnly
+ + strict = Use the strict servlet spec interpretation which requires
+ that the user have one of the web-app/security-role/role-name
+ + authOnly = Allow any authenticated user
+ + strictAuthOnly = Allow any authenticated user only if there are no
+ web-app/security-roles
+ -->
+ <Realm allRolesMode="authOnly" certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping" className="org.jboss.web.tomcat.security.JBossSecurityMgrRealm"/>
+ <!-- A subclass of JBossSecurityMgrRealm that uses the authentication
+ behavior of JBossSecurityMgrRealm, but overrides the authorization
+ checks to use JACC permissions with the current java.security.Policy
+ to determine authorized access.
+ - allRolesMode : how to handle an auth-constraint with a role-name=*,
+ one of strict, authOnly, strictAuthOnly
+ + strict = Use the strict servlet spec interpretation which requires
+ that the user have one of the web-app/security-role/role-name
+ + authOnly = Allow any authenticated user
+ + strictAuthOnly = Allow any authenticated user only if there are no
+ web-app/security-roles
+ <Realm className="org.jboss.web.tomcat.security.JaccAuthorizationRealm"
+ certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
+ allRolesMode="authOnly"
+ />
+ -->
+
+ <Host autoDeploy="false" configClass="org.jboss.web.tomcat.security.config.JBossContextConfig" deployOnStartup="false" deployXML="false" name="localhost">
+
+ <!-- Uncomment to enable request dumper. This Valve "logs interesting
+ contents from the specified Request (before processing) and the
+ corresponding Response (after processing). It is especially useful
+ in debugging problems related to headers and cookies."
+ -->
+ <!--
+ <Valve className="org.apache.catalina.valves.RequestDumperValve" />
+ -->
+
+ <!-- Access logger -->
+ <!--
+ <Valve className="org.apache.catalina.valves.AccessLogValve"
+ prefix="localhost_access_log." suffix=".log"
+ pattern="common" directory="${jboss.server.log.dir}"
+ resolveHosts="false" />
+ -->
+
+ <!-- Uncomment to enable single sign-on across web apps
+ deployed to this host. Does not provide SSO across a cluster.
+
+ If this valve is used, do not use the JBoss ClusteredSingleSignOn
+ valve shown below.
+
+ A new configuration attribute is available beginning with
+ release 4.0.4:
+
+ cookieDomain configures the domain to which the SSO cookie
+ will be scoped (i.e. the set of hosts to
+ which the cookie will be presented). By default
+ the cookie is scoped to "/", meaning the host
+ that presented it. Set cookieDomain to a
+ wider domain (e.g. "xyz.com") to allow an SSO
+ to span more than one hostname.
+ -->
+ <!--
+ <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+ -->
+
+ <!-- Uncomment to enable single sign-on across web apps
+ deployed to this host AND to all other hosts in the cluster.
+
+ If this valve is used, do not use the standard Tomcat SingleSignOn
+ valve shown above.
+
+ Valve uses a JBossCache instance to support SSO credential
+ caching and replication across the cluster. The JBossCache
+ instance must be configured separately. By default, the valve
+ shares a JBossCache with the service that supports HttpSession
+ replication. See the "jboss-web-cluster-service.xml" file in the
+ server/all/deploy directory for cache configuration details.
+
+ Besides the attributes supported by the standard Tomcat
+ SingleSignOn valve (see the Tomcat docs), this version also
+ supports the following attributes:
+
+ cookieDomain see above
+
+ treeCacheName JMX ObjectName of the JBossCache MBean used to
+ support credential caching and replication across
+ the cluster. If not set, the default value is
+ "jboss.cache:service=TomcatClusteringCache", the
+ standard ObjectName of the JBossCache MBean used
+ to support session replication.
+ -->
+ <!--
+ <Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn" />
+ -->
+
+ <!-- Check for unclosed connections and transaction terminated checks
+ in servlets/jsps.
+
+ Important: The dependency on the CachedConnectionManager
+ in META-INF/jboss-service.xml must be uncommented, too
+ -->
+ <Valve cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager" className="org.jboss.web.tomcat.service.jca.CachedConnectionValve" transactionManagerObjectName="jboss:service=TransactionManager"/>
+
+ </Host>
+
+ </Engine>
+
+ </Service>
+
+</Server>
12 years, 8 months
[rhq] Branch 'mod_cluster_plugin' - 3 commits - modules/plugins
by snegrea
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java | 93 ++++++++++
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java | 24 +-
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java | 51 ++++-
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java | 9
modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml | 2
modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java | 24 ++
6 files changed, 178 insertions(+), 25 deletions(-)
New commits:
commit dc131685f088d8915bf2516e25a37cf916cf07e3
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 17:50:23 2011 -0500
All the node lists are zero based index. Fixing for the incorrect indexing of lists.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 8cff302..c2cf3a8 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -75,9 +75,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
*/
public void setPropertyValue(String propertyName, String value) {
boolean propertyFound = false;
+ NodeList nodeList = beanNode.getChildNodes();
- for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
- Node currentNode = beanNode.getChildNodes().item(i);
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node currentNode = nodeList.item(i);
if (currentNode.getNodeName().equals("property")
&& currentNode.getAttributes().getNamedItem("name") != null
@@ -131,7 +132,7 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
private Node getBeanNodeByClass(String className) {
NodeList nodeList = this.getDocument().getElementsByTagName("bean");
- for (int i = 1; i < nodeList.getLength(); i++) {
+ for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
if (node.getAttributes().getNamedItem("class") != null
@@ -150,7 +151,7 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
private Node getBeanNodeByName(String beanName) {
NodeList nodeList = this.getDocument().getElementsByTagName("bean");
- for (int i = 1; i < nodeList.getLength(); i++) {
+ for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
if (node.getAttributes().getNamedItem("name") != null
commit d1e6d46e89fb5876446fcfe42c04cf4c48a11bce
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 17:43:08 2011 -0500
Add property persistance functionality to catalina JMX listener for mod_cluster by saving the configuration directly into the server.xml file.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
new file mode 100644
index 0000000..1b390c5
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/CatalinaServiceComponent.java
@@ -0,0 +1,93 @@
+/*
+ * 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.plugins.modcluster;
+
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.config.JBossWebServerFile;
+
+@SuppressWarnings({ "rawtypes", "deprecation" })
+public class CatalinaServiceComponent extends MBeanResourceComponent {
+ private static final String SERVER_HOME_DIR = "serverHomeDir";
+ private static final String CONFIGURATION_FILE_RELATIVE_PATH = "/deploy/jboss-web.deployer/server.xml";
+
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ super.updateResourceConfiguration(report);
+
+ try {
+ saveResouceConfigurationToFile(report, true);
+ } catch (Exception e) {
+ }
+ }
+
+ private void saveResouceConfigurationToFile(ConfigurationUpdateReport report, boolean ignoreReadOnly) {
+ ConfigurationDefinition configurationDefinition = this.getResourceContext().getResourceType()
+ .getResourceConfigurationDefinition();
+
+ // assume we succeed - we'll set to failure if we can't set all properties
+ report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+
+ try {
+ JBossWebServerFile jbossWebServerFile = getJBossWebServerFileInstance();
+
+ for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
+ PropertySimple property = report.getConfiguration().getSimple(key);
+ if (property != null) {
+ try {
+ PropertyDefinitionSimple def = configurationDefinition.getPropertyDefinitionSimple(property
+ .getName());
+ if (!(ignoreReadOnly && def.isReadOnly())) {
+ jbossWebServerFile.setPropertyValue(property.getName(), property.getStringValue());
+ }
+ } catch (Exception e) {
+ property.setErrorMessage(ThrowableUtil.getStackAsString(e));
+ report
+ .setErrorMessage("Failed setting resource configuration - see property error messages for details");
+ log.info("Failure setting MBean Resource configuration value for " + key, e);
+ }
+ }
+ }
+
+ jbossWebServerFile.saveConfigurationFile();
+ } catch (Exception e) {
+ log.debug("Unable to save mod_cluster configuration file.", e);
+ }
+ }
+
+ private JBossWebServerFile getJBossWebServerFileInstance() throws Exception {
+ ModClusterServerComponent modClusterComponent = (ModClusterServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ PropertySimple property = modClusterComponent.getResourceContext().getPluginConfiguration()
+ .getSimple(SERVER_HOME_DIR);
+
+ if (property != null) {
+ String fileName = property.getStringValue() + CONFIGURATION_FILE_RELATIVE_PATH;
+ return new JBossWebServerFile(fileName);
+ }
+
+ return null;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 354fa99..45204e1 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -23,6 +23,11 @@ import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
+import org.apache.commons.lang.NotImplementedException;
+import org.w3c.dom.Attr;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
/**
@@ -31,20 +36,52 @@ import org.xml.sax.SAXException;
*/
public class JBossWebServerFile extends AbstractConfigurationFile {
- public JBossWebServerFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
- super(fileName);
- // TODO Auto-generated constructor stub
+ private static final String CATALINA_LISTENER_CLASS_NAME = "org.jboss.modcluster.catalina.ModClusterListener";
+
+ private Node listenerNode;
+
+ public JBossWebServerFile(String configurationFileName) throws ParserConfigurationException, SAXException,
+ IOException {
+ super(configurationFileName);
+
+ listenerNode = this.getListenerNode();
}
@Override
- void setPropertyValue(String propertyName, String value) {
- // TODO Auto-generated method stub
+ public void setPropertyValue(String propertyName, String value) {
+ NamedNodeMap attributeList = listenerNode.getAttributes();
+ if (attributeList.getNamedItem(propertyName) != null && value != null) {
+ Node attributeNode = attributeList.getNamedItem(propertyName);
+ attributeNode.setTextContent(value);
+ } else if (attributeList.getNamedItem(propertyName) != null && value == null) {
+ attributeList.removeNamedItem(propertyName);
+ } else if (attributeList.getNamedItem(propertyName) == null && value != null) {
+ Attr property = this.getDocument().createAttribute(propertyName);
+ property.setValue(propertyName);
+ property.setTextContent(value);
+ attributeList.setNamedItem(property);
+ }
}
@Override
- String getPropertyValue(String propertyName) {
- // TODO Auto-generated method stub
+ public String getPropertyValue(String propertyName) {
+ throw new NotImplementedException(
+ "Property values should be retrieved from the JMX interface not from the configuration file.");
+ }
+
+ private Node getListenerNode() {
+ NodeList nodeList = this.getDocument().getElementsByTagName("Listener");
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
+
+ if (node.getAttributes().getNamedItem("className") != null
+ && CATALINA_LISTENER_CLASS_NAME.equals(node.getAttributes().getNamedItem("className").getTextContent())) {
+ return node;
+ }
+ }
+
return null;
}
}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 3e523f7..dafb18f 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -325,7 +325,7 @@
</service>
<!-- End - Configuration for ModClusterService -->
- <service name="Catalina Service" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="Catalina Service Listener" singleton="true">
+ <service name="Catalina Service" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="CatalinaServiceComponent" supportsManualAdd="true" description="Catalina Service Listener" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*" />
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index cba5672..b8fca4c 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -20,12 +20,13 @@ package org.rhq.plugins.modcluster.test;
import org.testng.annotations.Test;
+import org.rhq.plugins.modcluster.config.JBossWebServerFile;
import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
public class ServerConfigTest {
@Test
- public void TestConfig() {
+ public void TestModClusterConfig() {
try {
//Test simple bean configuration
@@ -57,4 +58,25 @@ public class ServerConfigTest {
}
}
+ @Test
+ public void TestJBossWebConfig() {
+
+ try {
+ //Test simple bean configuration
+ JBossWebServerFile config = new JBossWebServerFile(
+ "/home/snegrea/Downloads/jboss42/server/all/deploy/jboss-web.deployer/server.xml");
+ config.setPropertyValue("processStatusFrequency", "4");
+ config.setPropertyValue("test", "5");
+ config.setPropertyValue("test", "123");
+
+ config.setPropertyValue("test", null);
+ config.setPropertyValue("processStatusFrequency", null);
+
+ config.saveConfigurationFile();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
}
commit 616b14c59c03a04144e887c73e2c290a149c202d
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 17:35:02 2011 -0500
Moved private method at the bottom fo the file to follow standard java file structure.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
index 3eb7cbe..31530d7 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -57,18 +57,6 @@ public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponen
}
/**
- * @param context
- * @param objectName
- * @return
- */
- public String getBeanConfiguredClassName(ResourceDiscoveryContext<JMXComponent> context, String objectName) {
- EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
- EmsBean emsBean = loadBean(connection, objectName);
-
- return emsBean.getClassTypeName();
- }
-
- /**
* Loads the bean with the given object name.
*
* Subclasses are free to override this method in order to load the bean.
@@ -89,4 +77,16 @@ public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponen
}
return bean;
}
+
+ /**
+ * @param context
+ * @param objectName
+ * @return
+ */
+ private String getBeanConfiguredClassName(ResourceDiscoveryContext<JMXComponent> context, String objectName) {
+ EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
+ EmsBean emsBean = loadBean(connection, objectName);
+
+ return emsBean.getClassTypeName();
+ }
}
12 years, 8 months
[rhq] Branch 'release_jon3.0.0-test-build' - modules/common modules/core modules/enterprise modules/helpers modules/plugins modules/pom.xml modules/test-utils pom.xml
by Simeon Pinder
modules/common/ant-bundle/pom.xml | 2 +-
modules/common/drift/pom.xml | 2 +-
modules/common/filetemplate-bundle/pom.xml | 2 +-
modules/common/jboss-as/pom.xml | 2 +-
modules/common/pom.xml | 2 +-
modules/core/client-api/pom.xml | 2 +-
modules/core/comm-api/pom.xml | 2 +-
modules/core/dbutils/pom.xml | 2 +-
modules/core/domain/pom.xml | 2 +-
modules/core/gui/pom.xml | 2 +-
modules/core/native-system/pom.xml | 2 +-
modules/core/plugin-api/pom.xml | 2 +-
modules/core/plugin-container/pom.xml | 2 +-
modules/core/plugin-validator/pom.xml | 2 +-
modules/core/plugindoc/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/util/pom.xml | 2 +-
modules/enterprise/agent/pom.xml | 2 +-
modules/enterprise/agentupdate/pom.xml | 2 +-
modules/enterprise/binding/pom.xml | 4 ++--
modules/enterprise/comm/pom.xml | 2 +-
modules/enterprise/gui/base-perspective-jar/pom.xml | 2 +-
modules/enterprise/gui/base-perspective-war/pom.xml | 2 +-
modules/enterprise/gui/content_http-war/pom.xml | 2 +-
modules/enterprise/gui/coregui/pom.xml | 2 +-
modules/enterprise/gui/installer-war/pom.xml | 2 +-
modules/enterprise/gui/pom.xml | 2 +-
modules/enterprise/gui/portal-war/pom.xml | 2 +-
modules/enterprise/pom.xml | 2 +-
modules/enterprise/remoting/cli/pom.xml | 2 +-
modules/enterprise/remoting/client-api/pom.xml | 2 +-
modules/enterprise/remoting/client-deps/pom.xml | 2 +-
modules/enterprise/remoting/pom.xml | 2 +-
modules/enterprise/remoting/webservices/pom.xml | 2 +-
modules/enterprise/server/client-api/pom.xml | 4 ++--
modules/enterprise/server/container-lib/pom.xml | 2 +-
modules/enterprise/server/container/pom.xml | 2 +-
modules/enterprise/server/ear/pom.xml | 2 +-
modules/enterprise/server/jar/pom.xml | 2 +-
modules/enterprise/server/plugins/alert-cli/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-email/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-irc/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-log4j/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-microblog/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-mobicents/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-operations/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-roles/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-snmp/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-subject/pom.xml | 4 ++--
modules/enterprise/server/plugins/ant-bundle/pom.xml | 2 +-
modules/enterprise/server/plugins/cobbler/pom.xml | 4 ++--
modules/enterprise/server/plugins/disk/pom.xml | 2 +-
modules/enterprise/server/plugins/drift-mongodb/pom.xml | 2 +-
modules/enterprise/server/plugins/drift-rhq/pom.xml | 2 +-
modules/enterprise/server/plugins/filetemplate-bundle/pom.xml | 2 +-
modules/enterprise/server/plugins/groovy-script/pom.xml | 4 ++--
modules/enterprise/server/plugins/jboss-software/pom.xml | 2 +-
modules/enterprise/server/plugins/packagetype-cli/pom.xml | 4 ++--
modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml | 2 +-
modules/enterprise/server/plugins/perspectives/core/pom.xml | 2 +-
modules/enterprise/server/plugins/pom.xml | 2 +-
modules/enterprise/server/plugins/rhnhosted/pom.xml | 2 +-
modules/enterprise/server/plugins/url/pom.xml | 2 +-
modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml | 2 +-
modules/enterprise/server/plugins/yum/pom.xml | 2 +-
modules/enterprise/server/safe-invoker/pom.xml | 2 +-
modules/enterprise/server/sars/agent-sar/pom.xml | 2 +-
modules/enterprise/server/sars/pom.xml | 2 +-
modules/enterprise/server/xml-schemas/pom.xml | 2 +-
modules/helpers/bundleGen/pom.xml | 4 ++--
modules/helpers/perftest-support/pom.xml | 4 ++--
modules/helpers/pom.xml | 2 +-
modules/helpers/rtfilter/pom.xml | 2 +-
modules/plugins/aliases/pom.xml | 2 +-
modules/plugins/ant-bundle/pom.xml | 2 +-
modules/plugins/apache/pom.xml | 2 +-
modules/plugins/augeas/pom.xml | 2 +-
modules/plugins/byteman/pom.xml | 2 +-
modules/plugins/cobbler/pom.xml | 2 +-
modules/plugins/cron/pom.xml | 2 +-
modules/plugins/database/pom.xml | 2 +-
modules/plugins/filetemplate-bundle/pom.xml | 2 +-
modules/plugins/grub/pom.xml | 2 +-
modules/plugins/hadoop/pom.xml | 2 +-
modules/plugins/hibernate/pom.xml | 2 +-
modules/plugins/hosts/pom.xml | 2 +-
modules/plugins/hudson/pom.xml | 4 ++--
modules/plugins/iis/pom.xml | 2 +-
modules/plugins/irc/pom.xml | 2 +-
modules/plugins/jboss-as-5/pom.xml | 2 +-
modules/plugins/jboss-as-7/pom.xml | 2 +-
modules/plugins/jboss-as/pom.xml | 2 +-
modules/plugins/jboss-cache-v3/pom.xml | 2 +-
modules/plugins/jboss-cache/pom.xml | 2 +-
modules/plugins/jmx/pom.xml | 2 +-
modules/plugins/kickstart/pom.xml | 2 +-
modules/plugins/mod-cluster/pom.xml | 2 +-
modules/plugins/mysql/pom.xml | 2 +-
modules/plugins/netservices/pom.xml | 2 +-
modules/plugins/oracle/pom.xml | 2 +-
modules/plugins/pattern-generator/pom.xml | 2 +-
modules/plugins/perftest/pom.xml | 2 +-
modules/plugins/platform/pom.xml | 2 +-
modules/plugins/pom.xml | 2 +-
modules/plugins/postfix/pom.xml | 2 +-
modules/plugins/postgres/pom.xml | 2 +-
modules/plugins/rhq-agent/pom.xml | 2 +-
modules/plugins/rhq-server/pom.xml | 2 +-
modules/plugins/samba/pom.xml | 2 +-
modules/plugins/script/pom.xml | 2 +-
modules/plugins/script2/pom.xml | 2 +-
modules/plugins/snmptrapd/pom.xml | 2 +-
modules/plugins/sshd/pom.xml | 2 +-
modules/plugins/sudoers/pom.xml | 2 +-
modules/plugins/tomcat/pom.xml | 2 +-
modules/plugins/twitter/pom.xml | 2 +-
modules/plugins/validate-all-plugins/pom.xml | 2 +-
modules/plugins/virt/pom.xml | 2 +-
modules/pom.xml | 2 +-
modules/test-utils/pom.xml | 2 +-
pom.xml | 2 +-
121 files changed, 139 insertions(+), 139 deletions(-)
New commits:
commit 78c2fcbf3b43d14a158d21c704e80bd6b6cc67f5
Author: Simeon Pinder <simeonpinder(a)gmail.com>
Date: Thu Aug 25 18:06:07 2011 -0400
[maven-release-plugin] prepare for next development iteration
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 1ac06bf..1eb86ef 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index a3e379e..73ab33a 100644
--- a/modules/common/drift/pom.xml
+++ b/modules/common/drift/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml
index 735d079..352de33 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index b659f5a..184c5ad 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index 9270b30..bd88fa0 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index 2e8829e..9f5f66a 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index 1a9cfcd..5a8b356 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index cd4f833..aa20853 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-dbutils</artifactId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index 025c215..42d28e1 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index 3a01fd9..bb4dc2c 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index c2f75ae..7d83f3d 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index 780224a..fc78701 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 3d9116c..1d12869 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml
index a9f52b5..f2953a6 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index afc2578..24243e3 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 2ae4d8f..bc41a9b 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index 2ced23e..dfa5bb8 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 895969a..f12c1a1 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml
index 0edd383..8b7ffe8 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index c2ced3e..d96cf83 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-script-bindings</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Script Bindings</name>
<description>Abstraction of different facilities and default configurations for script bindings</description>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index 58bc8f7..f424704 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml
index ddd277b..cebd439 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml
index 93e8ad7..b66da2c 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml
index d69b6db..db7d757 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index 4e204dc..de77f3f 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index c19c071..900d476 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 708bedd..8e8cf66 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml
index a670bbb..4e2ac9f 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index e40a14f..01fb7f6 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index 01c579e..24fbb60 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml
index 1e3ae32..1a1c88c 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-deps/pom.xml b/modules/enterprise/remoting/client-deps/pom.xml
index 6abd765..3fe07b7 100644
--- a/modules/enterprise/remoting/client-deps/pom.xml
+++ b/modules/enterprise/remoting/client-deps/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 257910a..f4b1866 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml
index 2a563f8..dee43bc 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/client-api/pom.xml b/modules/enterprise/server/client-api/pom.xml
index 0ea68f2..c57eaba 100644
--- a/modules/enterprise/server/client-api/pom.xml
+++ b/modules/enterprise/server/client-api/pom.xml
@@ -5,13 +5,13 @@
<parent>
<artifactId>rhq-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Client API</name>
<description>The implementation of the client API when accessing the server locally</description>
diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml
index 312403a..1aebae1 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index 53b9266..d27c157 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index b16de7a..8cdaf8b 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index e34d2bc..d2f2bc5 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/alert-cli/pom.xml b/modules/enterprise/server/plugins/alert-cli/pom.xml
index af345dd..b380393 100644
--- a/modules/enterprise/server/plugins/alert-cli/pom.xml
+++ b/modules/enterprise/server/plugins/alert-cli/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Script Alert Plugin</name>
<description>An alert sender able to execute an arbitrary CLI script as a response to an alert</description>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml
index 97fc979..e1e1890 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Email Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml
index 899fc56..1b609e1 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server IRC Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-log4j/pom.xml b/modules/enterprise/server/plugins/alert-log4j/pom.xml
index ce4b5ba..1a27831 100644
--- a/modules/enterprise/server/plugins/alert-log4j/pom.xml
+++ b/modules/enterprise/server/plugins/alert-log4j/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Log4J Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index 1f7f9ab..ab68d6b 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Microblog Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index 3483ff0..0adccaf 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Mobicents Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml
index 03c0d0d..2c9bcfa 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,14 +2,14 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Opertions Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml
index 925bb4c..06bab65 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Roles Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index 8f4e072..3763c54 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server SNMP Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml
index 52892f3..bb595b5 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 8e51ebb..c4e59b2 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml
index 35cfcdf..381f64c 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Cobbler Plugin</name>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml
index 212b5ba..403ef41 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/drift-mongodb/pom.xml b/modules/enterprise/server/plugins/drift-mongodb/pom.xml
index 1d01aa0..2cb4bbf 100644
--- a/modules/enterprise/server/plugins/drift-mongodb/pom.xml
+++ b/modules/enterprise/server/plugins/drift-mongodb/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/drift-rhq/pom.xml b/modules/enterprise/server/plugins/drift-rhq/pom.xml
index f882eb4..9c9d3b6 100644
--- a/modules/enterprise/server/plugins/drift-rhq/pom.xml
+++ b/modules/enterprise/server/plugins/drift-rhq/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index b055a42..ad1c570 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml b/modules/enterprise/server/plugins/groovy-script/pom.xml
index 6c12a49..0d2bf4b 100644
--- a/modules/enterprise/server/plugins/groovy-script/pom.xml
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>groovy-script-server-plugin</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Groovy Script Plugin</name>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 9f37001..dacaec2 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/packagetype-cli/pom.xml b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
index a0e0427..9a51242 100644
--- a/modules/enterprise/server/plugins/packagetype-cli/pom.xml
+++ b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index f44ea12..f73ecb8 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index 0f25c16..c2d5c7e 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml
index 9841dd9..abf3f43 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index 484f937..04df0b8 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml
index bc71f7b..79ccf2b 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index f0390aa..9e221a0 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml
index 9bb157e..ce8468c 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml
index ff9a022..05cb339 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml
index 455ee28..00344d4 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml
index 79b2c9c..2377858 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml
index cc4fd74..90c0da6 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index 8c97fa6..9e80f1f 100644
--- a/modules/helpers/bundleGen/pom.xml
+++ b/modules/helpers/bundleGen/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<build>
<plugins>
diff --git a/modules/helpers/perftest-support/pom.xml b/modules/helpers/perftest-support/pom.xml
index 531177c..e488bb0 100644
--- a/modules/helpers/perftest-support/pom.xml
+++ b/modules/helpers/perftest-support/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>Performance Testing Support</name>
<description>To support performance testing, this is a basic tool to support extracting and later reimporting of
data from/to a database.
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index c67926a..0c73fd3 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 3af5885..417a3df 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index 979119e..959fa3c 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index a4acb82..ff8c753 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 1730ce9..0694d78 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 265a19e..66d35d1 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 94a7d1b..46bcb55 100644
--- a/modules/plugins/byteman/pom.xml
+++ b/modules/plugins/byteman/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index 0167579..9a45599 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index 6e9beed..e42d480 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index c05fb70..6c1812b 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml
index 4663b94..c1e0a3d 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index 613fe42..93b5dd3 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index 4f3cef9..840e619 100644
--- a/modules/plugins/hadoop/pom.xml
+++ b/modules/plugins/hadoop/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 30bc95f..e482d30 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index ec9bc50..31af33b 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index 7e06fff..b097071 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,12 +6,12 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>RHQ Hudson Plugin</name>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 800f427..2cdc32a 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index ad29033..edf12ea 100644
--- a/modules/plugins/irc/pom.xml
+++ b/modules/plugins/irc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index 50195e4..6ec0096 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as-7/pom.xml b/modules/plugins/jboss-as-7/pom.xml
index c23a441..ca63c5e 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index d8c5045..57c8bb3 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml
index 33ce865..1a3a1df 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 3473824..ae06793 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index ab3477c..1daf86d 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index beee5a9..dc87ed7 100644
--- a/modules/plugins/kickstart/pom.xml
+++ b/modules/plugins/kickstart/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 7579f5b..ab52e84 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index b9743dc..d8ebb5d 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 0e6e969..f1675e4 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index d9d67ff..8a3b3c0 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pattern-generator/pom.xml b/modules/plugins/pattern-generator/pom.xml
index 31648ab..6b0791d 100644
--- a/modules/plugins/pattern-generator/pom.xml
+++ b/modules/plugins/pattern-generator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index a6ec953..843fe3d 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index f76db2d..99f36d0 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 28a0399..f32159e 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index d0d5c1c..5ef7252 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 9eacc08..365f6c4 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index 5f3a34e..60471c2 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index a1fe6b7..e88b97f 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 26111aa..84fc9b7 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 441379c..d31afb9 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index f99726d..2cf689c 100644
--- a/modules/plugins/script2/pom.xml
+++ b/modules/plugins/script2/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 1a6d334..05ed401 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 513edeb..83da74a 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index cd15c95..1b69180 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index bfcdf08..f6dfebd 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index cfa914c..50ff9b6 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml
index f83207c..6565a7b 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index 257623e..8700a19 100644
--- a/modules/plugins/virt/pom.xml
+++ b/modules/plugins/virt/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index ee870ac..2b45c62 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index fe7bfe9..5c6e85c 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -7,7 +7,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index 28a08b0..1be70d1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>3.0.0-BETA1</version>
+ <version>4.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
12 years, 8 months
[rhq] Changes to 'refs/tags/RHQ_3_0_0-BETA1'
by Simeon Pinder
Tag 'RHQ_3_0_0-BETA1' created by Simeon Pinder <simeonpinder(a)gmail.com> at 2011-08-25 22:06 +0000
[maven-release-plugin] copy for tag RHQ_3_0_0-BETA1
Changes since RHQ_4_1_0_Beta:
Heiko W. Rupp (10):
BZ 729938 - If reload returns "connection refused", treat as success, as7 sometimes closes the connection before sending a result. Add a result of "Success" if it is a success.
BZ 719983 - provide a better version string
Add support for the deployment scanner and (a little bit) for Infinispan.
BZ 729938 - If reload returns "connection refused", treat as success, as7 sometimes closes the connection before sending a result. Add a result of "Success" if it is a success.
BZ 719983 - provide a better version string
Add support for the deployment scanner and (a little bit) for Infinispan.
Add creating web connectors, fix the ssl connection part to not create errors, remove two unused classes.
BZ 730940 and BZ 729934 Fix some possible NPEs with child resource creation.
Merge branch 'as7plugin'
BZ 732000 Directly return from shutdown operation to prevent a spurious failure message.
Ian Springer (30):
[BZ 729965] fix regression where a non-admin user would get an exception if they tried to view a Resource they are authorized to view (https://bugzilla.redhat.com/show_bug.cgi?id=729965)
include MANAGE_DRIFT and CONFIGURE_READ in the permissions initially granted to the superuser and allResources roles during dbsetup; cosmetic formatting cleanup in ResourcePermission
[BZ 729337] init values on system details form using form.setValue(), rather than formItem.setValue(), to prevent "JavaScriptException:(TypeError): this.form is null" errors from occurring if formItem.setValue() is called before the form has been added to its parent Canvas (https://bugzilla.redhat.com/show_bug.cgi?id=729337)
add better error handling when an exception occurs in updateTabContent() for a resource or group detail view
[BZ 729961] compile the pt and zh GWT locales in coregui by default (https://bugzilla.redhat.com/show_bug.cgi?id=729961)
[BZ 725883] in the config unmasking code, handle the case where a particular property exists in the config being unmasked but not in the reference unmasked config; otherwise, such a case would produce an NPE (https://bugzilla.redhat.com/show_bug.cgi?id=725883)
a small optimization to make the code a bit more readable
[BZ 730112] fix so ugly errors are not emitted when the user tries to view a
[BZ 730122] fix so ugly errors are not emitted when the user tries to view a
[BZ 725930] fix the URL to the JON docs used for the Help > Online Documentation
[BZ 731541] fix so group config editor member values modal actually shows the
[BZ 719997] fix so row detail links and double-clicking on rows in recent alerts
[BZ 663722] URL-encode username and password in POST request used to
[BZ 731061] don't throw an exception when a job has no triggers, since this can
[BZ 720000] add more null checking during parsing of portlet pref props in order
[BZ 663722] fix bug in original fix for RHQ user passwords with special characters not working (https://bugzilla.redhat.com/show_bug.cgi?id=663722)
[BZ 732041] clear messages in message center and message bar when a user logs out (https://bugzilla.redhat.com/show_bug.cgi?id=732041)
[BZ 696214] fix so that if user updates one or more prefs via coregui, those updates get synced to portal-war - we do this by clearing server-jar's prefs cache for that user so the cache will refresh and pick up the updates (https://bugzilla.redhat.com/show_bug.cgi?id=696214)
[BZ 696276] fix exception that occurred when a non-admin user user clicked on a metric detailed chart link in one of the recent metrics portlets (https://bugzilla.redhat.com/show_bug.cgi?id=696276)
[BZ 676756] when any action button in a table's footer is clicked, disable all
[BZ 676756] fix a few corner case NPEs in original fix;
[BZ 732090] fix so user can only select a single item at a time from the
[BZ 705713] always make all properties, even read-only ones, writable in the config editors in the create-resource and import-resource wizards (https://bugzilla.redhat.com/show_bug.cgi?id=705713)
minor - add missing class-level javadoc, extract out a var for easier debugging, improve a comment
skip the template selection step in resource-create wizard if resource config def does not define more than one template; do not assume resource config defs or plugin config defs define a default template
[BZ 732804] don't show Previous button on the first step of a wizard (https://bugzilla.redhat.com/show_bug.cgi?id=732804)
in the resource creation wizard, if the resource type does not define multiple resource config templates, still show the "info" step since that step also prompts for the resource name, but do not show the template input field, since there is only one possible template; change the label for the template input field from "Templates" to "Template", since the user is selecting a single template
in the resource creation wizard, if the resource type does not define multiple resource config templates, still show the "info" step since that step also prompts for the resource name, but do not show the template input field, since there is only one possible template (I missed this file in my previous commit)
[BZ 696664] remove NotNull annotations for the 'name' field, since it is not a
[BZ 676761] display a friendly error, rather than an ugly stack trace, if the
Jay Shaughnessy (47):
Add mongodb jar deps and src decls
Drift Refactoring
Change eclipse .classpath for new morphia dep version.
Make analogous addition of driftConfigId filter to change set criteria, in
Drift SLSB Refactoring
Add some jdoc explaining the Subject param on signatures in this facet.
Replace the test class, lost in a bad merge.
Drift History View
fix troublesome test
Drift Data Model Change - promote DriftConfiguration to entity
Drift - Fix issues when adding/updating drift configs.
- increase drift.path from 512 to 1024 precision
Add DriftConfiguration as optional change set criteria fetch
Add some eager loading (this should probably be reverted and the drift
Fix drift upgrade script mistake
Drift - Fix issue returning config name in drift composites
- Set the built in filter form to 4 columns to make better use of real estate
Add more user filtering capability to the drift histiry views
- Remove defunct TableSection2
[BZ - 698591 - Can not store preferences]
[BZ - 730065 - (Drift) Detail views don't go away when navigating directly to a new subtab]
Fast Click Problem Work
GUI Stability - Tab Infra
trivial - suppress unchecked warnings classwide for some Table classes
Fix a GWT Error (null issue) in the class setup
Fast click resource tree nav work
Merge branch 'drift'
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
fix category column width in Inventory Summary Report
[BZ - 726747 - Flipping between Inventory Summary and Platform Utilization repeatedly causes global uncaught exception.]
Operation scheduling fixes
[BZ - 695810 - Unable to schedule operation from context menu in group tree]
Add the default drift server plugin to the ear packaging.
More work on op scheduling. Now will not schedule job with invalid
New and Improved HibernateDetachUtility, now with enhanced collision
A fix to the identity collision logic, preventing falling through to the
[BZ 717788 - NPE on Inventory>Agent subtab for a platform that has UNKNOWN avail and has never been UP]
[BZ 729994 - Create/Import wizard does not allow reselection of template]
[BZ 730991 - Left nav tree does not refresh after resource creation]
[BZ 715380 - Uncaught exception defining Alert that triggers CLI script]
[BZ 729132 - New alerts lookup failed]
Folks claim the spinner still exists, so give back its space.
[BZ 729329 - if RHQ server is down, UI shows globally uncaught exception]
Work on Search Bar [BZ 695889]
Work on Search Bar [BZ 695889]
Search Bar work [BZ 695889]
Remove dead class for old resource [group] search bar
John Mazzitelli (48):
make the tree auto-refresh
rename the method to be more descriptive
add top level to the tree - the drift config.
[BZ 718315] support properties name/value pairs with spaces around the equals sign
fix the tree IDs so they do not conflict
Make the drift detection rate configurable
have gwt compiler ignore the domain sync package - it is for the CLI, not GWT client
provide regex so GWT config editor enforces restrictions on the drift config names
explicitly declare "throws RuntimeException" so GWT can properly receive exceptions from the server
enforce the name convention in the SLSB - this protects the name when creating drift configs outside of the GWT UI (such as from a CLI client)
add tests
add API to add includes/excludes to drift config
be able to compare in three modes:
trying to get delete drift config to work - this still isn't working but getting there
make sure the drift config entity is orphaned so hibernate knows to delete it
flush hibernate cache before interacting with agent client
remove delete drift capabilities
more on getting the ability to delete drift configuration
more work on deleting drift configuration - still not finished. need to fix deleting the drift config entity itself
deleting drift configuration now works. need to test that the agent is being told properly and is stopping the drift detection
change error message
we store drift config templates now, we can do the TODO now
fix the drift config edit view so it is read-only for name/basedir/includes/excludes.
provide the ability to detect drift and delete from config menu
clean up active drift plugin system settings - make i18n messages, remove unused constant
opps.. used wrong prop name - forgot "Server"
add the system setting "drift file purge" which lets you indicate how old an orphaned drift file must be before it gets purged
clean up active drift plugin system settings - make i18n messages, remove unused constant
opps.. used wrong prop name - forgot "Server"
Merge commit 'origin/drift' into drift-file-purge
fix the exception messages
when eclipse starts gwt dev mode with JPDA, have it set the rpcTimeout to 10 minutes
[BZ 719731] fix group config view
[BZ 721053] do not show delete all/ack all buttons on alert portlets
[BZ 705727] change the message so its more clear what is happening
Merge commit 'origin/drift' into drift-file-purge
make purge time default 31 days
add diff lib
path name was wrong
fix this so it can build standalone
<option> no longer supports default attrib
[BZ 696224] support direct nav to traits details
show different folder icon for categories
[BZ 732089] a new unit test to make sure the fix works.
[BZ 695880] refactor the way the user-delete functionality works. now works without getting that ugly exception
while working on BZ 713750 - put the controls at the top and use the GWT time range editor. fix the bug where clicking a check box in a control duplicates the filters (that's what the jsp's removeAllChildren is about)
remove the extra Condition line. we need a better utility to string-i-fy the alert, but for now, just use name and value
go to the child history page when link is clicked
John Sanda (57):
Downgrading morphia dependency from SNAPSHOT to release version
adding javadocs
fixing failing test
ren-enabling and fixing test
Working on domain model to provide for efficient access to change set entries
Removing class that has been renamed
Adding initial support for mongodb drift criteria
Support filtering on drift id in mongodb drift plugin
Adding TODO comment
Updating change set parser to handle files with spaces in their names
Don't use the interval as an initial delay for drift schedules
Changing logic and semantics around 'detect drift now'
Taking DriftManagerRemote out of web services to get past JAXB errors
disabling a couple tests
Disabled wrong test in previous commit
Fixing unit tests
Disable test by default until it can be supported on jenkins
Merge branch 'master' into drift
Change set files no longer store directories
[maven-release-plugin] prepare for next development iteration
Initial support for persisting drift file entities in mongodb
starting to add support for filtering during drift detection
Another class was updated as a result of making DriftConfiguration.Filter top level
Adding back methods that were lost during merge conflict
Moving Filter back to core/domain
Make sure new properties are added to the configuration
Adding logic and tests for filtering
Adding filtering support to DriftDetector
Add filtering logic when generating drift change set
disabling mongodb tests for hudson
Handle relative paths in filters
Adding javadocs
Merge branch 'master' into drift
Adding drift server method for retrieving file content
Add support for filtering on directories
Adding initial support for generating a unified diff
Trying to fix test failure on hudson
Removing calls to executeInTransaction to get test passing on hudson
Merge branch 'master' into drift
Adding initial support for displaying diff between file and its previous version
Adding some syntax highlighting to the diff
Use PopupWindow to create a window for displaying files and diffs
Add version info to file/diff viewers
Remove diffutils lib from core/util since it's not used here
Merge branch 'master' into drift
Fixing plugin property name in drift template
DriftManagerBean needs to implement DriftManagerRemote
Add method for generating diff between any two Drift objects
Adding more functions for file diffs and fetching file version history
Adding function for viewing previous version of file
Adding javadocs
Add return statement in if block
Initial commit for DriftManagerTest
Purge change set content directory after sending content to server
Ensure only content files are stored in the content zip file
Do not have the change set reader automatically close stream when reading change set file
Implmenting DriftManager.unscheduleDriftDetection
Lukas Krejci (23):
The exported system settings are now directly backed by the actual system settings properties so that no changes need to be made to the export classes when a new system setting is added. The system settings importer now accepts configuration.
Merge remote-tracking branch 'origin/master' into feature/config-sync
Fixing NPE during import with default configuration.
Fixed the configuration export file XSD and the code that generates the export xml to correspond to each other.
Some tests, more to come.
Merge remote-tracking branch 'origin/master' into feature/config-sync
When updateAllSchedules property was explicitly set to false, the per-metric overrides weren't considered.
Added a bunch of tests for metric template importer.
Merge remote-tracking branch 'origin/master' into feature/config-sync
Implemented tests for config-sync validators and importers. + some changes in the code to better support testability.
commented out the debug output in the test.
The metric template importer now correctly enables/disables and sets the configured intervals on the templates and underlying schedules.
Merge remote-tracking branch 'origin/master' into feature/config-sync
make the import robust against whitespace in the XML.
BZ 731587 - added a new metric template validator that checks that the imported metric templates match records in the database and are not duplicated in the export file.
Preload all the measurement definitions before they are matched against entries in the export file. This speeds up the import big time (somewhat obviously).
Merge remote-tracking branch 'origin/master' into feature/config-sync
Experimental unfinished support for persisting the default configuration in the export file.
MetricTemplateSynchronizer wasn't testable.
removed a wrong assertion and renamed some variables in the system settings exporter test.
Import configuration now embedded in the export file.
Merge branch 'feature/config-sync'
Healing the config-sync unit tests from a merge that changed a lot of assumptions made by them.
Simeon Pinder (2):
moved maven-antrun-plugin, exec-maven-plugin and properties-maven-plugin back into profile for deactivation by brew.
[maven-release-plugin] prepare release RHQ_3_0_0-BETA1
---
.classpath | 4
etc/cli-scripts/drift.js | 122 ++-
etc/eclipse-tools/maven/RHQ | 4
etc/samples/custom-serverplugin/pom.xml | 9
etc/samples/custom-serverplugin/src/main/resources/META-INF/rhq-serverplugin.xml | 4
etc/samples/simplereport-serverplugin/src/main/resources/META-INF/rhq-serverplugin.xml | 4
modules/common/ant-bundle/pom.xml | 2
modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/type/AbstractBundleTypeTest.java | 68 +
modules/common/drift/pom.xml | 2
modules/common/drift/src/main/java/org/rhq/common/drift/ChangeSetReader.java | 36
modules/common/drift/src/main/java/org/rhq/common/drift/ChangeSetReaderImpl.java | 91 +-
modules/common/drift/src/main/java/org/rhq/common/drift/ChangeSetWriter.java | 43 -
modules/common/drift/src/main/java/org/rhq/common/drift/ChangeSetWriterImpl.java | 27
modules/common/drift/src/main/java/org/rhq/common/drift/DirectoryEntry.java | 76 -
modules/common/drift/src/test/java/org/rhq/common/drift/ChangeSetReaderImplTest.java | 105 --
modules/common/drift/src/test/java/org/rhq/common/drift/ChangeSetWriterImplTest.java | 48 -
modules/common/filetemplate-bundle/pom.xml | 2
modules/common/jboss-as/pom.xml | 2
modules/common/pom.xml | 2
modules/core/client-api/pom.xml | 2
modules/core/client-api/src/test/java/org/rhq/core/clientapi/agent/metadata/test/PluginMetadataParserTest.java | 18
modules/core/comm-api/pom.xml | 2
modules/core/dbutils/pom.xml | 4
modules/core/dbutils/src/main/scripts/dbsetup/authz-data.xml | 18
modules/core/dbutils/src/main/scripts/dbsetup/sysconfig-data.xml | 4
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 10
modules/core/domain/pom.xml | 2
modules/core/domain/src/main/java/org/rhq/core/domain/common/EntityContext.java | 34
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfiguration.java | 108 +-
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationComparator.java | 136 +++
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java | 140 ++-
modules/core/domain/src/main/java/org/rhq/core/domain/drift/FileDiffReport.java | 59 +
modules/core/domain/src/main/java/org/rhq/core/domain/drift/Filter.java | 85 ++
modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADrift.java | 9
modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftChangeSet.java | 11
modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftFile.java | 27
modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftFileBits.java | 7
modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java | 13
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java | 6
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceTypeFacet.java | 2
modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java | 33
modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java | 7
modules/core/domain/src/main/java/org/rhq/core/domain/sync/entity/MetricTemplate.java | 47 -
modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftConfigurationTest.java | 196 ++++
modules/core/gui/pom.xml | 2
modules/core/native-system/pom.xml | 2
modules/core/plugin-api/pom.xml | 2
modules/core/plugin-container/pom.xml | 2
modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainerConfiguration.java | 49 +
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DirectoryAnalyzer.java | 115 --
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftClient.java | 9
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftDetectionException.java | 39
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftDetector.java | 215 ++---
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftFilesSender.java | 12
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java | 74 +
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/FilterFileVisitor.java | 153 +++
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ScheduleQueue.java | 38
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/ScheduleQueueImpl.java | 38
modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/ChangeSetManagerImplTest.java | 34
modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DirectoryAnalyzerTest.java | 121 --
modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftDetectorTest.java | 234 ++---
modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftFilesSenderTest.java | 21
modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftManagerTest.java | 264 ++++++
modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/DriftTest.java | 14
modules/core/plugin-container/src/test/java/org/rhq/core/pc/drift/FilterFileVisitorTest.java | 224 +++++
modules/core/plugin-container/src/test/xml/rhq-plugin-jmx-server-test.xml | 2
modules/core/plugin-validator/pom.xml | 2
modules/core/plugindoc/pom.xml | 2
modules/core/pom.xml | 2
modules/core/util/pom.xml | 16
modules/core/util/src/main/java/org/rhq/core/util/file/FileUtil.java | 125 +++
modules/core/util/src/main/java/org/rhq/core/util/file/FileVisitor.java | 37
modules/core/util/src/main/java/org/rhq/core/util/file/PathFilter.java | 40
modules/core/util/src/test/java/org/rhq/core/util/file/FileUtilTest.java | 170 ++++
modules/enterprise/agent/pom.xml | 2
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfiguration.java | 9
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentConfigurationConstants.java | 20
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentSetupInstructions.java | 19
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/SetupPromptCommand.java | 14
modules/enterprise/agent/src/main/resources/agent-configuration.xml | 25
modules/enterprise/agentupdate/pom.xml | 2
modules/enterprise/binding/pom.xml | 4
modules/enterprise/comm/pom.xml | 2
modules/enterprise/gui/base-perspective-jar/pom.xml | 2
modules/enterprise/gui/base-perspective-war/pom.xml | 2
modules/enterprise/gui/content_http-war/pom.xml | 2
modules/enterprise/gui/coregui/pom.xml | 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java | 102 --
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java | 26
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java | 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/SystemSettingsView.java | 67 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java | 21
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java | 32
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java | 73 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/BundleDeployWizard.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java | 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/AbstractRecordEditor.java | 14
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSelectedEvent.java | 14
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/AbstractTableSection.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 48 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableSection2.java | 367 ---------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java | 14
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/view/AbstractSectionedLeftNavigationView.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java | 24
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java | 312 +++----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java | 345 +++-----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletViewFactory.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupAlertsPortlet.java | 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java | 17
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java | 67 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java | 16
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java | 17
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java | 16
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java | 21
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java | 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/groups/graph/ResourceGroupGraphPortlet.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/ResourceGraphPortlet.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java | 12
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java | 33
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/drift/RecentDriftsPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedResourcesPortlet.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationHistoryPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationSchedulePortlet.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceAlertsPortlet.java | 18
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceBundleDeploymentsPortlet.java | 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java | 76 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceEventsPortlet.java | 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java | 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java | 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOperationsPortlet.java | 22
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java | 21
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MashupPortlet.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MessagePortlet.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/AbstractDriftChangeSetsTreeView.java | 145 ++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigurationEditView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftConfigurationView.java | 76 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDataSource.java | 45 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java | 208 ++++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftHistoryView.java | 115 --
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/ResourceDriftChangeSetsTreeView.java | 42 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DriftGWTService.java | 56 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListView.java | 16
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java | 37
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDataSource.java | 12
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java | 151 ++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java | 35
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupCompositeDataSource.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupContextMenu.java | 41 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java | 83 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeContextMenu.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationEditView.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationSettings.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/GroupPluginConfigurationEditView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/HistoryGroupPluginConfigurationSettings.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java | 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java | 33
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java | 38
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/CustomResourceTreeGrid.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java | 80 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java | 50 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java | 51 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/ResourceResourceAgentView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView.java | 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/TimelineView.java | 66 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/AbstractResourceFactoryWizard.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryConfigurationStep.java | 87 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java | 17
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryImportWizard.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryInfoStep.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java | 212 -----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReport.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/FlexSearchBar.java | 101 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenter.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java | 101 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/TrackingRequestCallback.java | 42 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/DriftGWTServiceImpl.java | 69 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SubjectGWTServiceImpl.java | 9
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml | 8
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 35
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 31
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 27
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties | 208 ++---
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties | 26
modules/enterprise/gui/coregui/src/main/webapp/css/search.css | 119 +-
modules/enterprise/gui/coregui/src/main/webapp/images/resources/folder_mixed_closed.png |binary
modules/enterprise/gui/coregui/src/main/webapp/images/resources/folder_mixed_opened.png |binary
modules/enterprise/gui/installer-war/pom.xml | 2
modules/enterprise/gui/pom.xml | 2
modules/enterprise/gui/portal-war/pom.xml | 2
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp | 1
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp | 4
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp | 318 +++----
modules/enterprise/pom.xml | 2
modules/enterprise/remoting/cli/pom.xml | 2
modules/enterprise/remoting/client-api/pom.xml | 2
modules/enterprise/remoting/client-deps/pom.xml | 2
modules/enterprise/remoting/pom.xml | 2
modules/enterprise/remoting/webservices/pom.xml | 2
modules/enterprise/server/client-api/pom.xml | 4
modules/enterprise/server/container-lib/pom.xml | 2
modules/enterprise/server/container/pom.xml | 2
modules/enterprise/server/container/src/main/resources/jbossas/server/default/conf/jboss-log4j.xml | 16
modules/enterprise/server/ear/pom.xml | 9
modules/enterprise/server/jar/pom.xml | 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java | 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java | 202 ++--
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/util/ConfigurationMaskingUtility.java | 17
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java | 224 +++--
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerLocal.java | 72 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerRemote.java | 31
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java | 101 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerLocal.java | 19
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java | 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerLocal.java | 14
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java | 57 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerLocal.java | 20
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GlobalActivationContext.java | 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GroupActivationContext.java | 5
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/ResourceActivationContext.java | 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/drift/DriftServerPluginFacet.java | 28
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java | 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java | 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJob.java | 20
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java | 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/DefaultImportConfigurationDescriptor.java | 43 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/ExportingInputStream.java | 222 ++++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/MetricTemplateSynchronizer.java | 28
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/SynchronizationManagerBean.java | 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/Synchronizer.java | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/importers/Importer.java | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/importers/MetricTemplateImporter.java | 185 ++--
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/importers/SystemSettingsImporter.java | 46 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/util/IndentingXMLStreamWriter.java | 393 +++++++++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/validators/ConsistencyValidator.java | 9
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/validators/DeployedAgentPluginsValidator.java | 22
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/validators/MetricTemplateValidator.java | 121 ++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/validators/SystemSettingsValidator.java | 4
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftManagerBeanTest.java | 8
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java | 76 +
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java | 2
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/DeployedAgentPluginsValidatorTest.java | 219 +++++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/DummyExporter.java | 38
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/DummyImporter.java | 60 -
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/DummySynchronizer.java | 60 -
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/ExportingInputStreamTest.java | 215 +++++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/MetricTemplateExporterTest.java | 193 +---
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/MetricTemplateImporterTest.java | 380 +++++++++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/MetricTemplateValidatorTest.java | 161 +++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/SystemSettingsExporterTest.java | 152 ---
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/SystemSettingsImporterTest.java | 120 ++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/SystemSettingsValidatorTest.java | 79 +
modules/enterprise/server/plugins/alert-cli/pom.xml | 4
modules/enterprise/server/plugins/alert-cli/src/main/java/org/rhq/enterprise/server/plugins/alertCli/CliSender.java | 14
modules/enterprise/server/plugins/alert-email/pom.xml | 4
modules/enterprise/server/plugins/alert-irc/pom.xml | 4
modules/enterprise/server/plugins/alert-log4j/pom.xml | 4
modules/enterprise/server/plugins/alert-microblog/pom.xml | 4
modules/enterprise/server/plugins/alert-mobicents/pom.xml | 4
modules/enterprise/server/plugins/alert-operations/pom.xml | 4
modules/enterprise/server/plugins/alert-roles/pom.xml | 4
modules/enterprise/server/plugins/alert-snmp/pom.xml | 4
modules/enterprise/server/plugins/alert-subject/pom.xml | 4
modules/enterprise/server/plugins/ant-bundle/pom.xml | 2
modules/enterprise/server/plugins/cloud/src/main/resources/META-INF/rhq-serverplugin.xml | 2
modules/enterprise/server/plugins/cobbler/pom.xml | 4
modules/enterprise/server/plugins/disk/pom.xml | 2
modules/enterprise/server/plugins/drift-mongodb/pom.xml | 2
modules/enterprise/server/plugins/drift-mongodb/src/main/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBDriftServer.java | 32
modules/enterprise/server/plugins/drift-mongodb/src/main/java/org/rhq/enterprise/server/plugins/drift/mongodb/entities/MongoDBChangeSetEntry.java | 10
modules/enterprise/server/plugins/drift-mongodb/src/main/java/org/rhq/enterprise/server/plugins/drift/mongodb/entities/MongoDBFile.java | 27
modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/GridFSTest.java | 63 +
modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOTest.java | 16
modules/enterprise/server/plugins/drift-rhq/pom.xml | 8
modules/enterprise/server/plugins/drift-rhq/src/main/java/org/rhq/enterprise/server/plugins/drift/JPADriftServerPluginComponent.java | 18
modules/enterprise/server/plugins/filetemplate-bundle/pom.xml | 2
modules/enterprise/server/plugins/groovy-script/pom.xml | 4
modules/enterprise/server/plugins/jboss-software/pom.xml | 2
modules/enterprise/server/plugins/packagetype-cli/pom.xml | 4
modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml | 2
modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml | 2
modules/enterprise/server/plugins/perspectives/core/pom.xml | 2
modules/enterprise/server/plugins/pom.xml | 2
modules/enterprise/server/plugins/rhnhosted/pom.xml | 2
modules/enterprise/server/plugins/url/pom.xml | 2
modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml | 2
modules/enterprise/server/plugins/yum/pom.xml | 2
modules/enterprise/server/safe-invoker/pom.xml | 2
modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java | 208 ++++-
modules/enterprise/server/safe-invoker/src/test/java/org/rhq/enterprise/server/util/HibernateDetachUtilityTest.java | 141 +++
modules/enterprise/server/sars/agent-sar/pom.xml | 2
modules/enterprise/server/sars/agent-sar/src/main/resources/META-INF/embedded-agent-configuration.xml | 24
modules/enterprise/server/sars/pom.xml | 2
modules/enterprise/server/xml-schemas/pom.xml | 2
modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ConfigurationInstanceDescriptorUtil.java | 406 ++++++++++
modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java | 8
modules/enterprise/server/xml-schemas/src/main/resources/rhq-configuration-export.xsd | 24
modules/enterprise/server/xml-schemas/src/main/resources/rhq-configuration-instance.xsd | 231 +++++
modules/enterprise/server/xml-schemas/src/test/java/org/rhq/enterprise/server/xmlschema/ConfigurationInstanceDescriptorUtilTest.java | 229 +++++
modules/helpers/bundleGen/pom.xml | 4
modules/helpers/perftest-support/pom.xml | 4
modules/helpers/pom.xml | 2
modules/helpers/rtfilter/pom.xml | 2
modules/plugins/aliases/pom.xml | 2
modules/plugins/ant-bundle/pom.xml | 2
modules/plugins/apache/pom.xml | 2
modules/plugins/augeas/pom.xml | 2
modules/plugins/byteman/pom.xml | 2
modules/plugins/cobbler/pom.xml | 2
modules/plugins/cron/pom.xml | 2
modules/plugins/database/pom.xml | 2
modules/plugins/filetemplate-bundle/pom.xml | 2
modules/plugins/grub/pom.xml | 2
modules/plugins/hadoop/pom.xml | 2
modules/plugins/hibernate/pom.xml | 2
modules/plugins/hosts/pom.xml | 2
modules/plugins/hudson/pom.xml | 4
modules/plugins/iis/pom.xml | 2
modules/plugins/irc/pom.xml | 2
modules/plugins/jboss-as-5/pom.xml | 2
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/helper/JBossInstallationInfo.java | 4
modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml | 2
modules/plugins/jboss-as-7/pom.xml | 2
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java | 5
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java | 12
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java | 37
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java | 13
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java | 9
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java | 9
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java | 2
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/WarComponent.java | 58 -
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/WarDiscovery.java | 45 -
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml | 133 ++-
modules/plugins/jboss-as/pom.xml | 2
modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/helper/JBossInstallationInfo.java | 6
modules/plugins/jboss-cache-v3/pom.xml | 2
modules/plugins/jboss-cache/pom.xml | 2
modules/plugins/jmx/pom.xml | 2
modules/plugins/kickstart/pom.xml | 2
modules/plugins/mod-cluster/pom.xml | 2
modules/plugins/mysql/pom.xml | 2
modules/plugins/netservices/pom.xml | 2
modules/plugins/oracle/pom.xml | 2
modules/plugins/pattern-generator/pom.xml | 2
modules/plugins/perftest/pom.xml | 2
modules/plugins/platform/pom.xml | 2
modules/plugins/pom.xml | 2
modules/plugins/postfix/pom.xml | 2
modules/plugins/postgres/pom.xml | 2
modules/plugins/rhq-agent/pom.xml | 2
modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml | 2
modules/plugins/rhq-server/pom.xml | 2
modules/plugins/samba/pom.xml | 2
modules/plugins/script/pom.xml | 2
modules/plugins/script2/pom.xml | 2
modules/plugins/snmptrapd/pom.xml | 2
modules/plugins/sshd/pom.xml | 2
modules/plugins/sudoers/pom.xml | 2
modules/plugins/tomcat/pom.xml | 2
modules/plugins/twitter/pom.xml | 2
modules/plugins/validate-all-plugins/pom.xml | 2
modules/plugins/virt/pom.xml | 2
modules/pom.xml | 2
modules/test-utils/pom.xml | 2
modules/test-utils/src/main/java/org/rhq/test/JPAUtils.java | 10
pom.xml | 153 ++-
391 files changed, 9902 insertions(+), 4820 deletions(-)
---
12 years, 8 months
[rhq] Branch 'release_jon3.0.0-test-build' - modules/common modules/core modules/enterprise modules/helpers modules/plugins modules/pom.xml modules/test-utils pom.xml
by Simeon Pinder
modules/common/ant-bundle/pom.xml | 2 +-
modules/common/drift/pom.xml | 2 +-
modules/common/filetemplate-bundle/pom.xml | 2 +-
modules/common/jboss-as/pom.xml | 2 +-
modules/common/pom.xml | 2 +-
modules/core/client-api/pom.xml | 2 +-
modules/core/comm-api/pom.xml | 2 +-
modules/core/dbutils/pom.xml | 2 +-
modules/core/domain/pom.xml | 2 +-
modules/core/gui/pom.xml | 2 +-
modules/core/native-system/pom.xml | 2 +-
modules/core/plugin-api/pom.xml | 2 +-
modules/core/plugin-container/pom.xml | 2 +-
modules/core/plugin-validator/pom.xml | 2 +-
modules/core/plugindoc/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/util/pom.xml | 2 +-
modules/enterprise/agent/pom.xml | 2 +-
modules/enterprise/agentupdate/pom.xml | 2 +-
modules/enterprise/binding/pom.xml | 4 ++--
modules/enterprise/comm/pom.xml | 2 +-
modules/enterprise/gui/base-perspective-jar/pom.xml | 2 +-
modules/enterprise/gui/base-perspective-war/pom.xml | 2 +-
modules/enterprise/gui/content_http-war/pom.xml | 2 +-
modules/enterprise/gui/coregui/pom.xml | 2 +-
modules/enterprise/gui/installer-war/pom.xml | 2 +-
modules/enterprise/gui/pom.xml | 2 +-
modules/enterprise/gui/portal-war/pom.xml | 2 +-
modules/enterprise/pom.xml | 2 +-
modules/enterprise/remoting/cli/pom.xml | 2 +-
modules/enterprise/remoting/client-api/pom.xml | 2 +-
modules/enterprise/remoting/client-deps/pom.xml | 2 +-
modules/enterprise/remoting/pom.xml | 2 +-
modules/enterprise/remoting/webservices/pom.xml | 2 +-
modules/enterprise/server/client-api/pom.xml | 4 ++--
modules/enterprise/server/container-lib/pom.xml | 2 +-
modules/enterprise/server/container/pom.xml | 2 +-
modules/enterprise/server/ear/pom.xml | 2 +-
modules/enterprise/server/jar/pom.xml | 2 +-
modules/enterprise/server/plugins/alert-cli/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-email/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-irc/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-log4j/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-microblog/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-mobicents/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-operations/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-roles/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-snmp/pom.xml | 4 ++--
modules/enterprise/server/plugins/alert-subject/pom.xml | 4 ++--
modules/enterprise/server/plugins/ant-bundle/pom.xml | 2 +-
modules/enterprise/server/plugins/cobbler/pom.xml | 4 ++--
modules/enterprise/server/plugins/disk/pom.xml | 2 +-
modules/enterprise/server/plugins/drift-mongodb/pom.xml | 2 +-
modules/enterprise/server/plugins/drift-rhq/pom.xml | 2 +-
modules/enterprise/server/plugins/filetemplate-bundle/pom.xml | 2 +-
modules/enterprise/server/plugins/groovy-script/pom.xml | 4 ++--
modules/enterprise/server/plugins/jboss-software/pom.xml | 2 +-
modules/enterprise/server/plugins/packagetype-cli/pom.xml | 4 ++--
modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml | 2 +-
modules/enterprise/server/plugins/perspectives/core/pom.xml | 2 +-
modules/enterprise/server/plugins/pom.xml | 2 +-
modules/enterprise/server/plugins/rhnhosted/pom.xml | 2 +-
modules/enterprise/server/plugins/url/pom.xml | 2 +-
modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml | 2 +-
modules/enterprise/server/plugins/yum/pom.xml | 2 +-
modules/enterprise/server/safe-invoker/pom.xml | 2 +-
modules/enterprise/server/sars/agent-sar/pom.xml | 2 +-
modules/enterprise/server/sars/pom.xml | 2 +-
modules/enterprise/server/xml-schemas/pom.xml | 2 +-
modules/helpers/bundleGen/pom.xml | 4 ++--
modules/helpers/perftest-support/pom.xml | 4 ++--
modules/helpers/pom.xml | 2 +-
modules/helpers/rtfilter/pom.xml | 2 +-
modules/plugins/aliases/pom.xml | 2 +-
modules/plugins/ant-bundle/pom.xml | 2 +-
modules/plugins/apache/pom.xml | 2 +-
modules/plugins/augeas/pom.xml | 2 +-
modules/plugins/byteman/pom.xml | 2 +-
modules/plugins/cobbler/pom.xml | 2 +-
modules/plugins/cron/pom.xml | 2 +-
modules/plugins/database/pom.xml | 2 +-
modules/plugins/filetemplate-bundle/pom.xml | 2 +-
modules/plugins/grub/pom.xml | 2 +-
modules/plugins/hadoop/pom.xml | 2 +-
modules/plugins/hibernate/pom.xml | 2 +-
modules/plugins/hosts/pom.xml | 2 +-
modules/plugins/hudson/pom.xml | 4 ++--
modules/plugins/iis/pom.xml | 2 +-
modules/plugins/irc/pom.xml | 2 +-
modules/plugins/jboss-as-5/pom.xml | 2 +-
modules/plugins/jboss-as-7/pom.xml | 2 +-
modules/plugins/jboss-as/pom.xml | 2 +-
modules/plugins/jboss-cache-v3/pom.xml | 2 +-
modules/plugins/jboss-cache/pom.xml | 2 +-
modules/plugins/jmx/pom.xml | 2 +-
modules/plugins/kickstart/pom.xml | 2 +-
modules/plugins/mod-cluster/pom.xml | 2 +-
modules/plugins/mysql/pom.xml | 2 +-
modules/plugins/netservices/pom.xml | 2 +-
modules/plugins/oracle/pom.xml | 2 +-
modules/plugins/pattern-generator/pom.xml | 2 +-
modules/plugins/perftest/pom.xml | 2 +-
modules/plugins/platform/pom.xml | 2 +-
modules/plugins/pom.xml | 2 +-
modules/plugins/postfix/pom.xml | 2 +-
modules/plugins/postgres/pom.xml | 2 +-
modules/plugins/rhq-agent/pom.xml | 2 +-
modules/plugins/rhq-server/pom.xml | 2 +-
modules/plugins/samba/pom.xml | 2 +-
modules/plugins/script/pom.xml | 2 +-
modules/plugins/script2/pom.xml | 2 +-
modules/plugins/snmptrapd/pom.xml | 2 +-
modules/plugins/sshd/pom.xml | 2 +-
modules/plugins/sudoers/pom.xml | 2 +-
modules/plugins/tomcat/pom.xml | 2 +-
modules/plugins/twitter/pom.xml | 2 +-
modules/plugins/validate-all-plugins/pom.xml | 2 +-
modules/plugins/virt/pom.xml | 2 +-
modules/pom.xml | 2 +-
modules/test-utils/pom.xml | 2 +-
pom.xml | 2 +-
121 files changed, 139 insertions(+), 139 deletions(-)
New commits:
commit a9d727b6d1bbd3b2a97485ed8108bab9edc0866b
Author: Simeon Pinder <simeonpinder(a)gmail.com>
Date: Thu Aug 25 18:05:54 2011 -0400
[maven-release-plugin] prepare release RHQ_3_0_0-BETA1
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 1eb86ef..1ac06bf 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index 73ab33a..a3e379e 100644
--- a/modules/common/drift/pom.xml
+++ b/modules/common/drift/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml
index 352de33..735d079 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index 184c5ad..b659f5a 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index bd88fa0..9270b30 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index 9f5f66a..2e8829e 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index 5a8b356..1a9cfcd 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index aa20853..cd4f833 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-dbutils</artifactId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index 42d28e1..025c215 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index bb4dc2c..3a01fd9 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index 7d83f3d..c2f75ae 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index fc78701..780224a 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 1d12869..3d9116c 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml
index f2953a6..a9f52b5 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index 24243e3..afc2578 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index bc41a9b..2ae4d8f 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index dfa5bb8..2ced23e 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index f12c1a1..895969a 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml
index 8b7ffe8..0edd383 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index d96cf83..c2ced3e 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Script Bindings</name>
<description>Abstraction of different facilities and default configurations for script bindings</description>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index f424704..58bc8f7 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml
index cebd439..ddd277b 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml
index b66da2c..93e8ad7 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml
index db7d757..d69b6db 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index de77f3f..4e204dc 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index 900d476..c19c071 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index 8e8cf66..708bedd 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml
index 4e2ac9f..a670bbb 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 01fb7f6..e40a14f 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index 24fbb60..01c579e 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml
index 1a1c88c..1e3ae32 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-deps/pom.xml b/modules/enterprise/remoting/client-deps/pom.xml
index 3fe07b7..6abd765 100644
--- a/modules/enterprise/remoting/client-deps/pom.xml
+++ b/modules/enterprise/remoting/client-deps/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index f4b1866..257910a 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml
index dee43bc..2a563f8 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/client-api/pom.xml b/modules/enterprise/server/client-api/pom.xml
index c57eaba..0ea68f2 100644
--- a/modules/enterprise/server/client-api/pom.xml
+++ b/modules/enterprise/server/client-api/pom.xml
@@ -5,13 +5,13 @@
<parent>
<artifactId>rhq-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server Client API</name>
<description>The implementation of the client API when accessing the server locally</description>
diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml
index 1aebae1..312403a 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index d27c157..53b9266 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index 8cdaf8b..b16de7a 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index d2f2bc5..e34d2bc 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/alert-cli/pom.xml b/modules/enterprise/server/plugins/alert-cli/pom.xml
index b380393..af345dd 100644
--- a/modules/enterprise/server/plugins/alert-cli/pom.xml
+++ b/modules/enterprise/server/plugins/alert-cli/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server CLI Script Alert Plugin</name>
<description>An alert sender able to execute an arbitrary CLI script as a response to an alert</description>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml
index e1e1890..97fc979 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server Email Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml
index 1b609e1..899fc56 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server IRC Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-log4j/pom.xml b/modules/enterprise/server/plugins/alert-log4j/pom.xml
index 1a27831..ce4b5ba 100644
--- a/modules/enterprise/server/plugins/alert-log4j/pom.xml
+++ b/modules/enterprise/server/plugins/alert-log4j/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server Log4J Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index ab68d6b..1f7f9ab 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server Microblog Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index 0adccaf..3483ff0 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server Mobicents Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml
index 2c9bcfa..03c0d0d 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,14 +2,14 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server Opertions Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml
index 06bab65..925bb4c 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server Roles Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index 3763c54..8f4e072 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server SNMP Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml
index bb595b5..52892f3 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index c4e59b2..8e51ebb 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml
index 381f64c..35cfcdf 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server Cobbler Plugin</name>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml
index 403ef41..212b5ba 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/drift-mongodb/pom.xml b/modules/enterprise/server/plugins/drift-mongodb/pom.xml
index 2cb4bbf..1d01aa0 100644
--- a/modules/enterprise/server/plugins/drift-mongodb/pom.xml
+++ b/modules/enterprise/server/plugins/drift-mongodb/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/drift-rhq/pom.xml b/modules/enterprise/server/plugins/drift-rhq/pom.xml
index 9c9d3b6..f882eb4 100644
--- a/modules/enterprise/server/plugins/drift-rhq/pom.xml
+++ b/modules/enterprise/server/plugins/drift-rhq/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index ad1c570..b055a42 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml b/modules/enterprise/server/plugins/groovy-script/pom.xml
index 0d2bf4b..6c12a49 100644
--- a/modules/enterprise/server/plugins/groovy-script/pom.xml
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>groovy-script-server-plugin</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server Groovy Script Plugin</name>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml
index dacaec2..9f37001 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/packagetype-cli/pom.xml b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
index 9a51242..a0e0427 100644
--- a/modules/enterprise/server/plugins/packagetype-cli/pom.xml
+++ b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index f73ecb8..f44ea12 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index c2d5c7e..0f25c16 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml
index abf3f43..9841dd9 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index 04df0b8..484f937 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml
index 79ccf2b..bc71f7b 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index 9e221a0..f0390aa 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml
index ce8468c..9bb157e 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml
index 05cb339..ff9a022 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml
index 00344d4..455ee28 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml
index 2377858..79b2c9c 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml
index 90c0da6..cc4fd74 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index 9e80f1f..8c97fa6 100644
--- a/modules/helpers/bundleGen/pom.xml
+++ b/modules/helpers/bundleGen/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<build>
<plugins>
diff --git a/modules/helpers/perftest-support/pom.xml b/modules/helpers/perftest-support/pom.xml
index e488bb0..531177c 100644
--- a/modules/helpers/perftest-support/pom.xml
+++ b/modules/helpers/perftest-support/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<name>Performance Testing Support</name>
<description>To support performance testing, this is a basic tool to support extracting and later reimporting of
data from/to a database.
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index 0c73fd3..c67926a 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 417a3df..3af5885 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index 959fa3c..979119e 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index ff8c753..a4acb82 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 0694d78..1730ce9 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index 66d35d1..265a19e 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 46bcb55..94a7d1b 100644
--- a/modules/plugins/byteman/pom.xml
+++ b/modules/plugins/byteman/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index 9a45599..0167579 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index e42d480..6e9beed 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 6c1812b..c05fb70 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml
index c1e0a3d..4663b94 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index 93b5dd3..613fe42 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index 840e619..4f3cef9 100644
--- a/modules/plugins/hadoop/pom.xml
+++ b/modules/plugins/hadoop/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index e482d30..30bc95f 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 31af33b..ec9bc50 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index b097071..7e06fff 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,12 +6,12 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<packaging>jar</packaging>
<name>RHQ Hudson Plugin</name>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 2cdc32a..800f427 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index edf12ea..ad29033 100644
--- a/modules/plugins/irc/pom.xml
+++ b/modules/plugins/irc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index 6ec0096..50195e4 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as-7/pom.xml b/modules/plugins/jboss-as-7/pom.xml
index ca63c5e..c23a441 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index 57c8bb3..d8c5045 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml
index 1a3a1df..33ce865 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index ae06793..3473824 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index 1daf86d..ab3477c 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index dc87ed7..beee5a9 100644
--- a/modules/plugins/kickstart/pom.xml
+++ b/modules/plugins/kickstart/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index ab52e84..7579f5b 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index d8ebb5d..b9743dc 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index f1675e4..0e6e969 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index 8a3b3c0..d9d67ff 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pattern-generator/pom.xml b/modules/plugins/pattern-generator/pom.xml
index 6b0791d..31648ab 100644
--- a/modules/plugins/pattern-generator/pom.xml
+++ b/modules/plugins/pattern-generator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 843fe3d..a6ec953 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 99f36d0..f76db2d 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index f32159e..28a0399 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 5ef7252..d0d5c1c 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index 365f6c4..9eacc08 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index 60471c2..5f3a34e 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index e88b97f..a1fe6b7 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 84fc9b7..26111aa 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index d31afb9..441379c 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index 2cf689c..f99726d 100644
--- a/modules/plugins/script2/pom.xml
+++ b/modules/plugins/script2/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 05ed401..1a6d334 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 83da74a..513edeb 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 1b69180..cd15c95 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index f6dfebd..bfcdf08 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index 50ff9b6..cfa914c 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml
index 6565a7b..f83207c 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index 8700a19..257623e 100644
--- a/modules/plugins/virt/pom.xml
+++ b/modules/plugins/virt/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index 2b45c62..ee870ac 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 5c6e85c..fe7bfe9 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -7,7 +7,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index 1be70d1..28a08b0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>3.0.0-BETA1</version>
<packaging>pom</packaging>
<name>RHQ</name>
12 years, 8 months
[rhq] modules/enterprise
by mazz
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp | 4 -
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp | 17 +++-
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp | 35 ++++------
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp | 10 --
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp | 2
5 files changed, 31 insertions(+), 37 deletions(-)
New commits:
commit 59561513dd5e014a4ae70b0abfff9ad0ef046f65
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Aug 25 15:57:38 2011 -0400
clean up some of the timeline
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
index 978c62e..40aeac8 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
@@ -57,8 +57,8 @@
String icon = FunctionTagLibrary.getAlertPriorityURL(alert.getAlertDefinition().getPriority());
StringBuilder buf = new StringBuilder();
for (AlertConditionLog log : alert.getConditionLogs()) {
- buf.append("<b>Condition:</b>" + log.getCondition().getName() + "<br/>");
- buf.append("<b>Value:</b>" + log.getValue() + "</b>");
+ buf.append("<b>Condition:</b> " + log.getCondition().getName() + "<br/>");
+ buf.append("<b>Value:</b> " + log.getValue());
}
String link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Alerts/History/" + alert.getId();
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
index c1d3df5..114baf0 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
@@ -59,13 +59,14 @@
}
String link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Inventory/ChildHistory";
-
+ String username = entry.getSubjectName();
+ String resourceName = entry.getCreatedResourceName();
%>
{ "start" : "<%=sdf.format(entry.getCreatedTime())%>",
- "title" : "Child resource created",
+ "title" : "Child Resource Created",
"link" : "<%=link%>",
- "description" : "<b>User:</b> <%=(""+entry.getSubjectName()).replaceAll("[\"']","").trim()%><br/><b>Status:</b> <%=(""+entry.getStatus()).replaceAll("[\"']","").trim()%>",
+ "description" : "<b>Resource Name:</b> <%=(""+resourceName).replaceAll("[\"']","").trim()%><br/><b>User:</b> <%=(""+username).replaceAll("[\"']","").trim()%><br/><b>Status:</b> <%=(""+entry.getStatus())%>",
"icon" : "<%=icon%>",
"color" : "<%=(entry.getStatus() != CreateResourceStatus.FAILURE ? "#4EB84E" : "#DD5656")%>"
}
@@ -96,12 +97,16 @@
}
String link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Inventory/ChildHistory";
-
+ String username = entry.getSubjectName();
+ String description = "<b>User:</b> "+ username.replaceAll("[\"']","").trim() + "<br/><b>Status:</b> " + entry.getStatus();
+ if (entry.getResource() != null) {
+ description = "<b>Resource Name:</b> " + entry.getResource().getName().replaceAll("[\"']","").trim() + "<br/>" + description;
+ }
%>
{ "start" : "<%=sdf.format(entry.getCreatedTime())%>",
- "title" : "Child resource deleted",
+ "title" : "Child Resource Deleted",
"link" : "<%=link%>",
- "description" : "<b>User:</b> <%=(""+entry.getSubjectName()).replaceAll("[\"']","").trim()%><br/><b>Status:</b> <%=(""+entry.getStatus()).replaceAll("[\"']","").trim()%>",
+ "description" : "<%= description %>",
"icon" : "<%=icon%>",
"color" : "<%=(entry.getStatus() != DeleteResourceStatus.FAILURE ? "#4EB84E" : "#DD5656")%>"
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
index bb6ced8..d14ab93 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
@@ -33,15 +33,8 @@
boolean tooManyEvents = false;
PageList<EventComposite> list =
- eventManager.findEventComposites(subject, EntityContext.forResource(resourceId), begin, end, null,
- null, null, new PageControl(0,10000, new OrderingField("timestamp", PageOrdering.ASC)));
-
- /* TODO GH: Add alert to screen
- if (list.getTotalSize() != list.size()) {
- tooManyEvents = true;
- }*/
-
-
+ eventManager.findEventComposites(subject, EntityContext.forResource(resourceId), begin, end, null,
+ null, null, new PageControl(0,10000, new OrderingField("timestamp", PageOrdering.ASC)));
%>
<%! public String trimLength(String string, int length) {
@@ -51,16 +44,16 @@
public String eventColor(EventSeverity severity) {
switch (severity) {
case DEBUG:
- return "green";
+ return "#00FF00";
case INFO:
- return "blue";
+ return "#0000FF";
case WARN:
- return "olive";
+ return "#FFA500";
case ERROR:
- return "orange";
+ return "#FF0000";
case FATAL:
default:
- return "red";
+ return "#FF0000";
}
}
@@ -81,7 +74,7 @@
return events.get(0).getTimestamp();
}
public String getEventDetail() {
- return events.size() + " events";
+ return events.size() + " Events";
}
public EventSeverity getSeverity() {
EventSeverity highestSeverity = events.get(0).getSeverity();
@@ -157,19 +150,25 @@
String color = eventColor(event.getSeverity());
String icon = FunctionTagLibrary.getEventSeverityURL(event.getSeverity(), grouped);
- String link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + event.getEventId();
+ String link;
+ if (grouped) {
+ link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History";
+ } else {
+ link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + event.getEventId();
+ }
String detail = null;
if (grouped) {
StringBuilder buf = new StringBuilder();
for (EventComposite childEvent : ((GroupedEventComposite)event).events) {
+ String childColor = eventColor(childEvent.getSeverity());
buf.append("<a href='/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + childEvent.getEventId() + "'>");
- buf.append("<font size=\"-1\" color=\"" + color + "\">" + escapeBackslashes(trimLength(childEvent.getEventDetail(),80)) + "</font></a><br />");
+ buf.append("<font color=\"" + childColor + "\">" + escapeBackslashes(trimLength(childEvent.getEventDetail(),80)) + "</font></a><br />");
}
detail = buf.toString();
} else {
detail = escapeBackslashes(event.getEventDetail());
- detail = "<b>Source:</b>" + escapeBackslashes(event.getSourceLocation()) + "<br/><b>Detail:</b>" + detail;
+ detail = "<b>Source:</b> " + escapeBackslashes(event.getSourceLocation()) + "<br/><b>Detail:</b> " + detail;
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
index 5e28985..49fd1cb 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
@@ -44,17 +44,7 @@
first = false;
String icon = FunctionTagLibrary.getOperationStatusURL(operation.getStatus());
-
String link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Operations/History/" + operation.getId();
-
-// out.write(
-// " <event start=\"" + sdf.format(new Date(operation.getCreatedTime())) + "\" " +
-// "title=\"Operation: " + operation.getOperationDefinition().getDisplayName() + "\" \n" +
-// "link=\"/rhq/resource/operation/resourceOperationHistoryDetails.xhtml?id=" + resourceId + "&opId=" + operation.getId() + "\" " +
-// "icon=\"" + icon + "\" >\n" +
-// "<b>User:</b> " + operation.getSubjectName() + "<br/>" +
-// "<b>Status:</b> " + operation.getStatus() +
-// " </event>\n\n");
%>
{ "start" : "<%=sdf.format(new Date(operation.getCreatedTime()))%>",
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
index ed75a07..17683c7 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
@@ -58,7 +58,7 @@
%>
{ "start" : "<%=sdf.format(configUpdate.getCreatedTime())%>",
- "title" : "Plugin Configuration Change",
+ "title" : "Connection Settings Change",
"link" : "<%=link%>",
"description" : "<b>User:</b> <%=(""+configUpdate.getSubjectName()).replaceAll("[\"']","").trim()%><br/><b>Status:</b> <%=(""+configUpdate.getStatus()).replaceAll("[\"']","").trim()%>",
"icon" : "<%=icon%>",
12 years, 8 months
[rhq] 22 commits - .classpath modules/integration-tests modules/plugins
by snegrea
.classpath | 1
modules/integration-tests/mod_cluster-plugin-test/pom.xml | 396 ++++++
modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java | 229 +++
modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java | 210 ---
modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java | 13
modules/plugins/mod-cluster/pom.xml | 64 -
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java | 95 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java | 102 -
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java | 118 --
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java | 157 ++
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java | 92 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java | 70 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java | 48
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java | 52
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java | 45
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java | 310 -----
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java | 117 ++
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java | 105 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java | 84 +
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java | 50
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java | 226 +++
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java | 49
modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java | 310 +++++
modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml | 576 +++++++---
modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java | 2
modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java | 60 +
26 files changed, 2622 insertions(+), 959 deletions(-)
New commits:
commit 4a043396e8ef668b1daddc0f00cf7e1331552685
Merge: 0540bcd 1810577
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 13:54:43 2011 -0500
Merge branch 'mod_cluster_plugin'
commit 18105773312c888d884f71541f6ed778408aee6e
Merge: fbcf5fd 0b63dbe
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 13:42:57 2011 -0500
Merge branch 'mod_cluster_plugin' of ssh://git.fedorahosted.org/git/rhq/rhq into mod_cluster_plugin
commit fbcf5fd1fe8ef454578d00c2617bde54f353ecd7
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 00:14:01 2011 -0500
Small refactoring and code formating change to make the class easier to read and understand.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 6abf955..8cff302 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -75,6 +75,7 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
*/
public void setPropertyValue(String propertyName, String value) {
boolean propertyFound = false;
+
for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
Node currentNode = beanNode.getChildNodes().item(i);
@@ -107,8 +108,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
public String getPropertyValue(String propertyName) {
- for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
- Node currentNode = beanNode.getChildNodes().item(i);
+ NodeList nodeList = beanNode.getChildNodes();
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node currentNode = nodeList.item(i);
if (currentNode.getNodeName().equals("property")
&& currentNode.getAttributes().getNamedItem("name") != null
@@ -126,10 +129,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
private Node getBeanNodeByClass(String className) {
- NodeList result = this.getDocument().getElementsByTagName("bean");
+ NodeList nodeList = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
- for (int i = 1; i < result.getLength(); i++) {
- Node node = result.item(i);
if (node.getAttributes().getNamedItem("class") != null
&& className.equals(node.getAttributes().getNamedItem("class").getTextContent())) {
return node;
@@ -144,10 +148,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
private Node getBeanNodeByName(String beanName) {
- NodeList result = this.getDocument().getElementsByTagName("bean");
+ NodeList nodeList = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
- for (int i = 1; i < result.getLength(); i++) {
- Node node = result.item(i);
if (node.getAttributes().getNamedItem("name") != null
&& beanName.equals(node.getAttributes().getNamedItem("name").getTextContent())) {
return node;
@@ -163,17 +168,17 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
- List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
+ List<Node> nodeList = this.getChildrenNodesByName(beanNode, "constructor");
- if (tempNodeList.size() > 0) {
- Node constructorNode = tempNodeList.get(0);
+ if (nodeList.size() > 0) {
+ Node constructorNode = nodeList.get(0);
- tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
+ nodeList = this.getChildrenNodesByName(constructorNode, "parameter");
- if (tempNodeList.size() > 0) {
+ if (nodeList.size() > 0) {
Node parameterNode = null;
- for (Node currentNode : tempNodeList) {
+ for (Node currentNode : nodeList) {
if (currentNode.getAttributes().getNamedItem("class") != null
&& constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
.getTextContent())) {
@@ -183,10 +188,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
}
if (parameterNode != null) {
- tempNodeList = this.getChildNodesByName(parameterNode, "inject");
+ nodeList = this.getChildrenNodesByName(parameterNode, "inject");
- if (tempNodeList.size() > 0) {
- Node injectNode = tempNodeList.get(0);
+ if (nodeList.size() > 0) {
+ Node injectNode = nodeList.get(0);
Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
if (beanAttribute != null) {
@@ -205,17 +210,17 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @param nodeName
* @return
*/
- private List<Node> getChildNodesByName(Node node, String nodeName) {
- List<Node> listOfNodes = new ArrayList<Node>();
+ private List<Node> getChildrenNodesByName(Node node, String nodeName) {
+ List<Node> nodeList = new ArrayList<Node>();
for (int i = 0; i < node.getChildNodes().getLength(); i++) {
Node currentNode = node.getChildNodes().item(i);
if (nodeName.equals(currentNode.getNodeName())) {
- listOfNodes.add(currentNode);
+ nodeList.add(currentNode);
}
}
- return listOfNodes;
+ return nodeList;
}
}
commit 0967165a89cef5268c8dcf6834b71cdefbb31032
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 00:12:49 2011 -0500
Added the proxyInfo metric back to Catalina service context since it is readly available.
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 6f46849..3e523f7 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -374,6 +374,7 @@
</operation>
<metric property="proxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="proxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
<metric property="modelerType" displayName="Type of the modeled resource" displayType="summary" dataType="trait" />
<metric property="className" displayName="Fully qualified class name of the managed object" displayType="summary" dataType="trait" />
<metric property="advertise" displayName="Enable autodiscovery of httpd servers." displayType="summary" dataType="trait" />
commit 0a99815d01e6cf0d5554cc4c86bcac3b63d3bce6
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Aug 24 11:18:01 2011 -0500
More updates to the naming of each plugin component to match the intent and purpose. Also updated the integration tests to test each resource type.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java
new file mode 100644
index 0000000..625163b
--- /dev/null
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java
@@ -0,0 +1,229 @@
+/*
+ * 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.plugins.modcluster.test;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Queue;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import org.rhq.core.clientapi.server.discovery.InventoryReport;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.measurement.MeasurementData;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.core.pc.PluginContainerConfiguration;
+import org.rhq.core.pc.plugin.FileSystemPluginFinder;
+import org.rhq.core.pc.plugin.PluginEnvironment;
+import org.rhq.core.pc.plugin.PluginManager;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/**
+ * @author Stefan Negrea
+ */
+@SuppressWarnings("rawtypes")
+@Test(groups = "modcluster-plugin")
+public class ModClusterPluginIntegrationTest {
+ private Log log = LogFactory.getLog(this.getClass());
+ private static final String PLUGIN_NAME = "mod_cluster";
+
+ @BeforeSuite
+ public void start() {
+ try {
+ File pluginDir = new File("target/testsetup/plugins");
+ PluginContainerConfiguration pcConfig = new PluginContainerConfiguration();
+ pcConfig.setPluginFinder(new FileSystemPluginFinder(pluginDir));
+ pcConfig.setPluginDirectory(pluginDir);
+
+ pcConfig.setInsideAgent(false);
+ PluginContainer.getInstance().setConfiguration(pcConfig);
+ PluginContainer.getInstance().initialize();
+ log.info("PC started.");
+ for (String plugin : PluginContainer.getInstance().getPluginManager().getMetadataManager().getPluginNames()) {
+ log.info("...Loaded plugin: " + plugin);
+ }
+ } catch (Exception e) {
+ log.info("Error initializing the context", e);
+ }
+ }
+
+ @AfterSuite
+ public void stop() {
+ PluginContainer.getInstance().shutdown();
+ }
+
+ @Test
+ public void testPluginLoad() {
+ PluginManager pluginManager = PluginContainer.getInstance().getPluginManager();
+ PluginEnvironment pluginEnvironment = pluginManager.getPlugin(PLUGIN_NAME);
+ assert (pluginEnvironment != null) : "Null environment, plugin not loaded";
+ assert (pluginEnvironment.getPluginName().equals(PLUGIN_NAME));
+ }
+
+ @Test(dependsOnMethods = "testPluginLoad")
+ public void testDiscovery() throws Exception {
+ InventoryReport report = PluginContainer.getInstance().getInventoryManager().executeServerScanImmediately();
+ assert report != null;
+ log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
+
+ Thread.sleep(1000);
+
+ report = PluginContainer.getInstance().getInventoryManager().executeServiceScanImmediately();
+ assert report != null;
+ log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
+
+ Set<Resource> resources = findResource(PluginContainer.getInstance().getInventoryManager().getPlatform());
+ log.info("Found " + resources.size() + " mod_cluster and mod_cluster_context instance(s).");
+
+ assert (resources.size() != 0) : "No mod_cluster or related instances found.";
+
+ if (resources.size() != 0) {
+ for (Object objectResource : resources.toArray()) {
+ Resource resource = (Resource) objectResource;
+ if (resource.getResourceType().getName().equals("mod_cluster")) {
+ testMainResource(resource);
+ } else if (resource.getResourceType().getName().equals("Webapp Context")) {
+ testWebappContext(resource);
+ } else if (resource.getResourceType().getName().equals("HA Service Configuration")) {
+ testLoadServiceConfiguration(resource);
+ } else if (resource.getResourceType().getName().equals("HA Service")) {
+ testServiceMeasurement(resource);
+ testServiceMethodInvocation(resource);
+ }
+ }
+ }
+ }
+
+ private void testServiceMethodInvocation(Resource resource) throws InterruptedException, Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ Configuration config = new Configuration();
+ config.put(new PropertySimple("p1", "1"));
+ config.put(new PropertySimple("p2", java.util.concurrent.TimeUnit.SECONDS));
+ OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("stop", config);
+ log.info("Result of operation stopContext was: " + result.getSimpleResult());
+ }
+
+ private void testLoadServiceConfiguration(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+ ((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
+ }
+
+ private void testServiceMeasurement(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ if (resourceComponent instanceof MeasurementFacet) {
+ for (MeasurementDefinition def : resource.getResourceType().getMetricDefinitions()) {
+ Set<MeasurementScheduleRequest> metricList = new HashSet<MeasurementScheduleRequest>();
+ metricList.add(new MeasurementScheduleRequest(1, def.getName(), 1000, true, def.getDataType(), null));
+ MeasurementReport report = new MeasurementReport();
+ ((MeasurementFacet) resourceComponent).getValues(report, metricList);
+
+ MeasurementData data = report.getTraitData().iterator().next();
+ assert data != null : "Unable to collect trait [" + def.getName() + "] on " + resource;
+ log.info("Measurement: " + def.getName() + "=" + data.getValue());
+ }
+ }
+ }
+
+ private void testMainResource(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ if (resourceComponent instanceof OperationFacet) {
+ OperationResult result = null;
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("reset", new Configuration());
+ log.info("Result of operation test was: " + result);
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("refresh", new Configuration());
+ log.info("Result of operation test was: " + result);
+ }
+ }
+
+ private void testWebappContext(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ if (resourceComponent instanceof OperationFacet) {
+ try {
+ OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
+ log.info("Result of operation " + "enableContext" + " was: " + result.getSimpleResult());
+
+ Configuration config = new Configuration();
+ config.put(new PropertySimple("timeout", "1"));
+ config.put(new PropertySimple("unit", java.util.concurrent.TimeUnit.SECONDS));
+ result = ((OperationFacet) resourceComponent).invokeOperation("stopContext", config);
+ log.info("Result of operation stopContext was: " + result.getSimpleResult());
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
+ log.info("Result of operation enableContext was: " + result.getSimpleResult());
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("disableContext", null);
+ log.info("Result of operation disableContext was: " + result.getSimpleResult());
+
+ } catch (Exception e) {
+ log.info("Operation failed. ", e);
+ }
+
+ }
+ }
+
+ private Set<Resource> findResource(Resource parent) {
+ Set<Resource> found = new HashSet<Resource>();
+
+ Queue<Resource> discoveryQueue = new LinkedList<Resource>();
+ discoveryQueue.add(parent);
+
+ while (!discoveryQueue.isEmpty()) {
+ Resource currentResource = discoveryQueue.poll();
+
+ log.info("Discovered resource of type: " + currentResource.getResourceType().getName());
+ if (currentResource.getResourceType().getPlugin().equals(PLUGIN_NAME)) {
+ found.add(currentResource);
+ }
+
+ if (currentResource.getChildResources() != null) {
+ for (Resource child : currentResource.getChildResources()) {
+ discoveryQueue.add(child);
+ }
+ }
+ }
+
+ return found;
+ }
+}
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
deleted file mode 100644
index f27b153..0000000
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ /dev/null
@@ -1,228 +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.plugins.modcluster.test;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Queue;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.testng.annotations.AfterSuite;
-import org.testng.annotations.BeforeSuite;
-import org.testng.annotations.Test;
-
-import org.rhq.core.clientapi.server.discovery.InventoryReport;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.measurement.MeasurementData;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
-import org.rhq.core.domain.measurement.MeasurementReport;
-import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.pc.PluginContainer;
-import org.rhq.core.pc.PluginContainerConfiguration;
-import org.rhq.core.pc.plugin.FileSystemPluginFinder;
-import org.rhq.core.pc.plugin.PluginEnvironment;
-import org.rhq.core.pc.plugin.PluginManager;
-import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
-import org.rhq.core.pluginapi.inventory.ResourceComponent;
-import org.rhq.core.pluginapi.measurement.MeasurementFacet;
-import org.rhq.core.pluginapi.operation.OperationFacet;
-import org.rhq.core.pluginapi.operation.OperationResult;
-
-/**
- * @author Stefan Negrea
- */
-@SuppressWarnings("rawtypes")
-@Test(groups = "modcluster-plugin")
-public class ModclusterPluginTest {
- private Log log = LogFactory.getLog(this.getClass());
- private static final String PLUGIN_NAME = "mod_cluster";
-
- @BeforeSuite
- public void start() {
- try {
- File pluginDir = new File("target/testsetup/plugins");
- PluginContainerConfiguration pcConfig = new PluginContainerConfiguration();
- pcConfig.setPluginFinder(new FileSystemPluginFinder(pluginDir));
- pcConfig.setPluginDirectory(pluginDir);
-
- pcConfig.setInsideAgent(false);
- PluginContainer.getInstance().setConfiguration(pcConfig);
- PluginContainer.getInstance().initialize();
- log.info("PC started.");
- for (String plugin : PluginContainer.getInstance().getPluginManager().getMetadataManager().getPluginNames()) {
- log.info("...Loaded plugin: " + plugin);
- }
- } catch (Exception e) {
- log.info("Error initializing the context", e);
- }
- }
-
- @AfterSuite
- public void stop() {
- PluginContainer.getInstance().shutdown();
- }
-
- @Test
- public void testPluginLoad() {
- PluginManager pluginManager = PluginContainer.getInstance().getPluginManager();
- PluginEnvironment pluginEnvironment = pluginManager.getPlugin(PLUGIN_NAME);
- assert (pluginEnvironment != null) : "Null environment, plugin not loaded";
- assert (pluginEnvironment.getPluginName().equals(PLUGIN_NAME));
- }
-
- @Test(dependsOnMethods = "testPluginLoad")
- public void testDiscovery() throws Exception {
- InventoryReport report = PluginContainer.getInstance().getInventoryManager().executeServerScanImmediately();
- assert report != null;
- log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
-
- Thread.sleep(1000);
-
- report = PluginContainer.getInstance().getInventoryManager().executeServiceScanImmediately();
- assert report != null;
- log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
-
- List<String> typeNames = new ArrayList<String>() {
- private static final long serialVersionUID = 1L;
-
- {
- add(PLUGIN_NAME);
- add("Webapp Context");
- add("HA Service Configuration");
- add("HA Service");
- }
- };
-
- Set<Resource> resources = findResource(PluginContainer.getInstance().getInventoryManager().getPlatform(),
- typeNames);
- log.info("Found " + resources.size() + " mod_cluster and mod_cluster_context instance(s).");
-
- assert (resources.size() != 0) : "No mod_cluster or related instances found.";
-
- if (resources.size() != 0) {
- for (Object objectResource : resources.toArray()) {
- Resource resource = (Resource) objectResource;
- if (resource.getResourceType().getName().equals("mod_cluster")) {
- testResourceMeasurement(resource);
- } else if (resource.getResourceType().getName().equals("Webapp Context")) {
- testContextOperations(resource);
- } else if (resource.getResourceType().getName().equals("HA Service Configuration")) {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
- ((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
- } else if (resource.getResourceType().getName().equals("HA Service")) {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
-
- Configuration config = new Configuration();
- config.put(new PropertySimple("p1", "1"));
- config.put(new PropertySimple("p2", java.util.concurrent.TimeUnit.SECONDS));
- OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("stop", config);
- log.info("Result of operation stopContext was: " + result.getSimpleResult());
- }
- }
- }
- }
-
- private void testResourceMeasurement(Resource resource) throws Exception {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
- if (resourceComponent instanceof MeasurementFacet) {
- for (MeasurementDefinition def : resource.getResourceType().getMetricDefinitions()) {
- Set<MeasurementScheduleRequest> metricList = new HashSet<MeasurementScheduleRequest>();
- metricList.add(new MeasurementScheduleRequest(1, def.getName(), 1000, true, def.getDataType(), null));
- MeasurementReport report = new MeasurementReport();
- ((MeasurementFacet) resourceComponent).getValues(report, metricList);
-
- MeasurementData data = report.getTraitData().iterator().next();
- assert data != null : "Unable to collect trait [" + def.getName() + "] on " + resource;
- log.info("Measurement: " + def.getName() + "=" + data.getValue());
- }
- }
-
- if (resourceComponent instanceof OperationFacet) {
- OperationResult result = null;
-
- result = ((OperationFacet) resourceComponent).invokeOperation("reset", new Configuration());
- log.info("Result of operation test was: " + result);
-
- result = ((OperationFacet) resourceComponent).invokeOperation("disable", new Configuration());
- log.info("Result of operation test was: " + result.getSimpleResult());
- }
- }
-
- private void testContextOperations(Resource resource) throws Exception {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
-
- if (resourceComponent instanceof OperationFacet) {
- try {
- OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
- log.info("Result of operation " + "enableContext" + " was: " + result.getSimpleResult());
-
- Configuration config = new Configuration();
- config.put(new PropertySimple("timeout", "1"));
- config.put(new PropertySimple("unit", java.util.concurrent.TimeUnit.SECONDS));
- result = ((OperationFacet) resourceComponent).invokeOperation("stopContext", config);
- log.info("Result of operation stopContext was: " + result.getSimpleResult());
-
- result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
- log.info("Result of operation enableContext was: " + result.getSimpleResult());
-
- result = ((OperationFacet) resourceComponent).invokeOperation("disableContext", null);
- log.info("Result of operation disableContext was: " + result.getSimpleResult());
-
- } catch (Exception e) {
- log.info("Operation failed. ", e);
- }
-
- }
- }
-
- private Set<Resource> findResource(Resource parent, List<String> typeNames) {
- Set<Resource> found = new HashSet<Resource>();
-
- Queue<Resource> discoveryQueue = new LinkedList<Resource>();
- discoveryQueue.add(parent);
-
- while (!discoveryQueue.isEmpty()) {
- Resource currentResource = discoveryQueue.poll();
-
- log.info("Discovered resource of type: " + currentResource.getResourceType().getName());
- if (typeNames.contains(currentResource.getResourceType().getName())) {
- found.add(currentResource);
- }
-
- if (currentResource.getChildResources() != null) {
- for (Resource child : currentResource.getChildResources()) {
- discoveryQueue.add(child);
- }
- }
- }
-
- return found;
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
index b9ce25e..b854398 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
@@ -89,7 +89,7 @@ public class ClassNameMBeanDiscoveryComponent<T extends JMXComponent> extends MB
emsConnection.queryBeans(objectName);
bean = emsConnection.getBean(objectName);
}
+
return bean;
}
-
-}
\ No newline at end of file
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
deleted file mode 100644
index 4c8b437..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ /dev/null
@@ -1,116 +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.plugins.modcluster;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.mc4j.ems.connection.bean.EmsBean;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.pluginapi.operation.OperationResult;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-import org.rhq.plugins.modcluster.helper.JBossHelper;
-
-/**
- * Manages a mod_cluster context entity.
- *
- * @author Stefan Negrea
- */
-@SuppressWarnings({ "rawtypes", "deprecation" })
-public class ContextComponent extends MBeanResourceComponent<MBeanResourceComponent> {
-
- private static final Log log = LogFactory.getLog(ContextComponent.class);
-
- @Override
- protected EmsBean loadBean() {
- return getResourceContext().getParentResourceComponent().getEmsBean();
- }
-
- @Override
- public AvailabilityType getAvailability() {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
- String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
-
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
-
- ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
-
- int indexOfCurrentContext = proxyInfo.getAvailableContexts().indexOf(context);
-
- if (indexOfCurrentContext != -1) {
- ProxyInfo.Context currentContext = proxyInfo.getAvailableContexts().get(indexOfCurrentContext);
-
- if (currentContext.isEnabled()) {
- return AvailabilityType.UP;
- }
- }
-
- return AvailabilityType.DOWN;
- } catch (Exception e) {
- log.info(e);
- return AvailabilityType.DOWN;
- } finally {
- Thread.currentThread().setContextClassLoader(cl);
- }
- }
-
- @Override
- public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
- if ("enableContext".equals(name) || "disableContext".equals(name) || "stopContext".equals(name)) {
-
- ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
-
- Object[] configuration = null;
- if ("stopContext".equals(name)) {
- configuration = new Object[] { context.getHost(), context.getPath(),
- parameters.getSimple("timeout").getLongValue(),
- TimeUnit.valueOf(parameters.getSimple("unit").getStringValue()) };
- } else {
- configuration = new Object[] { context.getHost(), context.getPath() };
- }
-
- if (context.getPath().equals("/")) {
- configuration[1] = "ROOT";
- }
-
- log.info(name + " - " + context.getHost() + " " + context.getPath());
-
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
- Object resultObject = getEmsBean().getOperation(name).invoke(configuration);
-
- if (resultObject instanceof OperationResult) {
- return (OperationResult) resultObject;
- } else {
- return new OperationResult(String.valueOf(resultObject));
- }
- } finally {
- Thread.currentThread().setContextClassLoader(cl);
- }
- }
-
- throw new Exception("Operation " + name + " not available mod_cluster WebApp service.");
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
deleted file mode 100644
index 788cbce..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
+++ /dev/null
@@ -1,104 +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.plugins.modcluster;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.mc4j.ems.connection.EmsConnection;
-import org.mc4j.ems.connection.bean.EmsBean;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-import org.rhq.plugins.modcluster.helper.JBossHelper;
-
-/**
- * Discovers mod_cluster contexts from the proxyInfo mbean property.
- *
- * @author Stefan Negrea
- */
-@SuppressWarnings("rawtypes")
-public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBeanResourceComponent> {
-
- private static final String JVM_ROUTE_PROPERTY = "jvmRoute";
- private static final String ENGINE_OBJECT_NAME = "engineObjectName";
-
- /* (non-Javadoc)
- * @see org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext)
- */
- public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent> context) {
- String jvmRoute = this.getJvmRoute(context);
-
- EmsBean configBean = context.getParentResourceComponent().getEmsBean();
- String rawProxyInfo = JBossHelper.getRawProxyInfo(configBean);
-
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
- Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();
-
- for (ProxyInfo.Context availableContext : proxyInfo.getAvailableContexts()) {
- if (availableContext.getJvmRoute().equals(jvmRoute)) {
- DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(),
- availableContext.createKey(), availableContext.createName(), null, "Webapp Context", null, null);
- entities.add(detail);
- }
- }
-
- return entities;
- }
-
- /**
- * Retrieves the jvm route for the node from the parent context.
- *
- * @param context the discovery context
- * @return node's jvm route
- */
- private String getJvmRoute(ResourceDiscoveryContext<MBeanResourceComponent> context) {
- Configuration pluginConfig = context.getParentResourceComponent().getResourceContext().getPluginConfiguration();
- String engineObjectName = pluginConfig.getSimple(ENGINE_OBJECT_NAME).getStringValue();
- EmsBean engineBean = this.loadBean(engineObjectName, context.getParentResourceComponent());
-
- return (String) engineBean.getAttribute(JVM_ROUTE_PROPERTY).refresh().toString();
- }
-
- /**
- * Loads the bean with the given object name.
- *
- * Subclasses are free to override this method in order to load the bean.
- *
- * @param objectName the name of the bean to load
- * @return the bean that is loaded
- */
- protected EmsBean loadBean(String objectName, MBeanResourceComponent context) {
- EmsConnection emsConnection = context.getEmsConnection();
- EmsBean bean = emsConnection.getBean(objectName);
- if (bean == null) {
- // In some cases, this resource component may have been discovered by some means other than querying its
- // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
- // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
- // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
- // bean before giving up.
- emsConnection.queryBeans(objectName);
- bean = emsConnection.getBean(objectName);
- }
- return bean;
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
index 7d5f0dc..0db722e 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
@@ -21,6 +21,7 @@ package org.rhq.plugins.modcluster;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.helper.JBossHelper;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
/**
* @author Stefan Negrea
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java
deleted file mode 100644
index 8614402..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java
+++ /dev/null
@@ -1,310 +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.plugins.modcluster;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Simple parser for the raw proxy information provided by mod_cluster.
- *
- * @author Stefan Negrea
- */
-public class ProxyInfo {
-
- private Map<String, Node> availableNodes = new HashMap<String, Node>();
- private Map<String, Vhost> availableVhosts = new HashMap<String, Vhost>();
- private List<Context> availableContexts = new ArrayList<ProxyInfo.Context>();
-
- public ProxyInfo(String rawProxyInfo) {
- parseNodes(rawProxyInfo);
- parseVhosts(rawProxyInfo);
- parseContexts(rawProxyInfo);
- }
-
- private void parseNodes(String rawProxyInfo) {
- Pattern nodePattern = Pattern.compile("Node:.*\n");
- Matcher nodeMatcher = nodePattern.matcher(rawProxyInfo);
- while (nodeMatcher.find()) {
- String rawNode = nodeMatcher.group();
- String[] nodePieces = rawNode.split(",");
-
- String identifier = nodePieces[0];
- identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
-
- String jvmRoute = nodePieces[1];
- jvmRoute = jvmRoute.substring(jvmRoute.indexOf(':') + 1).trim();
-
- availableNodes.put(identifier, new Node(jvmRoute, identifier));
- }
- }
-
- private void parseVhosts(String rawProxyInfo) {
- Pattern vhostPattern = Pattern.compile("Vhost:.*\n");
- Matcher vhostMatcher = vhostPattern.matcher(rawProxyInfo);
- while (vhostMatcher.find()) {
- String rawVhost = vhostMatcher.group();
- String[] vhostPieces = rawVhost.split(",");
-
- String identifier = vhostPieces[0].trim();
- identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
- identifier = identifier.substring(0, identifier.lastIndexOf(":"));
-
- String host = vhostPieces[1].trim();
- host = host.substring(host.indexOf(":") + 1).trim();
-
- availableVhosts.put(identifier, new Vhost(identifier, host));
- }
- }
-
- private void parseContexts(String rawProxyInfo) {
- Pattern contextPattern = Pattern.compile("Context:.*[\n|}]");
- Matcher contextMatcher = contextPattern.matcher(rawProxyInfo);
- while (contextMatcher.find()) {
- String rawContext = contextMatcher.group();
- String[] contextPieces = rawContext.split(",");
- String actualContext = contextPieces[1].substring(contextPieces[1].indexOf("/")).trim();
-
- String identifier = contextPieces[0];
- identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
- identifier = identifier.substring(0, identifier.lastIndexOf(":"));
-
- String nodeIdentifier = contextPieces[0];
- nodeIdentifier = nodeIdentifier.substring(nodeIdentifier.indexOf("[") + 1, nodeIdentifier.indexOf("]"));
- nodeIdentifier = nodeIdentifier.substring(0, nodeIdentifier.indexOf(":"));
- String jvmRoute = availableNodes.get(nodeIdentifier).getJvmRoute();
-
- String rawIsEnabled = contextPieces[2];
- rawIsEnabled = rawIsEnabled.substring(rawIsEnabled.indexOf(':') + 1).trim();
- boolean isEnabled = rawIsEnabled.equals("ENABLED") ? true : false;
-
- Vhost relatedVhost = availableVhosts.get(identifier);
-
- availableContexts.add(new Context(jvmRoute, relatedVhost.getHost(), actualContext, isEnabled));
- }
- }
-
- public List<Context> getAvailableContexts() {
- return Collections.unmodifiableList(availableContexts);
- }
-
- public List<Vhost> getAvailableVhosts() {
- return Collections.unmodifiableList(new ArrayList<Vhost>(availableVhosts.values()));
- }
-
- public List<Node> getAvailableNodes() {
- return Collections.unmodifiableList(new ArrayList<Node>(availableNodes.values()));
- }
-
- public static class Node {
- private String jvmRoute;
- private String nodeId;
-
- public Node(String jvmRoute, String nodeId) {
- this.jvmRoute = jvmRoute;
- this.nodeId = nodeId;
- }
-
- public String getNodeId() {
- return nodeId;
- }
-
- public String getJvmRoute() {
- return jvmRoute;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
- result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Node other = (Node) obj;
- if (jvmRoute == null) {
- if (other.jvmRoute != null)
- return false;
- } else if (!jvmRoute.equals(other.jvmRoute))
- return false;
- if (nodeId == null) {
- if (other.nodeId != null)
- return false;
- } else if (!nodeId.equals(other.nodeId))
- return false;
- return true;
- }
- }
-
- public static class Vhost {
- private String identifier;
- private String host;
-
- public Vhost(String identifier, String host) {
- this.identifier = identifier;
- this.host = host;
- }
-
- public String getIdentifier() {
- return identifier;
- }
-
- public String getHost() {
- return host;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((host == null) ? 0 : host.hashCode());
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Vhost other = (Vhost) obj;
- if (host == null) {
- if (other.host != null)
- return false;
- } else if (!host.equals(other.host))
- return false;
- if (identifier == null) {
- if (other.identifier != null)
- return false;
- } else if (!identifier.equals(other.identifier))
- return false;
- return true;
- }
- }
-
- public static class Context {
- private String path;
- private String host;
- private String jvmRoute;
- private boolean isEnabled;
-
- public Context(String jvmRoute, String host, String path) {
- this(jvmRoute, host, path, false);
- }
-
- public Context(String jvmRoute, String host, String path, boolean isEnabled) {
- this.jvmRoute = jvmRoute;
- this.host = host;
- this.path = path;
- this.isEnabled = isEnabled;
- }
-
- public String getPath() {
- return path;
- }
-
- public String getHost() {
- return host;
- }
-
- public String getJvmRoute() {
- return jvmRoute;
- }
-
- public boolean isEnabled() {
- return isEnabled;
- }
-
- public String createKey() {
- return jvmRoute + ":" + host + ":" + path;
- }
-
- public String createName() {
- return host + ":" + path;
- }
-
- @Override
- public String toString() {
- return createKey();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((host == null) ? 0 : host.hashCode());
- result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
- result = prime * result + ((path == null) ? 0 : path.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Context other = (Context) obj;
- if (host == null) {
- if (other.host != null)
- return false;
- } else if (!host.equals(other.host))
- return false;
- if (jvmRoute == null) {
- if (other.jvmRoute != null)
- return false;
- } else if (!jvmRoute.equals(other.jvmRoute))
- return false;
- if (path == null) {
- if (other.path != null)
- return false;
- } else if (!path.equals(other.path))
- return false;
- return true;
- }
-
- public static Context fromString(String stringRepresentation) throws Exception {
- String parts[] = stringRepresentation.trim().split(":");
- if (parts.length < 3) {
- throw new Exception("Parsing error. Not enough information to create a context.");
- }
-
- return new Context(parts[0], parts[1], parts[2]);
- }
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java
new file mode 100644
index 0000000..6131578
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java
@@ -0,0 +1,117 @@
+/*
+ * 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.plugins.modcluster;
+
+import java.util.concurrent.TimeUnit;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.operation.OperationResult;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
+
+/**
+ * Manages a mod_cluster context entity.
+ *
+ * @author Stefan Negrea
+ */
+@SuppressWarnings({ "rawtypes", "deprecation" })
+public class WebappContextComponent extends MBeanResourceComponent<MBeanResourceComponent> {
+
+ private static final Log log = LogFactory.getLog(WebappContextComponent.class);
+
+ @Override
+ protected EmsBean loadBean() {
+ return getResourceContext().getParentResourceComponent().getEmsBean();
+ }
+
+ @Override
+ public AvailabilityType getAvailability() {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
+
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+
+ ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
+
+ int indexOfCurrentContext = proxyInfo.getAvailableContexts().indexOf(context);
+
+ if (indexOfCurrentContext != -1) {
+ ProxyInfo.Context currentContext = proxyInfo.getAvailableContexts().get(indexOfCurrentContext);
+
+ if (currentContext.isEnabled()) {
+ return AvailabilityType.UP;
+ }
+ }
+
+ return AvailabilityType.DOWN;
+ } catch (Exception e) {
+ log.info(e);
+ return AvailabilityType.DOWN;
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+
+ @Override
+ public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
+ if ("enableContext".equals(name) || "disableContext".equals(name) || "stopContext".equals(name)) {
+
+ ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
+
+ Object[] configuration = null;
+ if ("stopContext".equals(name)) {
+ configuration = new Object[] { context.getHost(), context.getPath(),
+ parameters.getSimple("timeout").getLongValue(),
+ TimeUnit.valueOf(parameters.getSimple("unit").getStringValue()) };
+ } else {
+ configuration = new Object[] { context.getHost(), context.getPath() };
+ }
+
+ if (context.getPath().equals("/")) {
+ configuration[1] = "ROOT";
+ }
+
+ log.info(name + " - " + context.getHost() + " " + context.getPath());
+
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
+ Object resultObject = getEmsBean().getOperation(name).invoke(configuration);
+
+ if (resultObject instanceof OperationResult) {
+ return (OperationResult) resultObject;
+ } else {
+ return new OperationResult(String.valueOf(resultObject));
+ }
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+
+ throw new Exception("Operation " + name + " not available mod_cluster WebApp service.");
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java
new file mode 100644
index 0000000..559e1b6
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java
@@ -0,0 +1,105 @@
+/*
+ * 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.plugins.modcluster;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.mc4j.ems.connection.EmsConnection;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
+
+/**
+ * Discovers mod_cluster contexts from the proxyInfo mbean property.
+ *
+ * @author Stefan Negrea
+ */
+@SuppressWarnings("rawtypes")
+public class WebappContextDiscoveryComponent implements ResourceDiscoveryComponent<MBeanResourceComponent> {
+
+ private static final String JVM_ROUTE_PROPERTY = "jvmRoute";
+ private static final String ENGINE_OBJECT_NAME = "engineObjectName";
+
+ /* (non-Javadoc)
+ * @see org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext)
+ */
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent> context) {
+ String jvmRoute = this.getJvmRoute(context);
+
+ EmsBean configBean = context.getParentResourceComponent().getEmsBean();
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(configBean);
+
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();
+
+ for (ProxyInfo.Context availableContext : proxyInfo.getAvailableContexts()) {
+ if (availableContext.getJvmRoute().equals(jvmRoute)) {
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(),
+ availableContext.createKey(), availableContext.createName(), null, "Webapp Context", null, null);
+ entities.add(detail);
+ }
+ }
+
+ return entities;
+ }
+
+ /**
+ * Retrieves the jvm route for the node from the parent context.
+ *
+ * @param context the discovery context
+ * @return node's jvm route
+ */
+ private String getJvmRoute(ResourceDiscoveryContext<MBeanResourceComponent> context) {
+ Configuration pluginConfig = context.getParentResourceComponent().getResourceContext().getPluginConfiguration();
+ String engineObjectName = pluginConfig.getSimple(ENGINE_OBJECT_NAME).getStringValue();
+ EmsBean engineBean = this.loadBean(engineObjectName, context.getParentResourceComponent());
+
+ return (String) engineBean.getAttribute(JVM_ROUTE_PROPERTY).refresh().toString();
+ }
+
+ /**
+ * Loads the bean with the given object name.
+ *
+ * Subclasses are free to override this method in order to load the bean.
+ *
+ * @param objectName the name of the bean to load
+ * @return the bean that is loaded
+ */
+ protected EmsBean loadBean(String objectName, MBeanResourceComponent context) {
+ EmsConnection emsConnection = context.getEmsConnection();
+ EmsBean bean = emsConnection.getBean(objectName);
+ if (bean == null) {
+ // In some cases, this resource component may have been discovered by some means other than querying its
+ // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
+ // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
+ // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
+ // bean before giving up.
+ emsConnection.queryBeans(objectName);
+ bean = emsConnection.getBean(objectName);
+ }
+ return bean;
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java
new file mode 100644
index 0000000..9cedad5
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java
@@ -0,0 +1,310 @@
+/*
+ * 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.plugins.modcluster.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Simple parser for the raw proxy information provided by mod_cluster.
+ *
+ * @author Stefan Negrea
+ */
+public class ProxyInfo {
+
+ private Map<String, Node> availableNodes = new HashMap<String, Node>();
+ private Map<String, Vhost> availableVhosts = new HashMap<String, Vhost>();
+ private List<Context> availableContexts = new ArrayList<ProxyInfo.Context>();
+
+ public ProxyInfo(String rawProxyInfo) {
+ parseNodes(rawProxyInfo);
+ parseVhosts(rawProxyInfo);
+ parseContexts(rawProxyInfo);
+ }
+
+ private void parseNodes(String rawProxyInfo) {
+ Pattern nodePattern = Pattern.compile("Node:.*\n");
+ Matcher nodeMatcher = nodePattern.matcher(rawProxyInfo);
+ while (nodeMatcher.find()) {
+ String rawNode = nodeMatcher.group();
+ String[] nodePieces = rawNode.split(",");
+
+ String identifier = nodePieces[0];
+ identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
+
+ String jvmRoute = nodePieces[1];
+ jvmRoute = jvmRoute.substring(jvmRoute.indexOf(':') + 1).trim();
+
+ availableNodes.put(identifier, new Node(jvmRoute, identifier));
+ }
+ }
+
+ private void parseVhosts(String rawProxyInfo) {
+ Pattern vhostPattern = Pattern.compile("Vhost:.*\n");
+ Matcher vhostMatcher = vhostPattern.matcher(rawProxyInfo);
+ while (vhostMatcher.find()) {
+ String rawVhost = vhostMatcher.group();
+ String[] vhostPieces = rawVhost.split(",");
+
+ String identifier = vhostPieces[0].trim();
+ identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
+ identifier = identifier.substring(0, identifier.lastIndexOf(":"));
+
+ String host = vhostPieces[1].trim();
+ host = host.substring(host.indexOf(":") + 1).trim();
+
+ availableVhosts.put(identifier, new Vhost(identifier, host));
+ }
+ }
+
+ private void parseContexts(String rawProxyInfo) {
+ Pattern contextPattern = Pattern.compile("Context:.*[\n|}]");
+ Matcher contextMatcher = contextPattern.matcher(rawProxyInfo);
+ while (contextMatcher.find()) {
+ String rawContext = contextMatcher.group();
+ String[] contextPieces = rawContext.split(",");
+ String actualContext = contextPieces[1].substring(contextPieces[1].indexOf("/")).trim();
+
+ String identifier = contextPieces[0];
+ identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
+ identifier = identifier.substring(0, identifier.lastIndexOf(":"));
+
+ String nodeIdentifier = contextPieces[0];
+ nodeIdentifier = nodeIdentifier.substring(nodeIdentifier.indexOf("[") + 1, nodeIdentifier.indexOf("]"));
+ nodeIdentifier = nodeIdentifier.substring(0, nodeIdentifier.indexOf(":"));
+ String jvmRoute = availableNodes.get(nodeIdentifier).getJvmRoute();
+
+ String rawIsEnabled = contextPieces[2];
+ rawIsEnabled = rawIsEnabled.substring(rawIsEnabled.indexOf(':') + 1).trim();
+ boolean isEnabled = rawIsEnabled.equals("ENABLED") ? true : false;
+
+ Vhost relatedVhost = availableVhosts.get(identifier);
+
+ availableContexts.add(new Context(jvmRoute, relatedVhost.getHost(), actualContext, isEnabled));
+ }
+ }
+
+ public List<Context> getAvailableContexts() {
+ return Collections.unmodifiableList(availableContexts);
+ }
+
+ public List<Vhost> getAvailableVhosts() {
+ return Collections.unmodifiableList(new ArrayList<Vhost>(availableVhosts.values()));
+ }
+
+ public List<Node> getAvailableNodes() {
+ return Collections.unmodifiableList(new ArrayList<Node>(availableNodes.values()));
+ }
+
+ public static class Node {
+ private String jvmRoute;
+ private String nodeId;
+
+ public Node(String jvmRoute, String nodeId) {
+ this.jvmRoute = jvmRoute;
+ this.nodeId = nodeId;
+ }
+
+ public String getNodeId() {
+ return nodeId;
+ }
+
+ public String getJvmRoute() {
+ return jvmRoute;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
+ result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Node other = (Node) obj;
+ if (jvmRoute == null) {
+ if (other.jvmRoute != null)
+ return false;
+ } else if (!jvmRoute.equals(other.jvmRoute))
+ return false;
+ if (nodeId == null) {
+ if (other.nodeId != null)
+ return false;
+ } else if (!nodeId.equals(other.nodeId))
+ return false;
+ return true;
+ }
+ }
+
+ public static class Vhost {
+ private String identifier;
+ private String host;
+
+ public Vhost(String identifier, String host) {
+ this.identifier = identifier;
+ this.host = host;
+ }
+
+ public String getIdentifier() {
+ return identifier;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((host == null) ? 0 : host.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Vhost other = (Vhost) obj;
+ if (host == null) {
+ if (other.host != null)
+ return false;
+ } else if (!host.equals(other.host))
+ return false;
+ if (identifier == null) {
+ if (other.identifier != null)
+ return false;
+ } else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+ }
+
+ public static class Context {
+ private String path;
+ private String host;
+ private String jvmRoute;
+ private boolean isEnabled;
+
+ public Context(String jvmRoute, String host, String path) {
+ this(jvmRoute, host, path, false);
+ }
+
+ public Context(String jvmRoute, String host, String path, boolean isEnabled) {
+ this.jvmRoute = jvmRoute;
+ this.host = host;
+ this.path = path;
+ this.isEnabled = isEnabled;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ public String getJvmRoute() {
+ return jvmRoute;
+ }
+
+ public boolean isEnabled() {
+ return isEnabled;
+ }
+
+ public String createKey() {
+ return jvmRoute + ":" + host + ":" + path;
+ }
+
+ public String createName() {
+ return host + ":" + path;
+ }
+
+ @Override
+ public String toString() {
+ return createKey();
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((host == null) ? 0 : host.hashCode());
+ result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Context other = (Context) obj;
+ if (host == null) {
+ if (other.host != null)
+ return false;
+ } else if (!host.equals(other.host))
+ return false;
+ if (jvmRoute == null) {
+ if (other.jvmRoute != null)
+ return false;
+ } else if (!jvmRoute.equals(other.jvmRoute))
+ return false;
+ if (path == null) {
+ if (other.path != null)
+ return false;
+ } else if (!path.equals(other.path))
+ return false;
+ return true;
+ }
+
+ public static Context fromString(String stringRepresentation) throws Exception {
+ String parts[] = stringRepresentation.trim().split(":");
+ if (parts.length < 3) {
+ throw new Exception("Parsing error. Not enough information to create a context.");
+ }
+
+ return new Context(parts[0], parts[1], parts[2]);
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 7e1a79f..6f46849 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -440,7 +440,7 @@
</resource-configuration>
</service>
- <service name="Webapp Context" discovery="ContextDiscoveryComponent" class="ContextComponent" description="Webapp Context">
+ <service name="Webapp Context" discovery="WebappContextDiscoveryComponent" class="WebappContextComponent" description="Webapp Context">
<operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
<results>
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java
index 625d8d4..ebadd86 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java
@@ -23,7 +23,7 @@ import java.io.InputStream;
import org.testng.annotations.Test;
-import org.rhq.plugins.modcluster.ProxyInfo;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
/**
* @author Stefan Negrea
commit bf99abb7942ffafbd7aad728698105f8f0fc3a63
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 23 16:12:11 2011 -0500
Renaming mod_cluster components to match their explicit purpose.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index 0a0a570..b87bfcd 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -30,14 +30,16 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
/**
* @author Stefan Negrea
*
*/
-@SuppressWarnings({ "deprecation" })
-public class FileConfiguredMBeanResourceComponent extends TimeUnitParamResourceComponent {
+@SuppressWarnings({ "deprecation", "rawtypes" })
+public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent<JMXComponent> {
private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java
new file mode 100644
index 0000000..d9da81c
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java
@@ -0,0 +1,52 @@
+package org.rhq.plugins.modcluster;
+
+import java.util.concurrent.TimeUnit;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.
+ */
+
+/**
+ *
+ * @author Stefan Negrea
+ */
+public class ModClusterServiceComponent extends FileConfiguredMBeanResourceComponent {
+
+ @Override
+ public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
+ if (name.toLowerCase().startsWith("ping")) {
+ name = "ping";
+ }
+
+ return super.invokeOperation(name, parameters);
+ }
+
+ @Override
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ System.out.println(typeName);
+ if (typeName.equals(TimeUnit.class.getName())) {
+ return TimeUnit.valueOf(propSimple.getStringValue());
+ }
+
+ return super.getPropertyValueAsType(propSimple, typeName);
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
deleted file mode 100644
index c67bf61..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.rhq.plugins.modcluster;
-
-import java.util.concurrent.TimeUnit;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.pluginapi.operation.OperationResult;
-
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2009 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.
- */
-
-/**
- *
- * @author Stefan Negrea
- */
-public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceComponent {
-
- @Override
- public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
- if (name.toLowerCase().startsWith("ping")) {
- name = "ping";
- }
-
- return super.invokeOperation(name, parameters);
- }
-
- @Override
- protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
- System.out.println(typeName);
- if (typeName.equals(TimeUnit.class.getName())) {
- return TimeUnit.valueOf(propSimple.getStringValue());
- }
-
- return super.getPropertyValueAsType(propSimple, typeName);
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
deleted file mode 100644
index 0296eaf..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2009 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.plugins.modcluster;
-
-import java.util.concurrent.TimeUnit;
-
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-
-/**
- * @author Stefan Negrea
- *
- */
-@SuppressWarnings("rawtypes")
-public class TimeUnitParamResourceComponent extends MBeanResourceComponent {
-
- @Override
- protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
- System.out.println(typeName);
- if (typeName.equals(TimeUnit.class.getName())) {
- return TimeUnit.valueOf(propSimple.getStringValue());
- }
-
- return super.getPropertyValueAsType(propSimple, typeName);
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index ed82f7c..7e1a79f 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -27,7 +27,7 @@
<!-- Start - Configuration for HAModClusterService -->
<service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent"
- class="PolyPingMBeanResourceComponent"
+ class="ModClusterServiceComponent"
supportsManualAdd="true"
description="HA Service Listener" singleton="true">
@@ -199,7 +199,7 @@
<!-- End - Configuration for HAModClusterService -->
<!-- Start - Configuration for ModClusterService -->
- <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+ <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="ModClusterServiceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
commit 0218f0b41bfb7e1ae6e6ddb12565c396c7ef813d
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 23 15:39:58 2011 -0500
Updates to support integration with JBoss' mod_cluster module for AS6 and EAP5.1.x
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index b642573..f27b153 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -112,6 +112,7 @@ public class ModclusterPluginTest {
add(PLUGIN_NAME);
add("Webapp Context");
add("HA Service Configuration");
+ add("HA Service");
}
};
@@ -132,6 +133,15 @@ public class ModclusterPluginTest {
ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
.getResourceComponent(resource);
((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
+ } else if (resource.getResourceType().getName().equals("HA Service")) {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ Configuration config = new Configuration();
+ config.put(new PropertySimple("p1", "1"));
+ config.put(new PropertySimple("p2", java.util.concurrent.TimeUnit.SECONDS));
+ OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("stop", config);
+ log.info("Result of operation stopContext was: " + result.getSimpleResult());
}
}
}
diff --git a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
index 6a60a93..8da6a2d 100644
--- a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
+++ b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
@@ -561,15 +561,15 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme
paramIndex = Integer.valueOf(propName.substring(propName.indexOf('[') + 1, propName.indexOf(']')));
if (paramIndex < 0 || paramIndex >= emsParams.size()) {
throw new IllegalStateException("Index [" + paramIndex + "] specified for parameter of operation ["
- + name + "] on MBean [" + emsBean.getBeanName() + "] is invalid. The MBean operation takes "
- + emsParams.size() + " parameters.");
+ + name + "] on MBean [" + emsBean.getBeanName() + "] is invalid. The MBean operation takes "
+ + emsParams.size() + " parameters.");
}
} else {
paramIndex = emsParamIndexesByName.get(propName);
if (paramIndex == null) {
throw new IllegalStateException("Name [" + propName + "] specified for parameter of operation ["
- + name + "] on MBean [" + emsBean.getBeanName()
- + "] is invalid. The MBean operation does not take a parameter by that name.");
+ + name + "] on MBean [" + emsBean.getBeanName()
+ + "] is invalid. The MBean operation does not take a parameter by that name.");
}
}
EmsParameter emsParam = emsParams.get(paramIndex);
@@ -611,7 +611,7 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme
return resultToReturn;
}
- private Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
Object value;
if (typeName.equals(String.class.getName())) {
value = (propSimple == null) ? null : propSimple.getStringValue();
@@ -626,7 +626,8 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme
} else if (typeName.equals(Double.class.getName()) || typeName.equals(double.class.getName())) {
value = (propSimple == null) ? null : propSimple.getDoubleValue();
} else {
- throw new IllegalStateException("Operation parameter maps to MBean parameter with an unsupported type (" + typeName + ").");
+ throw new IllegalStateException("Operation parameter maps to MBean parameter with an unsupported type ("
+ + typeName + ").");
}
// TODO GH: Handle rest of types. (I think i have a mapper for this in mc4j
return value;
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 35c5b28..3a6deaa 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -31,6 +31,11 @@
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.on</groupId>
+ <artifactId>jopr-jboss-as-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>log4j</groupId>
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
index c5343d0..4c8b437 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
@@ -90,6 +90,10 @@ public class ContextComponent extends MBeanResourceComponent<MBeanResourceCompon
configuration = new Object[] { context.getHost(), context.getPath() };
}
+ if (context.getPath().equals("/")) {
+ configuration[1] = "ROOT";
+ }
+
log.info(name + " - " + context.getHost() + " " + context.getPath());
ClassLoader cl = Thread.currentThread().getContextClassLoader();
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index ee0369c..0a0a570 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -30,21 +30,20 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.util.exception.ThrowableUtil;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
/**
* @author Stefan Negrea
*
*/
-@SuppressWarnings({ "rawtypes", "deprecation" })
-public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent {
+@SuppressWarnings({ "deprecation" })
+public class FileConfiguredMBeanResourceComponent extends TimeUnitParamResourceComponent {
private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
private static final String BEAN_CLASS_NAME_PROPERTY = "className";
private static final String DEPENDENCY_BEAN_CLASS_NAME_PROPERTY = "dependencyClassName";
- private static final String SERVER_HOME_DIR = "jboss.server.home.dir";
+ private static final String SERVER_HOME_DIR = "serverHomeDir";
private static final String CONFIGURATION_FILE_RELATIVE_PATH = "/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml";
/**
@@ -105,7 +104,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
}
private String getServerHomeDirectory() {
- ModclusterServerComponent modClusterComponent = (ModclusterServerComponent) this.resourceContext
+ ModClusterServerComponent modClusterComponent = (ModClusterServerComponent) this.resourceContext
.getParentResourceComponent();
PropertySimple property = modClusterComponent.getResourceContext().getPluginConfiguration()
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
index 496068c..3eb7cbe 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -36,9 +36,6 @@ import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
@SuppressWarnings("rawtypes")
public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponent<JMXComponent> {
- /* (non-Javadoc)
- * @see org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext, boolean)
- */
@Override
public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<JMXComponent> context,
boolean skipUnknownProps) {
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java
new file mode 100644
index 0000000..b9a73b5
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java
@@ -0,0 +1,70 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import java.util.Set;
+
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jbossas.JBossASServerComponent;
+import org.rhq.plugins.jbossas5.ApplicationServerComponent;
+import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class ModClusterDiscoveryComponent extends MBeanResourceDiscoveryComponent {
+
+ private final static String JBOSS_SERVER_HOME_DIR = "serverHomeDir";
+
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext context) {
+ Set<DiscoveredResourceDetails> tempSet = super.discoverResources(context);
+
+ for (DiscoveredResourceDetails detail : tempSet) {
+ String serverHomeDirectory = findServerHomeDirectory(context.getParentResourceComponent());
+ detail.getPluginConfiguration().put(new PropertySimple(JBOSS_SERVER_HOME_DIR, serverHomeDirectory));
+ }
+
+ return tempSet;
+ }
+
+ @SuppressWarnings("static-access")
+ public String findServerHomeDirectory(ResourceComponent parentResourceComponent) {
+ if (parentResourceComponent instanceof ApplicationServerComponent) {
+ ApplicationServerComponent parentComponent = (ApplicationServerComponent) parentResourceComponent;
+
+ return parentComponent.getResourceContext().getPluginConfiguration().getSimple("serverHomeDir")
+ .getStringValue();
+
+ } else if (parentResourceComponent instanceof JBossASServerComponent) {
+ JBossASServerComponent parentComponent = (JBossASServerComponent) parentResourceComponent;
+
+ return parentComponent.getPluginConfiguration().getSimple(parentComponent.JBOSS_HOME_DIR_CONFIG_PROP)
+ .getStringValue();
+ }
+
+ return null;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
new file mode 100644
index 0000000..7d5f0dc
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
@@ -0,0 +1,47 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings({ "rawtypes" })
+public class ModClusterServerComponent extends MBeanResourceComponent {
+
+ @Override
+ public AvailabilityType getAvailability() {
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
+
+ if (rawProxyInfo == null) {
+ return AvailabilityType.DOWN;
+ }
+
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ if (proxyInfo.getAvailableNodes().size() == 0) {
+ return AvailabilityType.DOWN;
+ }
+
+ return super.getAvailability();
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
deleted file mode 100644
index 03598e9..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2009 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.plugins.modcluster;
-
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.pluginapi.inventory.ResourceContext;
-import org.rhq.plugins.jbossas.JBossASServerComponent;
-import org.rhq.plugins.jbossas5.ApplicationServerComponent;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-import org.rhq.plugins.modcluster.helper.JBossHelper;
-
-/**
- * @author Stefan Negrea
- *
- */
-@SuppressWarnings({ "rawtypes" })
-public class ModclusterServerComponent extends MBeanResourceComponent {
-
- private final static String JBOSS_SERVER_HOME_DIR = "jboss.server.home.dir";
-
- @SuppressWarnings({ "unchecked", "deprecation", "static-access" })
- @Override
- public void start(ResourceContext context) {
- super.start(context);
-
- String serverHomeDirectory = null;
- if (this.resourceContext.getParentResourceComponent() instanceof ApplicationServerComponent) {
- ApplicationServerComponent parentComponent = (ApplicationServerComponent) this.resourceContext
- .getParentResourceComponent();
-
- serverHomeDirectory = parentComponent.getResourceContext().getPluginConfiguration()
- .getSimple("serverHomeDir").getStringValue();
-
- } else if (this.resourceContext.getParentResourceComponent() instanceof JBossASServerComponent) {
- JBossASServerComponent parentComponent = (JBossASServerComponent) this.resourceContext
- .getParentResourceComponent();
-
- serverHomeDirectory = parentComponent.getPluginConfiguration()
- .getSimple(parentComponent.JBOSS_HOME_DIR_CONFIG_PROP).getStringValue();
- }
-
- if (serverHomeDirectory != null) {
- PropertySimple serverHomeDirectoryProperty = null;
- serverHomeDirectoryProperty = new PropertySimple();
- serverHomeDirectoryProperty.setName(JBOSS_SERVER_HOME_DIR);
- serverHomeDirectoryProperty.setStringValue(serverHomeDirectory);
- this.resourceContext.getPluginConfiguration().put(serverHomeDirectoryProperty);
- }
- };
-
- //private final static String PROXY_INFO_PROPERTY_NAME
-
- /* (non-Javadoc)
- * @see org.rhq.plugins.jmx.MBeanResourceComponent#getAvailability()
- */
- @Override
- public AvailabilityType getAvailability() {
- String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
-
- if (rawProxyInfo == null) {
- return AvailabilityType.DOWN;
- }
-
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
- if (proxyInfo.getAvailableNodes().size() == 0) {
- return AvailabilityType.DOWN;
- }
-
- return super.getAvailability();
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
index bc54267..c67bf61 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
@@ -1,6 +1,9 @@
package org.rhq.plugins.modcluster;
+import java.util.concurrent.TimeUnit;
+
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.pluginapi.operation.OperationResult;
/*
@@ -36,4 +39,14 @@ public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceC
return super.invokeOperation(name, parameters);
}
+
+ @Override
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ System.out.println(typeName);
+ if (typeName.equals(TimeUnit.class.getName())) {
+ return TimeUnit.valueOf(propSimple.getStringValue());
+ }
+
+ return super.getPropertyValueAsType(propSimple, typeName);
+ }
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
new file mode 100644
index 0000000..0296eaf
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
@@ -0,0 +1,42 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import java.util.concurrent.TimeUnit;
+
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings("rawtypes")
+public class TimeUnitParamResourceComponent extends MBeanResourceComponent {
+
+ @Override
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ System.out.println(typeName);
+ if (typeName.equals(TimeUnit.class.getName())) {
+ return TimeUnit.valueOf(propSimple.getStringValue());
+ }
+
+ return super.getPropertyValueAsType(propSimple, typeName);
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
index 6c00130..dee2f81 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -18,11 +18,18 @@
*/
package org.rhq.plugins.modcluster.config;
+import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
@@ -38,11 +45,13 @@ public abstract class AbstractConfigurationFile {
public AbstractConfigurationFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
this.fileName = fileName;
- DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
- this.document = docBuilder.parse(this.getFileName());
+ loadConfiguratonFile();
}
+ abstract void setPropertyValue(String propertyName, String value);
+
+ abstract String getPropertyValue(String propertyName);
+
/**
* @return the fileName
*/
@@ -57,9 +66,19 @@ public abstract class AbstractConfigurationFile {
return document;
}
- abstract void setPropertyValue(String propertyName, String value);
+ public void saveConfigurationFile() throws Exception {
+ File file = new File(this.getFileName());
+ StreamResult result = new StreamResult(file);
+ Source source = new DOMSource(this.getDocument());
- abstract String getPropertyValue(String propertyName);
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.transform(source, result);
+ }
- abstract void saveConfigurationFile() throws Exception;
+ private void loadConfiguratonFile() throws ParserConfigurationException, SAXException, IOException {
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+ this.document = docBuilder.parse(this.getFileName());
+ }
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 1d008ee..354fa99 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -47,11 +47,4 @@ public class JBossWebServerFile extends AbstractConfigurationFile {
// TODO Auto-generated method stub
return null;
}
-
- @Override
- void saveConfigurationFile() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 45053f7..6abf955 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -19,17 +19,10 @@
package org.rhq.plugins.modcluster.config;
import java.io.IOException;
-import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Attr;
import org.w3c.dom.Node;
@@ -129,22 +122,6 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
}
/**
- * @throws TransformerException
- */
- public void saveConfigurationFile() throws TransformerException {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "no");
-
- //initialize StreamResult with File object to save to file
- StreamResult result = new StreamResult(new StringWriter());
- DOMSource source = new DOMSource(this.getDocument());
- transformer.transform(source, result);
-
- String xmlString = result.getWriter().toString();
- System.out.println(xmlString);
- }
-
- /**
* @param className
* @return
*/
@@ -155,7 +132,6 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
Node node = result.item(i);
if (node.getAttributes().getNamedItem("class") != null
&& className.equals(node.getAttributes().getNamedItem("class").getTextContent())) {
- System.out.println(node.getAttributes().getNamedItem("class").getTextContent());
return node;
}
}
@@ -174,7 +150,6 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
Node node = result.item(i);
if (node.getAttributes().getNamedItem("name") != null
&& beanName.equals(node.getAttributes().getNamedItem("name").getTextContent())) {
- System.out.println(node.getAttributes().getNamedItem("name").getTextContent());
return node;
}
}
@@ -243,5 +218,4 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return listOfNodes;
}
-
}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 4f3010f..ed82f7c 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -6,7 +6,9 @@
<depends plugin="JMX" />
<service name="mod_cluster"
- discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
+ discovery="ModClusterDiscoveryComponent"
+ class="ModClusterServerComponent"
+ supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
<runs-inside>
<parent-resource-type name="JBossAS Server" plugin="JBossAS" />
@@ -17,13 +19,17 @@
<c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*|jboss.web:service=ModCluster" />
<c:simple-property name="engineObjectName" readOnly="true" default="jboss.web:type=Engine" />
<c:simple-property name="nameTemplate" default="mod_cluster" />
+ <c:simple-property name="serverHomeDir"/>
</plugin-configuration>
<operation name="reset" displayName="Reset the node" description="Move this application server out of an error state." />
<operation name="refresh" displayName="Refresh configuration" description="Refresh configuration for this application server." />
<!-- Start - Configuration for HAModClusterService -->
- <service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+ <service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent"
+ class="PolyPingMBeanResourceComponent"
+ supportsManualAdd="true"
+ description="HA Service Listener" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
@@ -35,18 +41,18 @@
<!-- HA Operations -->
<operation name="disableDomain" displayName="Disable domain" description="Disables all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
<results>
- <c:simple-property name="result" description="The result of the operation" />
+ <c:simple-property name="operationResult" description="The result of the operation" />
</results>
</operation>
<operation name="enableDomain" displayName="Enable domain" description="Enable all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="stopDomain" displayName="Stop domain" description="Gracefully stops all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
<parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="The number of units of time for which to wait for all sessions to drain on a given node." />
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:simple-property required="true" name="p1" type="string" displayName="The number of units of time for which to wait for all sessions to drain on a given node." />
+ <c:simple-property required="true" name="p2" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
<c:property-options allowCustomValue="false">
<c:option value="MICROSECONDS" name="MICROSECONDS" />
<c:option value="MILLISECONDS" name="MILLISECONDS" />
@@ -58,7 +64,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -66,59 +72,60 @@
<operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
<results>
- <c:simple-property name="result" description="Map of PING_RPS response, grouped by proxy.">
+ <c:simple-property name="operationResult" description="Map of PING_RPS response, grouped by proxy.">
</c:simple-property>
</results>
</operation>
<operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ <c:simple-property required="true" name="p1" type="string" displayName="JVM Route of node to ping." />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="pingNodeByAddress" displayName="Ping node by address"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
- <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
- <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="p2" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="p3" type="integer" displayName="Port" />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
<operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
+
<operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" description="The result of the operation">
+ <c:simple-property name="operationResult" description="The result of the operation">
</c:simple-property>
</results>
</operation>
<operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" description="The result of the operation">
+ <c:simple-property name="operationResult" description="The result of the operation">
</c:simple-property>
</results>
</operation>
<operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
<parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:simple-property required="true" name="p1" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="p2" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
<c:property-options allowCustomValue="false">
<c:option value="MICROSECONDS" name="MICROSECONDS" />
<c:option value="MILLISECONDS" name="MILLISECONDS" />
@@ -130,7 +137,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -139,7 +146,7 @@
<metric property="ProxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
<resource-configuration>
- <c:simple-property name="processStatusFrequency" type="integer" description="Process status frequency." />
+ <c:simple-property name="processStatusFrequency" type="integer" required="false" description="Process status frequency." />
</resource-configuration>
</service>
@@ -203,56 +210,57 @@
<operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ <c:simple-property required="true" name="p1" type="string" displayName="JVM Route of node to ping." />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="pingNodeByAddress" displayName="Ping node by address"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
- <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
- <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="p2" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="p3" type="integer" displayName="Port" />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
<operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
+
<operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
<parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:simple-property required="true" name="p1" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="p2" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
<c:property-options allowCustomValue="false">
<c:option value="MICROSECONDS" name="MICROSECONDS" />
<c:option value="MILLISECONDS" name="MILLISECONDS" />
@@ -264,7 +272,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -338,12 +346,12 @@
</operation>
<operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
@@ -361,7 +369,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -396,11 +404,9 @@
<c:simple-property name="nameTemplate" default="Dynamic Load Balancer Factor" />
</plugin-configuration>
- <metric property="Metrics" displayName="Collected Metrics" displayType="summary" dataType="trait" />
-
<resource-configuration>
- <c:simple-property name="DecayFactor" type="integer" description="The number of historical load values used to determine load factor." />
- <c:simple-property name="History" type="integer" description="The exponential decay factor for historical load values." />
+ <c:simple-property name="decayFactor" type="integer" required="false" description="The number of historical load values used to determine load factor." />
+ <c:simple-property name="history" type="integer" required="false" description="The exponential decay factor for historical load values." />
</resource-configuration>
</service>
@@ -424,11 +430,13 @@
<c:simple-property name="nameTemplate" default="Load Metric" />
</plugin-configuration>
- <metric property="Load" displayName="Load" category="utilization" description="The current load of this metric as a percent of the metric's capacity." dataType="measurement" />
+ <metric property="Load" displayName="Load" category="utilization"
+ description="The current load of this metric as a percent of the metric's capacity." dataType="measurement"
+ defaultOn="true" displayType="summary"/>
<resource-configuration>
- <c:simple-property name="Weight" type="integer" description="The significance of this load metric compared to the other metrics." />
- <c:simple-property name="Capacity" type="double" description="Used to normalize the value returned by load expressed as a percentage of the capacity, such that: 0 < (load/capacity) < 1" />
+ <c:simple-property name="weight" type="integer" description="The significance of this load metric compared to the other metrics." />
+ <c:simple-property name="capacity" type="double" description="Used to normalize the value returned by load expressed as a percentage of the capacity, such that: 0 < (load/capacity) < 1" />
</resource-configuration>
</service>
@@ -436,7 +444,7 @@
<operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation." />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation." />
</results>
</operation>
<operation name="stopContext" displayName="Stop webapp" description="Gracefully stops this webapp.">
@@ -454,12 +462,12 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="enableContext" displayName="Enable webapp" description="Enable this webapp.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index c50b0e6..cba5672 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -28,16 +28,19 @@ public class ServerConfigTest {
public void TestConfig() {
try {
+ //Test simple bean configuration
ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
"/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
- System.out.println(config.getPropertyValue("test"));
+ config.setPropertyValue("test", null);
+ config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
+ //Test bean configuration with constructor dependency
config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
"org.jboss.modcluster.config.ha.HAModClusterConfig",
"/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
@@ -45,11 +48,8 @@ public class ServerConfigTest {
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
- System.out.println(config.getPropertyValue("test"));
-
- config.saveConfigurationFile();
-
config.setPropertyValue("test", null);
+ config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
} catch (Exception e) {
// TODO Auto-generated catch block
commit 8a35caa7f9b3d2093e7cdd495cf65f4572bca065
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon Aug 15 14:59:16 2011 -0500
The JBoss server home directory is now correctly retrieved from the parent resource component. Included some other minor code tweaks and refactorings.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
index 77a81b2..ba94746 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/pom.xml
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -42,7 +42,13 @@
</dependencyManagement>
<dependencies>
-
+ <dependency>
+ <groupId>org.jboss.on</groupId>
+ <artifactId>jopr-jboss-as-5-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>org.jboss.integration</groupId>
<artifactId>jboss-profileservice-spi</artifactId>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index 0a39eab..b642573 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -45,6 +45,7 @@ import org.rhq.core.pc.PluginContainerConfiguration;
import org.rhq.core.pc.plugin.FileSystemPluginFinder;
import org.rhq.core.pc.plugin.PluginEnvironment;
import org.rhq.core.pc.plugin.PluginManager;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
import org.rhq.core.pluginapi.inventory.ResourceComponent;
import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import org.rhq.core.pluginapi.operation.OperationFacet;
@@ -109,7 +110,8 @@ public class ModclusterPluginTest {
{
add(PLUGIN_NAME);
- add(PLUGIN_NAME + " Webapp Context");
+ add("Webapp Context");
+ add("HA Service Configuration");
}
};
@@ -124,8 +126,12 @@ public class ModclusterPluginTest {
Resource resource = (Resource) objectResource;
if (resource.getResourceType().getName().equals("mod_cluster")) {
testResourceMeasurement(resource);
- } else {
+ } else if (resource.getResourceType().getName().equals("Webapp Context")) {
testContextOperations(resource);
+ } else if (resource.getResourceType().getName().equals("HA Service Configuration")) {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+ ((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
}
}
}
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index fdc4f37..35c5b28 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -23,6 +23,14 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.on</groupId>
+ <artifactId>jopr-jboss-as-5-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>log4j</groupId>
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
index 8e14f9b..c5343d0 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
@@ -20,6 +20,8 @@ package org.rhq.plugins.modcluster;
import java.util.concurrent.TimeUnit;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.mc4j.ems.connection.bean.EmsBean;
import org.rhq.core.domain.configuration.Configuration;
@@ -35,6 +37,9 @@ import org.rhq.plugins.modcluster.helper.JBossHelper;
*/
@SuppressWarnings({ "rawtypes", "deprecation" })
public class ContextComponent extends MBeanResourceComponent<MBeanResourceComponent> {
+
+ private static final Log log = LogFactory.getLog(ContextComponent.class);
+
@Override
protected EmsBean loadBean() {
return getResourceContext().getParentResourceComponent().getEmsBean();
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index 9b511b3..ee0369c 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -19,6 +19,9 @@
package org.rhq.plugins.modcluster;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.configuration.PropertySimple;
@@ -34,11 +37,15 @@ import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
* @author Stefan Negrea
*
*/
-@SuppressWarnings("rawtypes")
+@SuppressWarnings({ "rawtypes", "deprecation" })
public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent {
+ private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
+
private static final String BEAN_CLASS_NAME_PROPERTY = "className";
private static final String DEPENDENCY_BEAN_CLASS_NAME_PROPERTY = "dependencyClassName";
+ private static final String SERVER_HOME_DIR = "jboss.server.home.dir";
+ private static final String CONFIGURATION_FILE_RELATIVE_PATH = "/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml";
/**
* This default setup of configuration properties can map to mbean attributes
@@ -46,15 +53,14 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
* @return the configuration of the component
*/
@Override
- @SuppressWarnings("deprecation")
public Configuration loadResourceConfiguration() {
+
Configuration configuration = new Configuration();
ConfigurationDefinition configurationDefinition = this.resourceContext.getResourceType()
.getResourceConfigurationDefinition();
try {
- ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
- .getPluginConfiguration());
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance();
for (PropertyDefinition property : configurationDefinition.getPropertyDefinitions().values()) {
if (property instanceof PropertyDefinitionSimple) {
@@ -69,8 +75,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
}
}
} catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.debug("Unable to load mod_cluster configuration file.", e);
}
return configuration;
@@ -84,19 +89,35 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
updateResourceConfiguration(report, false);
}
- private ModClusterBeanFile getModClusterBeanFileInstance(Configuration pluginConfig) throws Exception {
+ private ModClusterBeanFile getModClusterBeanFileInstance() throws Exception {
+ Configuration pluginConfig = this.resourceContext.getPluginConfiguration();
String beanClassName = pluginConfig.getSimple(BEAN_CLASS_NAME_PROPERTY).getStringValue();
+ String fileName = this.getServerHomeDirectory() + CONFIGURATION_FILE_RELATIVE_PATH;
+
if (pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY) != null) {
String dependencyBeanClassName = pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY)
.getStringValue();
- return new ModClusterBeanFile(dependencyBeanClassName);
+ return new ModClusterBeanFile(beanClassName, dependencyBeanClassName, fileName);
+ }
+
+ return new ModClusterBeanFile(beanClassName, fileName);
+ }
+
+ private String getServerHomeDirectory() {
+ ModclusterServerComponent modClusterComponent = (ModclusterServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ PropertySimple property = modClusterComponent.getResourceContext().getPluginConfiguration()
+ .getSimple(SERVER_HOME_DIR);
+
+ if (property != null) {
+ return property.getStringValue();
}
- return new ModClusterBeanFile(beanClassName);
+ return null;
}
- @SuppressWarnings("deprecation")
@Override
public void updateResourceConfiguration(ConfigurationUpdateReport report, boolean ignoreReadOnly) {
ConfigurationDefinition configurationDefinition = this.getResourceContext().getResourceType()
@@ -106,8 +127,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
report.setStatus(ConfigurationUpdateStatus.SUCCESS);
try {
- ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
- .getPluginConfiguration());
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance();
for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
PropertySimple property = report.getConfiguration().getSimple(key);
@@ -127,10 +147,9 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
}
}
- modClusterBeanFile.saveConfigFile();
+ modClusterBeanFile.saveConfigurationFile();
} catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.debug("Unable to save mod_cluster configuration file.", e);
}
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
index fb944c8..496068c 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -30,7 +30,7 @@ import org.rhq.plugins.jmx.JMXComponent;
import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
/**
- * @author snegrea
+ * @author Stefan Negrea
*
*/
@SuppressWarnings("rawtypes")
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
index 2c964c0..03598e9 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
@@ -18,7 +18,11 @@
*/
package org.rhq.plugins.modcluster;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.plugins.jbossas.JBossASServerComponent;
+import org.rhq.plugins.jbossas5.ApplicationServerComponent;
import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.helper.JBossHelper;
@@ -29,6 +33,38 @@ import org.rhq.plugins.modcluster.helper.JBossHelper;
@SuppressWarnings({ "rawtypes" })
public class ModclusterServerComponent extends MBeanResourceComponent {
+ private final static String JBOSS_SERVER_HOME_DIR = "jboss.server.home.dir";
+
+ @SuppressWarnings({ "unchecked", "deprecation", "static-access" })
+ @Override
+ public void start(ResourceContext context) {
+ super.start(context);
+
+ String serverHomeDirectory = null;
+ if (this.resourceContext.getParentResourceComponent() instanceof ApplicationServerComponent) {
+ ApplicationServerComponent parentComponent = (ApplicationServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ serverHomeDirectory = parentComponent.getResourceContext().getPluginConfiguration()
+ .getSimple("serverHomeDir").getStringValue();
+
+ } else if (this.resourceContext.getParentResourceComponent() instanceof JBossASServerComponent) {
+ JBossASServerComponent parentComponent = (JBossASServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ serverHomeDirectory = parentComponent.getPluginConfiguration()
+ .getSimple(parentComponent.JBOSS_HOME_DIR_CONFIG_PROP).getStringValue();
+ }
+
+ if (serverHomeDirectory != null) {
+ PropertySimple serverHomeDirectoryProperty = null;
+ serverHomeDirectoryProperty = new PropertySimple();
+ serverHomeDirectoryProperty.setName(JBOSS_SERVER_HOME_DIR);
+ serverHomeDirectoryProperty.setStringValue(serverHomeDirectory);
+ this.resourceContext.getPluginConfiguration().put(serverHomeDirectoryProperty);
+ }
+ };
+
//private final static String PROXY_INFO_PROPERTY_NAME
/* (non-Javadoc)
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
index 8f5d08b..bc54267 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
@@ -22,6 +22,10 @@ import org.rhq.core.pluginapi.operation.OperationResult;
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+/**
+ *
+ * @author Stefan Negrea
+ */
public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceComponent {
@Override
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
index 4fe5788..6c00130 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -32,9 +32,6 @@ import org.xml.sax.SAXException;
* @author Stefan Negrea
*/
public abstract class AbstractConfigurationFile {
-
- public static final String SERVER_HOME_DIR = "jboss.server.home.dir";
-
private String fileName;
private Document document;
@@ -60,4 +57,9 @@ public abstract class AbstractConfigurationFile {
return document;
}
+ abstract void setPropertyValue(String propertyName, String value);
+
+ abstract String getPropertyValue(String propertyName);
+
+ abstract void saveConfigurationFile() throws Exception;
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 602e52b..1d008ee 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -36,4 +36,22 @@ public class JBossWebServerFile extends AbstractConfigurationFile {
// TODO Auto-generated constructor stub
}
+ @Override
+ void setPropertyValue(String propertyName, String value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ String getPropertyValue(String propertyName) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ void saveConfigurationFile() throws Exception {
+ // TODO Auto-generated method stub
+
+ }
+
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 0e25f26..45053f7 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -16,7 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
package org.rhq.plugins.modcluster.config;
import java.io.IOException;
@@ -38,24 +37,38 @@ import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
/**
- * @author snegrea
+ * @author Stefan Negrea
*
*/
public class ModClusterBeanFile extends AbstractConfigurationFile {
private Node beanNode;
- public ModClusterBeanFile(String className) throws ParserConfigurationException, SAXException, IOException {
- super(
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ /**
+ * @param className
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, String configurationFile) throws ParserConfigurationException,
+ SAXException, IOException {
+ super(configurationFile);
beanNode = this.getBeanNodeByClass(className);
}
- public ModClusterBeanFile(String className, String constructorArgumentClassName)
+ /**
+ * @param className
+ * @param constructorArgumentClassName
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, String constructorArgumentClassName, String configurationFile)
throws ParserConfigurationException, SAXException, IOException {
- super(
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ super(configurationFile);
Node primaryBeanNode = this.getBeanNodeByClass(className);
String dependencyName = this.getBeanFromConstructorArgument(primaryBeanNode, constructorArgumentClassName);
@@ -63,58 +76,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
beanNode = this.getBeanNodeByName(dependencyName);
}
- private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
- List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
-
- if (tempNodeList.size() > 0) {
- Node constructorNode = tempNodeList.get(0);
-
- tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
-
- if (tempNodeList.size() > 0) {
- Node parameterNode = null;
-
- for (Node currentNode : tempNodeList) {
- if (currentNode.getAttributes().getNamedItem("class") != null
- && constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
- .getTextContent())) {
- parameterNode = currentNode;
- break;
- }
- }
-
- if (parameterNode != null) {
- tempNodeList = this.getChildNodesByName(parameterNode, "inject");
-
- if (tempNodeList.size() > 0) {
- Node injectNode = tempNodeList.get(0);
- Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
-
- if (beanAttribute != null) {
- return beanAttribute.getTextContent();
- }
- }
- }
- }
- }
-
- return null;
- }
-
- private List<Node> getChildNodesByName(Node node, String nodeName) {
- List<Node> listOfNodes = new ArrayList<Node>();
-
- for (int i = 0; i < node.getChildNodes().getLength(); i++) {
- Node currentNode = node.getChildNodes().item(i);
-
- if (nodeName.equals(currentNode.getNodeName())) {
- listOfNodes.add(currentNode);
- }
- }
-
- return listOfNodes;
- }
-
+ /**
+ * @param propertyName
+ * @param value
+ */
public void setPropertyValue(String propertyName, String value) {
boolean propertyFound = false;
for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
@@ -144,6 +109,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
}
}
+ /**
+ * @param propertyName
+ * @return
+ */
public String getPropertyValue(String propertyName) {
for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
Node currentNode = beanNode.getChildNodes().item(i);
@@ -159,7 +128,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return null;
}
- public void saveConfigFile() throws TransformerException {
+ /**
+ * @throws TransformerException
+ */
+ public void saveConfigurationFile() throws TransformerException {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "no");
@@ -172,7 +144,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
System.out.println(xmlString);
}
- public Node getBeanNodeByClass(String className) {
+ /**
+ * @param className
+ * @return
+ */
+ private Node getBeanNodeByClass(String className) {
NodeList result = this.getDocument().getElementsByTagName("bean");
for (int i = 1; i < result.getLength(); i++) {
@@ -187,7 +163,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return null;
}
- public Node getBeanNodeByName(String beanName) {
+ /**
+ * @param beanName
+ * @return
+ */
+ private Node getBeanNodeByName(String beanName) {
NodeList result = this.getDocument().getElementsByTagName("bean");
for (int i = 1; i < result.getLength(); i++) {
@@ -202,4 +182,66 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return null;
}
+ /**
+ * @param beanNode
+ * @param constructorArgumentClassName
+ * @return
+ */
+ private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
+ List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
+
+ if (tempNodeList.size() > 0) {
+ Node constructorNode = tempNodeList.get(0);
+
+ tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
+
+ if (tempNodeList.size() > 0) {
+ Node parameterNode = null;
+
+ for (Node currentNode : tempNodeList) {
+ if (currentNode.getAttributes().getNamedItem("class") != null
+ && constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
+ .getTextContent())) {
+ parameterNode = currentNode;
+ break;
+ }
+ }
+
+ if (parameterNode != null) {
+ tempNodeList = this.getChildNodesByName(parameterNode, "inject");
+
+ if (tempNodeList.size() > 0) {
+ Node injectNode = tempNodeList.get(0);
+ Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
+
+ if (beanAttribute != null) {
+ return beanAttribute.getTextContent();
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param node
+ * @param nodeName
+ * @return
+ */
+ private List<Node> getChildNodesByName(Node node, String nodeName) {
+ List<Node> listOfNodes = new ArrayList<Node>();
+
+ for (int i = 0; i < node.getChildNodes().getLength(); i++) {
+ Node currentNode = node.getChildNodes().item(i);
+
+ if (nodeName.equals(currentNode.getNodeName())) {
+ listOfNodes.add(currentNode);
+ }
+ }
+
+ return listOfNodes;
+ }
+
}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index fe4ac7d..4f3010f 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -5,7 +5,8 @@
<depends plugin="JMX" />
- <service name="mod_cluster" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
+ <service name="mod_cluster"
+ discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
<runs-inside>
<parent-resource-type name="JBossAS Server" plugin="JBossAS" />
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index 4e4aac1..c50b0e6 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -28,27 +28,29 @@ public class ServerConfigTest {
public void TestConfig() {
try {
- ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService");
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
System.out.println(config.getPropertyValue("test"));
- config.saveConfigFile();
+ config.saveConfigurationFile();
config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
- "org.jboss.modcluster.config.ha.HAModClusterConfig");
+ "org.jboss.modcluster.config.ha.HAModClusterConfig",
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
System.out.println(config.getPropertyValue("test"));
- config.saveConfigFile();
+ config.saveConfigurationFile();
config.setPropertyValue("test", null);
- config.saveConfigFile();
+ config.saveConfigurationFile();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
commit eb9e67e2c2115a941044fe5e03782ac524d60550
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 14 12:06:26 2011 -0500
Enable mod_cluster support for JBoss 5&6 with simple and HA configuration listeners. Also, added metric collections and configuration save to bean file.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
new file mode 100644
index 0000000..b9ce25e
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
@@ -0,0 +1,95 @@
+/*
+ * 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.plugins.modcluster;
+
+import java.util.Set;
+
+import org.mc4j.ems.connection.EmsConnection;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
+
+/**
+ * Discovers mod_cluster contexts from the proxyInfo mbean property.
+ *
+ * @author Stefan Negrea
+ */
+@SuppressWarnings("rawtypes")
+public class ClassNameMBeanDiscoveryComponent<T extends JMXComponent> extends MBeanResourceDiscoveryComponent<T> {
+
+ private static final String CLASS_NAME = "className";
+
+ /* (non-Javadoc)
+ * @see org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext, boolean)
+ */
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<T> context,
+ boolean skipUnknownProps) {
+
+ Set<DiscoveredResourceDetails> results = super.discoverResources(context, skipUnknownProps);
+
+ for (DiscoveredResourceDetails discoveredResource : results) {
+ if (!isBeanConfiguredClassName(context, discoveredResource.getResourceKey())) {
+ results.remove(discoveredResource);
+ }
+ }
+
+ return results;
+ }
+
+ /**
+ * @param context
+ * @param objectName
+ * @return
+ */
+ public boolean isBeanConfiguredClassName(ResourceDiscoveryContext<T> context, String objectName) {
+ String className = context.getDefaultPluginConfiguration().getSimple(CLASS_NAME).getStringValue();
+
+ EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
+ EmsBean emsBean = loadBean(connection, objectName);
+
+ return className.equals(emsBean.getClassTypeName());
+ }
+
+ /**
+ * Loads the bean with the given object name.
+ *
+ * Subclasses are free to override this method in order to load the bean.
+ *
+ * @param objectName the name of the bean to load
+ * @return the bean that is loaded
+ */
+ protected EmsBean loadBean(EmsConnection emsConnection, String objectName) {
+ EmsBean bean = emsConnection.getBean(objectName);
+ if (bean == null) {
+ // In some cases, this resource component may have been discovered by some means other than querying its
+ // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
+ // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
+ // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
+ // bean before giving up.
+ emsConnection.queryBeans(objectName);
+ bean = emsConnection.getBean(objectName);
+ }
+ return bean;
+ }
+
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
index 3545fa5..8e14f9b 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
@@ -26,6 +26,7 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.pluginapi.operation.OperationResult;
import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
/**
* Manages a mod_cluster context entity.
@@ -44,7 +45,7 @@ public class ContextComponent extends MBeanResourceComponent<MBeanResourceCompon
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
- String rawProxyInfo = (String) getEmsBean().getAttribute("proxyInfo").refresh().toString();
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
@@ -91,12 +92,16 @@ public class ContextComponent extends MBeanResourceComponent<MBeanResourceCompon
Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
Object resultObject = getEmsBean().getOperation(name).invoke(configuration);
- return new OperationResult(String.valueOf(resultObject));
+ if (resultObject instanceof OperationResult) {
+ return (OperationResult) resultObject;
+ } else {
+ return new OperationResult(String.valueOf(resultObject));
+ }
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
}
- throw new Exception("Operation " + name + " not available mod_cluster_context service");
+ throw new Exception("Operation " + name + " not available mod_cluster WebApp service.");
}
}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
index 3d03715..788cbce 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
@@ -1,24 +1,20 @@
/*
- * Jopr Management Platform
+ * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
+ * 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 and the GNU Lesser General Public License
- * for more details.
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.rhq.plugins.modcluster;
@@ -33,6 +29,7 @@ import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
/**
* Discovers mod_cluster contexts from the proxyInfo mbean property.
@@ -43,7 +40,6 @@ import org.rhq.plugins.jmx.MBeanResourceComponent;
public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBeanResourceComponent> {
private static final String JVM_ROUTE_PROPERTY = "jvmRoute";
- private static final String PROXY_INFO_PROPERTY = "proxyInfo";
private static final String ENGINE_OBJECT_NAME = "engineObjectName";
/* (non-Javadoc)
@@ -51,7 +47,9 @@ public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBe
*/
public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent> context) {
String jvmRoute = this.getJvmRoute(context);
- String rawProxyInfo = this.getRawProxyInfo(context);
+
+ EmsBean configBean = context.getParentResourceComponent().getEmsBean();
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(configBean);
ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();
@@ -59,8 +57,7 @@ public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBe
for (ProxyInfo.Context availableContext : proxyInfo.getAvailableContexts()) {
if (availableContext.getJvmRoute().equals(jvmRoute)) {
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(),
- availableContext.createKey(), availableContext.createName(), null, "mod_cluster Webapp Context",
- null, null);
+ availableContext.createKey(), availableContext.createName(), null, "Webapp Context", null, null);
entities.add(detail);
}
}
@@ -83,17 +80,6 @@ public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBe
}
/**
- * Retrieves raw proxy configuration from the parent context.
- *
- * @param context the discovery context
- * @return raw proxy configuration
- */
- private String getRawProxyInfo(ResourceDiscoveryContext<MBeanResourceComponent> context) {
- EmsBean statsBean = context.getParentResourceComponent().getEmsBean();
- return (String) statsBean.getAttribute(PROXY_INFO_PROPERTY).refresh().toString();
- }
-
- /**
* Loads the bean with the given object name.
*
* Subclasses are free to override this method in order to load the bean.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
new file mode 100644
index 0000000..9b511b3
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -0,0 +1,137 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings("rawtypes")
+public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent {
+
+ private static final String BEAN_CLASS_NAME_PROPERTY = "className";
+ private static final String DEPENDENCY_BEAN_CLASS_NAME_PROPERTY = "dependencyClassName";
+
+ /**
+ * This default setup of configuration properties can map to mbean attributes
+ *
+ * @return the configuration of the component
+ */
+ @Override
+ @SuppressWarnings("deprecation")
+ public Configuration loadResourceConfiguration() {
+ Configuration configuration = new Configuration();
+ ConfigurationDefinition configurationDefinition = this.resourceContext.getResourceType()
+ .getResourceConfigurationDefinition();
+
+ try {
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
+ .getPluginConfiguration());
+
+ for (PropertyDefinition property : configurationDefinition.getPropertyDefinitions().values()) {
+ if (property instanceof PropertyDefinitionSimple) {
+ String value = modClusterBeanFile.getPropertyValue(property.getName());
+ if (value != null) {
+ configuration.put(new PropertySimple(property.getName(), value));
+ } else {
+ PropertyDefinitionSimple propertyDefinitionSimple = (PropertyDefinitionSimple) property;
+ configuration.put(new PropertySimple(property.getName(), propertyDefinitionSimple
+ .getDefaultValue()));
+ }
+ }
+ }
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return configuration;
+ }
+
+ /**
+ * Equivalent to updateResourceConfiguration(report, false);
+ */
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ updateResourceConfiguration(report, false);
+ }
+
+ private ModClusterBeanFile getModClusterBeanFileInstance(Configuration pluginConfig) throws Exception {
+ String beanClassName = pluginConfig.getSimple(BEAN_CLASS_NAME_PROPERTY).getStringValue();
+
+ if (pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY) != null) {
+ String dependencyBeanClassName = pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY)
+ .getStringValue();
+ return new ModClusterBeanFile(dependencyBeanClassName);
+ }
+
+ return new ModClusterBeanFile(beanClassName);
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report, boolean ignoreReadOnly) {
+ ConfigurationDefinition configurationDefinition = this.getResourceContext().getResourceType()
+ .getResourceConfigurationDefinition();
+
+ // assume we succeed - we'll set to failure if we can't set all properties
+ report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+
+ try {
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
+ .getPluginConfiguration());
+
+ for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
+ PropertySimple property = report.getConfiguration().getSimple(key);
+ if (property != null) {
+ try {
+ PropertyDefinitionSimple def = configurationDefinition.getPropertyDefinitionSimple(property
+ .getName());
+ if (!(ignoreReadOnly && def.isReadOnly())) {
+ modClusterBeanFile.setPropertyValue(property.getName(), property.getStringValue());
+ }
+ } catch (Exception e) {
+ property.setErrorMessage(ThrowableUtil.getStackAsString(e));
+ report
+ .setErrorMessage("Failed setting resource configuration - see property error messages for details");
+ log.info("Failure setting MBean Resource configuration value for " + key, e);
+ }
+ }
+ }
+
+ modClusterBeanFile.saveConfigFile();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
new file mode 100644
index 0000000..fb944c8
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -0,0 +1,95 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import java.util.Set;
+
+import org.mc4j.ems.connection.EmsConnection;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
+
+/**
+ * @author snegrea
+ *
+ */
+@SuppressWarnings("rawtypes")
+public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponent<JMXComponent> {
+
+ /* (non-Javadoc)
+ * @see org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext, boolean)
+ */
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<JMXComponent> context,
+ boolean skipUnknownProps) {
+
+ Set<DiscoveredResourceDetails> results = super.discoverResources(context, skipUnknownProps);
+
+ for (DiscoveredResourceDetails discoveredResource : results) {
+
+ String name = getBeanConfiguredClassName(context, discoveredResource.getResourceKey());
+
+ name = name.substring(name.lastIndexOf(".") + 1);
+ name = name.substring(0, name.lastIndexOf("LoadMetric"));
+
+ discoveredResource.setResourceName(name);
+ discoveredResource.setResourceDescription("Load Metric");
+ }
+
+ return results;
+ }
+
+ /**
+ * @param context
+ * @param objectName
+ * @return
+ */
+ public String getBeanConfiguredClassName(ResourceDiscoveryContext<JMXComponent> context, String objectName) {
+ EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
+ EmsBean emsBean = loadBean(connection, objectName);
+
+ return emsBean.getClassTypeName();
+ }
+
+ /**
+ * Loads the bean with the given object name.
+ *
+ * Subclasses are free to override this method in order to load the bean.
+ *
+ * @param objectName the name of the bean to load
+ * @return the bean that is loaded
+ */
+ protected EmsBean loadBean(EmsConnection emsConnection, String objectName) {
+ EmsBean bean = emsConnection.getBean(objectName);
+ if (bean == null) {
+ // In some cases, this resource component may have been discovered by some means other than querying its
+ // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
+ // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
+ // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
+ // bean before giving up.
+ emsConnection.queryBeans(objectName);
+ bean = emsConnection.getBean(objectName);
+ }
+ return bean;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
index 70898ef..2c964c0 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
@@ -20,6 +20,7 @@ package org.rhq.plugins.modcluster;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
/**
* @author Stefan Negrea
@@ -28,15 +29,21 @@ import org.rhq.plugins.jmx.MBeanResourceComponent;
@SuppressWarnings({ "rawtypes" })
public class ModclusterServerComponent extends MBeanResourceComponent {
+ //private final static String PROXY_INFO_PROPERTY_NAME
+
/* (non-Javadoc)
* @see org.rhq.plugins.jmx.MBeanResourceComponent#getAvailability()
*/
@Override
public AvailabilityType getAvailability() {
- String rawProxyInfo = (String) getEmsBean().getAttribute("proxyInfo").refresh().toString();
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
+
+ if (rawProxyInfo == null) {
+ return AvailabilityType.DOWN;
+ }
- if (proxyInfo.getAvailableContexts().size() == 0) {
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ if (proxyInfo.getAvailableNodes().size() == 0) {
return AvailabilityType.DOWN;
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
new file mode 100644
index 0000000..8f5d08b
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
@@ -0,0 +1,35 @@
+package org.rhq.plugins.modcluster;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.
+ */
+
+public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceComponent {
+
+ @Override
+ public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
+ if (name.toLowerCase().startsWith("ping")) {
+ name = "ping";
+ }
+
+ return super.invokeOperation(name, parameters);
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
new file mode 100644
index 0000000..4fe5788
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -0,0 +1,63 @@
+/*
+ * 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.plugins.modcluster.config;
+
+import java.io.IOException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ *
+ * @author Stefan Negrea
+ */
+public abstract class AbstractConfigurationFile {
+
+ public static final String SERVER_HOME_DIR = "jboss.server.home.dir";
+
+ private String fileName;
+ private Document document;
+
+ public AbstractConfigurationFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
+ this.fileName = fileName;
+
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+ this.document = docBuilder.parse(this.getFileName());
+ }
+
+ /**
+ * @return the fileName
+ */
+ public String getFileName() {
+ return fileName;
+ }
+
+ /**
+ * @return the doc
+ */
+ public Document getDocument() {
+ return document;
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
new file mode 100644
index 0000000..602e52b
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -0,0 +1,39 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster.config;
+
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+public class JBossWebServerFile extends AbstractConfigurationFile {
+
+ public JBossWebServerFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
+ super(fileName);
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
new file mode 100644
index 0000000..0e25f26
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -0,0 +1,205 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster.config;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * @author snegrea
+ *
+ */
+public class ModClusterBeanFile extends AbstractConfigurationFile {
+
+ private Node beanNode;
+
+ public ModClusterBeanFile(String className) throws ParserConfigurationException, SAXException, IOException {
+ super(
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+
+ beanNode = this.getBeanNodeByClass(className);
+ }
+
+ public ModClusterBeanFile(String className, String constructorArgumentClassName)
+ throws ParserConfigurationException, SAXException, IOException {
+ super(
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+
+ Node primaryBeanNode = this.getBeanNodeByClass(className);
+ String dependencyName = this.getBeanFromConstructorArgument(primaryBeanNode, constructorArgumentClassName);
+
+ beanNode = this.getBeanNodeByName(dependencyName);
+ }
+
+ private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
+ List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
+
+ if (tempNodeList.size() > 0) {
+ Node constructorNode = tempNodeList.get(0);
+
+ tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
+
+ if (tempNodeList.size() > 0) {
+ Node parameterNode = null;
+
+ for (Node currentNode : tempNodeList) {
+ if (currentNode.getAttributes().getNamedItem("class") != null
+ && constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
+ .getTextContent())) {
+ parameterNode = currentNode;
+ break;
+ }
+ }
+
+ if (parameterNode != null) {
+ tempNodeList = this.getChildNodesByName(parameterNode, "inject");
+
+ if (tempNodeList.size() > 0) {
+ Node injectNode = tempNodeList.get(0);
+ Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
+
+ if (beanAttribute != null) {
+ return beanAttribute.getTextContent();
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private List<Node> getChildNodesByName(Node node, String nodeName) {
+ List<Node> listOfNodes = new ArrayList<Node>();
+
+ for (int i = 0; i < node.getChildNodes().getLength(); i++) {
+ Node currentNode = node.getChildNodes().item(i);
+
+ if (nodeName.equals(currentNode.getNodeName())) {
+ listOfNodes.add(currentNode);
+ }
+ }
+
+ return listOfNodes;
+ }
+
+ public void setPropertyValue(String propertyName, String value) {
+ boolean propertyFound = false;
+ for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
+ Node currentNode = beanNode.getChildNodes().item(i);
+
+ if (currentNode.getNodeName().equals("property")
+ && currentNode.getAttributes().getNamedItem("name") != null
+ && propertyName.equals(currentNode.getAttributes().getNamedItem("name").getTextContent())) {
+
+ if (value != null) {
+ currentNode.setTextContent(value);
+ } else {
+ beanNode.removeChild(currentNode);
+ }
+
+ propertyFound = true;
+ }
+ }
+
+ if (value != null && !propertyFound) {
+ Node propertyChild = this.getDocument().createElement("property");
+ Attr nameProperty = this.getDocument().createAttribute("name");
+ nameProperty.setValue(propertyName);
+ propertyChild.setTextContent(value);
+ propertyChild.getAttributes().setNamedItem(nameProperty);
+ beanNode.appendChild(propertyChild);
+ }
+ }
+
+ public String getPropertyValue(String propertyName) {
+ for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
+ Node currentNode = beanNode.getChildNodes().item(i);
+
+ if (currentNode.getNodeName().equals("property")
+ && currentNode.getAttributes().getNamedItem("name") != null
+ && propertyName.equals(currentNode.getAttributes().getNamedItem("name").getTextContent())) {
+
+ return currentNode.getTextContent();
+ }
+ }
+
+ return null;
+ }
+
+ public void saveConfigFile() throws TransformerException {
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "no");
+
+ //initialize StreamResult with File object to save to file
+ StreamResult result = new StreamResult(new StringWriter());
+ DOMSource source = new DOMSource(this.getDocument());
+ transformer.transform(source, result);
+
+ String xmlString = result.getWriter().toString();
+ System.out.println(xmlString);
+ }
+
+ public Node getBeanNodeByClass(String className) {
+ NodeList result = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < result.getLength(); i++) {
+ Node node = result.item(i);
+ if (node.getAttributes().getNamedItem("class") != null
+ && className.equals(node.getAttributes().getNamedItem("class").getTextContent())) {
+ System.out.println(node.getAttributes().getNamedItem("class").getTextContent());
+ return node;
+ }
+ }
+
+ return null;
+ }
+
+ public Node getBeanNodeByName(String beanName) {
+ NodeList result = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < result.getLength(); i++) {
+ Node node = result.item(i);
+ if (node.getAttributes().getNamedItem("name") != null
+ && beanName.equals(node.getAttributes().getNamedItem("name").getTextContent())) {
+ System.out.println(node.getAttributes().getNamedItem("name").getTextContent());
+ return node;
+ }
+ }
+
+ return null;
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java
new file mode 100644
index 0000000..364f3ef
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java
@@ -0,0 +1,49 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster.helper;
+
+import org.mc4j.ems.connection.bean.EmsBean;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+public class JBossHelper {
+
+ public static String getRawProxyInfo(EmsBean emsBean) {
+ String rawProxyInfo = null;
+
+ //try first to get the value for JBoss EAP5.x or AS6
+ try {
+ rawProxyInfo = (String) emsBean.getAttribute("ProxyInfo").refresh().toString();
+ } catch (Exception e) {
+ }
+
+ //if not able to get the value after the first attempt try to get the value for JBoss 4.2/4.3
+ if (rawProxyInfo == null) {
+ try {
+ rawProxyInfo = (String) emsBean.getAttribute("proxyInfo").refresh().toString();
+ } catch (Exception e) {
+ }
+ }
+
+ return rawProxyInfo;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 4846490..fe4ac7d 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -1,132 +1,466 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<plugin name="mod_cluster"
- displayName="mod_cluster"
- description="Monitoring and management of mod_cluster plugin."
- version="1.0"
- package="org.rhq.plugins.modcluster"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="urn:xmlns:rhq-plugin"
- xmlns:c="urn:xmlns:rhq-configuration">
+<plugin name="mod_cluster" displayName="mod_cluster" description="Monitoring and management of mod_cluster plugin." version="1.0" package="org.rhq.plugins.modcluster" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
<depends plugin="JMX" />
- <service name="mod_cluster"
- discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
- class="ModclusterServerComponent"
- supportsManualAdd="true"
- description="mod_cluster plugin"
- singleton="true">
-
+ <service name="mod_cluster" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
+
<runs-inside>
- <parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
- <parent-resource-type name="JBossAS5 Server" plugin="JBossAS5"/>
+ <parent-resource-type name="JBossAS Server" plugin="JBossAS" />
+ <parent-resource-type name="JBossAS Server" plugin="JBossAS5" />
</runs-inside>
-
+
<plugin-configuration>
- <c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*"/>
- <c:simple-property name="engineObjectName" readOnly="true" default="jboss.web:type=Engine"/>
- <c:simple-property name="nameTemplate" default="mod_cluster"/>
+ <c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*|jboss.web:service=ModCluster" />
+ <c:simple-property name="engineObjectName" readOnly="true" default="jboss.web:type=Engine" />
+ <c:simple-property name="nameTemplate" default="mod_cluster" />
</plugin-configuration>
-
- <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
- <parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout"/>
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
- <c:property-options allowCustomValue="false">
- <c:option value="MICROSECONDS" name="MICROSECONDS"/>
- <c:option value="MILLISECONDS" name="MILLISECONDS"/>
- <c:option value="NANOSECONDS" name="NANOSECONDS"/>
- <c:option value="SECONDS" name="SECONDS"/>
- <c:option value="HOURS" name="HOURS"/>
- <c:option value="DAYS" name="DAYS"/>
- </c:property-options>
- </c:simple-property>
- </parameters>
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
- <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
- <parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address"/>
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port"/>
- </parameters>
- </operation>
- <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
+
<operation name="reset" displayName="Reset the node" description="Move this application server out of an error state." />
- <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
- <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
- <parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address"/>
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port"/>
- </parameters>
- </operation>
<operation name="refresh" displayName="Refresh configuration" description="Refresh configuration for this application server." />
-
- <metric property="proxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
- <metric property="modelerType" displayName="Type of the modeled resource" displayType="summary" dataType="trait" />
- <metric property="className" displayName="Fully qualified class name of the managed object" displayType="summary" dataType="trait" />
- <metric property="advertise" displayName="Enable autodiscovery of httpd servers." displayType="summary" dataType="trait" />
-
- <resource-configuration>
- <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
- <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the cluster."/>
- <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster."/>
- <c:simple-property name="smax" type="integer" description="Maximum time on seconds for idle connections above smax."/>
- <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server."/>
- <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery."/>
- <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node."/>
- <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer."/>
- <c:simple-property name="flushPackets" type="boolean" description="Allows controlling flusing of packets."/>
- <c:simple-property name="socketTimeout" type="integer" description="Connection timeout for communication with the proxy." />
- <c:simple-property name="advertisePort" type="integer" required="false" description="Multicast port for discovery" />
- <c:simple-property name="advertiseGroupAddress" type="string" required="false" description="Multicast address for discovery."/>
- <c:simple-property name="flushWait" type="integer" description="Time in ms to wait before flushing packets."/>
- <c:simple-property name="ping" type="integer" description="Time in s to wait for a pong answer to a ping."/>
- </resource-configuration>
-
- <service name="mod_cluster Webapp Context"
- discovery="ContextDiscoveryComponent"
- class="ContextComponent"
- description="mod_cluster webapp context">
-
- <operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation."/>
- </results>
- </operation>
- <operation name="stopContext" displayName="Stop webapp" description="Gracefully stops this webapp.">
+
+ <!-- Start - Configuration for HAModClusterService -->
+ <service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ha.HAModClusterService" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <!-- HA Operations -->
+ <operation name="disableDomain" displayName="Disable domain" description="Disables all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
+ <results>
+ <c:simple-property name="result" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enableDomain" displayName="Enable domain" description="Enable all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="stopDomain" displayName="Stop domain" description="Gracefully stops all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="The number of units of time for which to wait for all sessions to drain on a given node." />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <!-- Regular Operations -->
+
+ <operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
+ <results>
+ <c:simple-property name="result" description="Map of PING_RPS response, grouped by proxy.">
+ </c:simple-property>
+ </results>
+ </operation>
+ <operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+ <operation name="pingNodeByAddress" displayName="Ping node by address"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+
+ <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" description="The result of the operation">
+ </c:simple-property>
+ </results>
+ </operation>
+ <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" description="The result of the operation">
+ </c:simple-property>
+ </results>
+ </operation>
+ <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <metric property="MasterNode" displayName="Master Node" displayType="summary" dataType="trait" />
+ <metric property="ProxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="ProxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
+
+ <resource-configuration>
+ <c:simple-property name="processStatusFrequency" type="integer" description="Process status frequency." />
+ </resource-configuration>
+ </service>
+
+ <service name="HA Service Configuration" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="HA Service Configuration" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service Configuration" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ha.HAModClusterService" />
+ <c:simple-property name="dependencyClassName" readOnly="true" default="org.jboss.modcluster.config.ha.HAModClusterConfig" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <resource-configuration>
+
+ <!-- HA Configuration -->
+ <c:simple-property name="masterPerLoadBalancingGroup" type="boolean" required="false" description="Enable current node to be master in the load balancing group." />
+
+ <!-- Handler Configuration -->
+ <c:simple-property name="advertise" type="boolean" required="false" default="false" description="Enable autodiscovery of httpd servers." />
+ <c:simple-property name="advertiseGroupAddress" type="string" description="Multicast address on which to listen for advertisements." />
+ <c:simple-property name="advertisePort" type="string" required="false" description="Multicast port for discovery" />
+ <c:simple-property name="advertiseInterface" type="string" required="false" description="Multicast interface for discovery" />
+ <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery." />
+ <c:simple-property name="proxyList" type="string" required="false" description="Comma separated list of address:port listing the httpd servers where mod_cluster is running." />
+ <c:simple-property name="proxyURL" type="string" required="false" description="URL prefix to send with commands to mod_cluster. Default is no prefix." />
+ <c:simple-property name="socketTimeout" type="integer" required="false" description="Connection timeout for communication with the proxy." />
+ <c:simple-property name="ssl" type="boolean" description="Whether to use SSL to communicate with mod_cluster. Note this has nothing to do with handling of https requests by JBoss Web" />
+ <c:simple-property name="excludedContexts" type="string" required="false" description="Comma delimited list of contexts that should *not* be auto-registered with httpd. Contexts may be qualified by host using a colon, e.g. host1:context1. If no host is defined, localhost is assumed." />
+ <c:simple-property name="autoEnableContexts" type="boolean" required="false" default="true" description="Toggle for context auto-enable during mod_cluster startup." />
+
+ <!-- Node Configuration -->
+ <c:simple-property name="loadBalancingGroup" type="string" required="false" description="Load balancing group." />
+ <c:simple-property name="flushPackets" type="boolean" required="false" description="Allows controlling flusing of packets." />
+ <c:simple-property name="flushWait" type="integer" required="false" description="Time in ms to wait before flushing packets." />
+ <c:simple-property name="ping" type="integer" required="false" description="Time in s to wait for a pong answer to a ping." />
+ <c:simple-property name="smax" type="integer" required="false" description="Maximum time on seconds for idle connections above smax." />
+ <c:simple-property name="ttl" type="integer" required="false" description="TTL" />
+ <c:simple-property name="nodeTimeout" type="integer" required="false" description="Node timeout" />
+ <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer" />
+
+ <!-- Balancer Configuration -->
+ <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the node." />
+ <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster." />
+ <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node." />
+ <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
+ <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server." />
+ </resource-configuration>
+ </service>
+ <!-- End - Configuration for HAModClusterService -->
+
+ <!-- Start - Configuration for ModClusterService -->
+ <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ModClusterService" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+ <operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+ <operation name="pingNodeByAddress" displayName="Ping node by address"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+
+ <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <metric property="ProxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="ProxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
+ </service>
+
+ <service name="Service Configuration" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="HA Service Configuration" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service Configuration" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ModClusterService" />
+ <c:simple-property name="dependencyClassName" readOnly="true" default="org.jboss.modcluster.config.ModClusterConfig" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <!-- Handler Configuration -->
+ <c:simple-property name="advertise" type="boolean" required="false" default="false" description="Enable autodiscovery of httpd servers." />
+ <c:simple-property name="advertiseGroupAddress" type="string" description="Multicast address on which to listen for advertisements." />
+ <c:simple-property name="advertisePort" type="string" required="false" description="Multicast port for discovery" />
+ <c:simple-property name="advertiseInterface" type="string" required="false" description="Multicast interface for discovery" />
+ <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery." />
+ <c:simple-property name="proxyList" type="string" required="false" description="Comma separated list of address:port listing the httpd servers where mod_cluster is running." />
+ <c:simple-property name="proxyURL" type="string" required="false" description="URL prefix to send with commands to mod_cluster. Default is no prefix." />
+ <c:simple-property name="socketTimeout" type="integer" required="false" description="Connection timeout for communication with the proxy." />
+ <c:simple-property name="ssl" type="boolean" description="Whether to use SSL to communicate with mod_cluster. Note this has nothing to do with handling of https requests by JBoss Web" />
+ <c:simple-property name="excludedContexts" type="string" required="false"
+ description="Comma delimited list of contexts that should *not* be auto-registered with httpd. Contexts may be qualified by host using a colon, e.g. host1:context1. If no host is defined, localhost is assumed." />
+ <c:simple-property name="autoEnableContexts" type="boolean" required="false" default="true" description="Toggle for context auto-enable during mod_cluster startup." />
+
+ <!-- Node Configuration -->
+ <c:simple-property name="loadBalancingGroup" type="string" required="false" description="Load balancing group." />
+ <c:simple-property name="flushPackets" type="boolean" required="false" description="Allows controlling flusing of packets." />
+ <c:simple-property name="flushWait" type="integer" required="false" description="Time in ms to wait before flushing packets." />
+ <c:simple-property name="ping" type="integer" required="false" description="Time in s to wait for a pong answer to a ping." />
+ <c:simple-property name="smax" type="integer" required="false" description="Maximum time on seconds for idle connections above smax." />
+ <c:simple-property name="ttl" type="integer" required="false" description="TTL" />
+ <c:simple-property name="nodeTimeout" type="integer" required="false" description="Node timeout" />
+ <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer" />
+
+ <!-- Balancer Configuration -->
+ <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the node." />
+ <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster." />
+ <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node." />
+ <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
+ <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server." />
+ </resource-configuration>
+ </service>
+ <!-- End - Configuration for ModClusterService -->
+
+ <service name="Catalina Service" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="Catalina Service Listener" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*" />
+ <c:simple-property name="nameTemplate" default="mod_cluster Catalina Listener" />
+ </plugin-configuration>
+
+ <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <metric property="proxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="modelerType" displayName="Type of the modeled resource" displayType="summary" dataType="trait" />
+ <metric property="className" displayName="Fully qualified class name of the managed object" displayType="summary" dataType="trait" />
+ <metric property="advertise" displayName="Enable autodiscovery of httpd servers." displayType="summary" dataType="trait" />
+
+ <resource-configuration>
+ <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
+ <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the cluster." />
+ <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster." />
+ <c:simple-property name="smax" type="integer" description="Maximum time on seconds for idle connections above smax." />
+ <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server." />
+ <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery." />
+ <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node." />
+ <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer." />
+ <c:simple-property name="flushPackets" type="boolean" description="Allows controlling flusing of packets." />
+ <c:simple-property name="socketTimeout" type="integer" description="Connection timeout for communication with the proxy." />
+ <c:simple-property name="advertisePort" type="integer" required="false" description="Multicast port for discovery" />
+ <c:simple-property name="advertiseGroupAddress" type="string" required="false" description="Multicast address for discovery." />
+ <c:simple-property name="flushWait" type="integer" description="Time in ms to wait before flushing packets." />
+ <c:simple-property name="ping" type="integer" description="Time in s to wait for a pong answer to a ping." />
+ </resource-configuration>
+ </service>
+
+ <service name="Dynamic Load Balancer Factor" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="Dynamic Load balancer factor for mod_cluster" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,*" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProvider" />
+ <c:simple-property name="nameTemplate" default="Dynamic Load Balancer Factor" />
+ </plugin-configuration>
+
+ <metric property="Metrics" displayName="Collected Metrics" displayType="summary" dataType="trait" />
+
+ <resource-configuration>
+ <c:simple-property name="DecayFactor" type="integer" description="The number of historical load values used to determine load factor." />
+ <c:simple-property name="History" type="integer" description="The exponential decay factor for historical load values." />
+ </resource-configuration>
+ </service>
+
+ <service name="Simple Load Balancer Factor" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="Simple load balancer factor for mod_cluster" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,*" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProvider" />
+ <c:simple-property name="nameTemplate" default="Simple Load Balancer Factor" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="loadBalanceFactor" type="integer" description="The load balance factor." />
+ </resource-configuration>
+ </service>
+
+ <service name="Load Metric" discovery="LoadMetricDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent" description="Load Metric">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,metric=*,*" />
+ <c:simple-property name="nameTemplate" default="Load Metric" />
+ </plugin-configuration>
+
+ <metric property="Load" displayName="Load" category="utilization" description="The current load of this metric as a percent of the metric's capacity." dataType="measurement" />
+
+ <resource-configuration>
+ <c:simple-property name="Weight" type="integer" description="The significance of this load metric compared to the other metrics." />
+ <c:simple-property name="Capacity" type="double" description="Used to normalize the value returned by load expressed as a percentage of the capacity, such that: 0 < (load/capacity) < 1" />
+ </resource-configuration>
+ </service>
+
+ <service name="Webapp Context" discovery="ContextDiscoveryComponent" class="ContextComponent" description="Webapp Context">
+
+ <operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation." />
+ </results>
+ </operation>
+ <operation name="stopContext" displayName="Stop webapp" description="Gracefully stops this webapp.">
<parameters>
- <c:simple-property required="true" name="timeout" type="integer" displayName="Session draining timeout"/>
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
- <c:property-options allowCustomValue="false">
- <c:option value="MICROSECONDS" name="MICROSECONDS"/>
- <c:option value="MILLISECONDS" name="MILLISECONDS"/>
- <c:option value="NANOSECONDS" name="NANOSECONDS"/>
- <c:option value="SECONDS" name="SECONDS"/>
- <c:option value="HOURS" name="HOURS"/>
- <c:option value="DAYS" name="DAYS"/>
- </c:property-options>
- </c:simple-property>
+ <c:simple-property required="true" name="timeout" type="integer" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
</parameters>
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
- <operation name="enableContext" displayName="Enable webapp" description="Enable this webapp.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enableContext" displayName="Enable webapp" description="Enable this webapp.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
</service>
</service>
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
new file mode 100644
index 0000000..4e4aac1
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -0,0 +1,58 @@
+/*
+ * 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.plugins.modcluster.test;
+
+import org.testng.annotations.Test;
+
+import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
+
+public class ServerConfigTest {
+
+ @Test
+ public void TestConfig() {
+
+ try {
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService");
+ config.setPropertyValue("processStatusFrequency", "4");
+ config.setPropertyValue("test", "5");
+ config.setPropertyValue("test", "123");
+
+ System.out.println(config.getPropertyValue("test"));
+
+ config.saveConfigFile();
+
+ config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
+ "org.jboss.modcluster.config.ha.HAModClusterConfig");
+ config.setPropertyValue("processStatusFrequency", "4");
+ config.setPropertyValue("test", "5");
+ config.setPropertyValue("test", "123");
+
+ System.out.println(config.getPropertyValue("test"));
+
+ config.saveConfigFile();
+
+ config.setPropertyValue("test", null);
+ config.saveConfigFile();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
commit 9b57c3ef1e1bc0ee5f88968f4ee32693be048eb3
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 14 12:03:44 2011 -0500
With JBoss 5, the timeout is blocking the operation call for the period set. Reduce this period for these integration tests.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index dc98d78..0a39eab 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -168,7 +168,7 @@ public class ModclusterPluginTest {
log.info("Result of operation " + "enableContext" + " was: " + result.getSimpleResult());
Configuration config = new Configuration();
- config.put(new PropertySimple("timeout", "1000"));
+ config.put(new PropertySimple("timeout", "1"));
config.put(new PropertySimple("unit", java.util.concurrent.TimeUnit.SECONDS));
result = ((OperationFacet) resourceComponent).invokeOperation("stopContext", config);
log.info("Result of operation stopContext was: " + result.getSimpleResult());
commit 273a8701e0e62f907a3c92fbf9bc47aa5d02c51d
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 14 12:02:34 2011 -0500
Add jar dependencies for testing with JBoss 5&6.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
index 0cc3f4f..77a81b2 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/pom.xml
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -17,9 +17,37 @@
<properties>
<scm.module.path>modules/integration-tests/mod_cluster-plugin-test</scm.module.path>
+ <!-- jbossas.version>6.0.0.20100429-M3</jbossas.version-->
+ <jbossas.version>6.0.0.M1</jbossas.version>
+
</properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-parent</artifactId>
+ <version>${jbossas.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-component-matrix</artifactId>
+ <version>${jbossas.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
<dependencies>
+
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-profileservice-spi</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>${rhq.groupId}</groupId>
@@ -41,6 +69,213 @@
<version>1.2.14</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.naming</groupId>
+ <artifactId>jnp-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-aspects</artifactId>
+ <version>5.1.0.CR1</version>
+ <classifier>jboss-aspect-jdk50-client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>trove</groupId>
+ <artifactId>trove</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-security-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-javaee</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <dependency>
+ <groupId>oswego-concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <version>1.3.4-jboss</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-server</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <!-- dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-security</artifactId>
+ <version>5.1.0.CR1</version>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-transaction-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-common</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-core</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-ext-api</artifactId>
+ <version>1.0.0</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-proxy-spi</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-proxy-impl</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-security</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <!-- dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbosssx-client</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <dependency>
+ <groupId>org.jboss.aspects</groupId>
+ <artifactId>jboss-security-aspects</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-serialization</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-profileservice</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-server</artifactId>
+ <classifier>jmx-invoker-adaptor-client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>jboss.messaging</groupId>
+ <artifactId>jboss-messaging-client</artifactId>
+ <scope>test</scope>
+ </dependency-->
</dependencies>
commit 324454e90750968aeaee52480f10cef156ac3178
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Aug 10 18:04:02 2011 -0500
Get the integration tests to compile and run again by creating the maven module and deploying the correct resources to target folder.
diff --git a/.classpath b/.classpath
index cb9d57f..93a80cc 100644
--- a/.classpath
+++ b/.classpath
@@ -282,5 +282,6 @@
<classpathentry kind="src" path="modules/plugins/jboss-as-7/src/main/java"/>
<classpathentry kind="src" path="modules/plugins/jboss-as-7/src/test/java"/>
<classpathentry kind="src" path="modules/integration-tests/jboss-as-7-plugin-test/src/test/java"/>
+ <classpathentry kind="src" path="modules/integration-tests/mod_cluster-plugin-test/src/test/java"/>
<classpathentry kind="output" path="eclipse-classes"/>
</classpath>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
new file mode 100644
index 0000000..0cc3f4f
--- /dev/null
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -0,0 +1,155 @@
+<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-plugins-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>modcluster-plugin-test</artifactId>
+ <packaging>jar</packaging>
+
+ <name>RHQ mod_cluster Plugin Integration Test</name>
+ <description>Integration tests for mod_cluster RHQ Agent plugin</description>
+
+ <properties>
+ <scm.module.path>modules/integration-tests/mod_cluster-plugin-test</scm.module.path>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-jmx-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>modcluster-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+
+ <profile>
+ <id>integration-tests</id>
+ <activation>
+ <property>
+ <name>maven.test.skip</name>
+ <value>!true</value>
+ </property>
+ </activation>
+
+ <properties>
+ <rhq.rootDir>../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <tasks>
+ <echo>Setting up plugin dependencies...</echo>
+ <property name="settings.localRepository" location="${user.home}/.m2/repository" />
+ <mkdir dir="target/testsetup" />
+
+ <mkdir dir="target/testsetup/plugins" />
+ <copy toDir="target/testsetup/plugins" flatten="true">
+ <fileset dir="${settings.localRepository}/">
+ <include name="org/rhq/rhq-platform-plugin/${project.version}/rhq-platform-plugin-${project.version}.jar" />
+ <include name="org/rhq/rhq-jmx-plugin/${project.version}/rhq-jmx-plugin-${project.version}.jar" />
+ <include name="org/jboss/on/jopr-jboss-as-plugin/${project.version}/jopr-jboss-as-plugin-${project.version}.jar" />
+ <include name="org/jboss/on/jopr-jboss-as-5-plugin/${project.version}/jopr-jboss-as-5-plugin-${project.version}.jar" />
+ <include name="org/rhq/modcluster-plugin/${project.version}/modcluster-plugin-${project.version}.jar" />
+ </fileset>
+ <fileset dir="${rhq.deploymentDir}">
+ <include name="${project.artifactId}-${project.version}.jar" />
+ </fileset>
+ </copy>
+
+ <mkdir dir="target/testsetup/lib" />
+ <unzip dest="target/testsetup/lib">
+ <fileset dir="${settings.localRepository}/org/hyperic/sigar-dist/${sigar.version}" includes="*.zip" />
+ <patternset>
+ <include name="**/lib/sigar.jar" />
+ <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="target/testsetup/lib" flatten="true">
+ <fileset dir="target/testsetup/lib">
+ <include name="**/lib/*" />
+ </fileset>
+ </move>
+ <delete dir="target/testsetup/lib/hyperic-sigar-${sigar.version}" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${maven.test.skip}</skip>
+ <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
+ <useSystemClassLoader>false</useSystemClassLoader>
+ <argLine>-Dorg.hyperic.sigar.path=${basedir}/target/testsetup/lib</argLine>
+ <systemProperties>
+ <property>
+ <name>project.artifactId</name>
+ <value>${project.artifactId}</value>
+ </property>
+ <property>
+ <name>project.version</name>
+ <value>${project.version}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index 0f644fc..dc98d78 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -148,10 +148,12 @@ public class ModclusterPluginTest {
}
if (resourceComponent instanceof OperationFacet) {
- OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("reset", null);
+ OperationResult result = null;
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("reset", new Configuration());
log.info("Result of operation test was: " + result);
- result = ((OperationFacet) resourceComponent).invokeOperation("disable", null);
+ result = ((OperationFacet) resourceComponent).invokeOperation("disable", new Configuration());
log.info("Result of operation test was: " + result.getSimpleResult());
}
}
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index ab52e84..fdc4f37 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -56,51 +56,6 @@
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
- <execution>
- <phase>process-test-resources</phase>
- <configuration>
- <tasks>
- <echo>Setting up plugin dependencies...</echo>
- <property name="settings.localRepository" location="${user.home}/.m2/repository" />
- <mkdir dir="target/testsetup" />
-
- <mkdir dir="target/testsetup/plugins" />
- <copy toDir="target/testsetup/plugins" flatten="true">
- <fileset dir="${settings.localRepository}/">
- <include name="org/rhq/rhq-platform-plugin/${project.version}/rhq-platform-plugin-${project.version}.jar" />
- <include name="org/rhq/rhq-jmx-plugin/${project.version}/rhq-jmx-plugin-${project.version}.jar" />
- <include name="org/jboss/on/jopr-jboss-as-plugin/${project.version}/jopr-jboss-as-plugin-${project.version}.jar" />
- <include name="org/jboss/on/jopr-jboss-as-5-plugin/${project.version}/jopr-jboss-as-5-plugin-${project.version}.jar" />
- </fileset>
- <fileset dir="${rhq.deploymentDir}">
- <include name="${project.artifactId}-${project.version}.jar" />
- </fileset>
- </copy>
-
- <mkdir dir="target/testsetup/lib" />
- <unzip dest="target/testsetup/lib">
- <fileset dir="${settings.localRepository}/org/hyperic/sigar-dist/${sigar.version}" includes="*.zip" />
- <patternset>
- <include name="**/lib/sigar.jar" />
- <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="target/testsetup/lib" flatten="true">
- <fileset dir="target/testsetup/lib">
- <include name="**/lib/*" />
- </fileset>
- </move>
- <delete dir="target/testsetup/lib/hyperic-sigar-${sigar.version}" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
<execution>
<id>deploy</id>
@@ -203,12 +158,10 @@
<build>
<plugins>
-
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
-
<execution>
<id>deploy</id>
<phase>compile</phase>
@@ -258,14 +211,10 @@
<goal>run</goal>
</goals>
</execution>
-
</executions>
</plugin>
-
</plugins>
</build>
</profile>
-
</profiles>
-
</project>
commit 0b63dbefbc9f88145a8012a3677af665b41b13f7
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 00:14:01 2011 -0500
Small refactoring and code formating change to make the class easier to read and understand.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 6abf955..8cff302 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -75,6 +75,7 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
*/
public void setPropertyValue(String propertyName, String value) {
boolean propertyFound = false;
+
for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
Node currentNode = beanNode.getChildNodes().item(i);
@@ -107,8 +108,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
public String getPropertyValue(String propertyName) {
- for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
- Node currentNode = beanNode.getChildNodes().item(i);
+ NodeList nodeList = beanNode.getChildNodes();
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node currentNode = nodeList.item(i);
if (currentNode.getNodeName().equals("property")
&& currentNode.getAttributes().getNamedItem("name") != null
@@ -126,10 +129,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
private Node getBeanNodeByClass(String className) {
- NodeList result = this.getDocument().getElementsByTagName("bean");
+ NodeList nodeList = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
- for (int i = 1; i < result.getLength(); i++) {
- Node node = result.item(i);
if (node.getAttributes().getNamedItem("class") != null
&& className.equals(node.getAttributes().getNamedItem("class").getTextContent())) {
return node;
@@ -144,10 +148,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
private Node getBeanNodeByName(String beanName) {
- NodeList result = this.getDocument().getElementsByTagName("bean");
+ NodeList nodeList = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
- for (int i = 1; i < result.getLength(); i++) {
- Node node = result.item(i);
if (node.getAttributes().getNamedItem("name") != null
&& beanName.equals(node.getAttributes().getNamedItem("name").getTextContent())) {
return node;
@@ -163,17 +168,17 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @return
*/
private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
- List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
+ List<Node> nodeList = this.getChildrenNodesByName(beanNode, "constructor");
- if (tempNodeList.size() > 0) {
- Node constructorNode = tempNodeList.get(0);
+ if (nodeList.size() > 0) {
+ Node constructorNode = nodeList.get(0);
- tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
+ nodeList = this.getChildrenNodesByName(constructorNode, "parameter");
- if (tempNodeList.size() > 0) {
+ if (nodeList.size() > 0) {
Node parameterNode = null;
- for (Node currentNode : tempNodeList) {
+ for (Node currentNode : nodeList) {
if (currentNode.getAttributes().getNamedItem("class") != null
&& constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
.getTextContent())) {
@@ -183,10 +188,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
}
if (parameterNode != null) {
- tempNodeList = this.getChildNodesByName(parameterNode, "inject");
+ nodeList = this.getChildrenNodesByName(parameterNode, "inject");
- if (tempNodeList.size() > 0) {
- Node injectNode = tempNodeList.get(0);
+ if (nodeList.size() > 0) {
+ Node injectNode = nodeList.get(0);
Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
if (beanAttribute != null) {
@@ -205,17 +210,17 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
* @param nodeName
* @return
*/
- private List<Node> getChildNodesByName(Node node, String nodeName) {
- List<Node> listOfNodes = new ArrayList<Node>();
+ private List<Node> getChildrenNodesByName(Node node, String nodeName) {
+ List<Node> nodeList = new ArrayList<Node>();
for (int i = 0; i < node.getChildNodes().getLength(); i++) {
Node currentNode = node.getChildNodes().item(i);
if (nodeName.equals(currentNode.getNodeName())) {
- listOfNodes.add(currentNode);
+ nodeList.add(currentNode);
}
}
- return listOfNodes;
+ return nodeList;
}
}
commit 7d543559bf07e87dd707fac16e0d1dc8f63b2815
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Aug 25 00:12:49 2011 -0500
Added the proxyInfo metric back to Catalina service context since it is readly available.
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 6f46849..3e523f7 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -374,6 +374,7 @@
</operation>
<metric property="proxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="proxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
<metric property="modelerType" displayName="Type of the modeled resource" displayType="summary" dataType="trait" />
<metric property="className" displayName="Fully qualified class name of the managed object" displayType="summary" dataType="trait" />
<metric property="advertise" displayName="Enable autodiscovery of httpd servers." displayType="summary" dataType="trait" />
commit 676fc23804ccf42d8eb2ce236400bc08a4025f89
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Aug 24 11:18:01 2011 -0500
More updates to the naming of each plugin component to match the intent and purpose. Also updated the integration tests to test each resource type.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java
new file mode 100644
index 0000000..625163b
--- /dev/null
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModClusterPluginIntegrationTest.java
@@ -0,0 +1,229 @@
+/*
+ * 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.plugins.modcluster.test;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Queue;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import org.rhq.core.clientapi.server.discovery.InventoryReport;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.measurement.MeasurementData;
+import org.rhq.core.domain.measurement.MeasurementDefinition;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.core.pc.PluginContainerConfiguration;
+import org.rhq.core.pc.plugin.FileSystemPluginFinder;
+import org.rhq.core.pc.plugin.PluginEnvironment;
+import org.rhq.core.pc.plugin.PluginManager;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/**
+ * @author Stefan Negrea
+ */
+@SuppressWarnings("rawtypes")
+@Test(groups = "modcluster-plugin")
+public class ModClusterPluginIntegrationTest {
+ private Log log = LogFactory.getLog(this.getClass());
+ private static final String PLUGIN_NAME = "mod_cluster";
+
+ @BeforeSuite
+ public void start() {
+ try {
+ File pluginDir = new File("target/testsetup/plugins");
+ PluginContainerConfiguration pcConfig = new PluginContainerConfiguration();
+ pcConfig.setPluginFinder(new FileSystemPluginFinder(pluginDir));
+ pcConfig.setPluginDirectory(pluginDir);
+
+ pcConfig.setInsideAgent(false);
+ PluginContainer.getInstance().setConfiguration(pcConfig);
+ PluginContainer.getInstance().initialize();
+ log.info("PC started.");
+ for (String plugin : PluginContainer.getInstance().getPluginManager().getMetadataManager().getPluginNames()) {
+ log.info("...Loaded plugin: " + plugin);
+ }
+ } catch (Exception e) {
+ log.info("Error initializing the context", e);
+ }
+ }
+
+ @AfterSuite
+ public void stop() {
+ PluginContainer.getInstance().shutdown();
+ }
+
+ @Test
+ public void testPluginLoad() {
+ PluginManager pluginManager = PluginContainer.getInstance().getPluginManager();
+ PluginEnvironment pluginEnvironment = pluginManager.getPlugin(PLUGIN_NAME);
+ assert (pluginEnvironment != null) : "Null environment, plugin not loaded";
+ assert (pluginEnvironment.getPluginName().equals(PLUGIN_NAME));
+ }
+
+ @Test(dependsOnMethods = "testPluginLoad")
+ public void testDiscovery() throws Exception {
+ InventoryReport report = PluginContainer.getInstance().getInventoryManager().executeServerScanImmediately();
+ assert report != null;
+ log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
+
+ Thread.sleep(1000);
+
+ report = PluginContainer.getInstance().getInventoryManager().executeServiceScanImmediately();
+ assert report != null;
+ log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
+
+ Set<Resource> resources = findResource(PluginContainer.getInstance().getInventoryManager().getPlatform());
+ log.info("Found " + resources.size() + " mod_cluster and mod_cluster_context instance(s).");
+
+ assert (resources.size() != 0) : "No mod_cluster or related instances found.";
+
+ if (resources.size() != 0) {
+ for (Object objectResource : resources.toArray()) {
+ Resource resource = (Resource) objectResource;
+ if (resource.getResourceType().getName().equals("mod_cluster")) {
+ testMainResource(resource);
+ } else if (resource.getResourceType().getName().equals("Webapp Context")) {
+ testWebappContext(resource);
+ } else if (resource.getResourceType().getName().equals("HA Service Configuration")) {
+ testLoadServiceConfiguration(resource);
+ } else if (resource.getResourceType().getName().equals("HA Service")) {
+ testServiceMeasurement(resource);
+ testServiceMethodInvocation(resource);
+ }
+ }
+ }
+ }
+
+ private void testServiceMethodInvocation(Resource resource) throws InterruptedException, Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ Configuration config = new Configuration();
+ config.put(new PropertySimple("p1", "1"));
+ config.put(new PropertySimple("p2", java.util.concurrent.TimeUnit.SECONDS));
+ OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("stop", config);
+ log.info("Result of operation stopContext was: " + result.getSimpleResult());
+ }
+
+ private void testLoadServiceConfiguration(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+ ((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
+ }
+
+ private void testServiceMeasurement(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ if (resourceComponent instanceof MeasurementFacet) {
+ for (MeasurementDefinition def : resource.getResourceType().getMetricDefinitions()) {
+ Set<MeasurementScheduleRequest> metricList = new HashSet<MeasurementScheduleRequest>();
+ metricList.add(new MeasurementScheduleRequest(1, def.getName(), 1000, true, def.getDataType(), null));
+ MeasurementReport report = new MeasurementReport();
+ ((MeasurementFacet) resourceComponent).getValues(report, metricList);
+
+ MeasurementData data = report.getTraitData().iterator().next();
+ assert data != null : "Unable to collect trait [" + def.getName() + "] on " + resource;
+ log.info("Measurement: " + def.getName() + "=" + data.getValue());
+ }
+ }
+ }
+
+ private void testMainResource(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ if (resourceComponent instanceof OperationFacet) {
+ OperationResult result = null;
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("reset", new Configuration());
+ log.info("Result of operation test was: " + result);
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("refresh", new Configuration());
+ log.info("Result of operation test was: " + result);
+ }
+ }
+
+ private void testWebappContext(Resource resource) throws Exception {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ if (resourceComponent instanceof OperationFacet) {
+ try {
+ OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
+ log.info("Result of operation " + "enableContext" + " was: " + result.getSimpleResult());
+
+ Configuration config = new Configuration();
+ config.put(new PropertySimple("timeout", "1"));
+ config.put(new PropertySimple("unit", java.util.concurrent.TimeUnit.SECONDS));
+ result = ((OperationFacet) resourceComponent).invokeOperation("stopContext", config);
+ log.info("Result of operation stopContext was: " + result.getSimpleResult());
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
+ log.info("Result of operation enableContext was: " + result.getSimpleResult());
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("disableContext", null);
+ log.info("Result of operation disableContext was: " + result.getSimpleResult());
+
+ } catch (Exception e) {
+ log.info("Operation failed. ", e);
+ }
+
+ }
+ }
+
+ private Set<Resource> findResource(Resource parent) {
+ Set<Resource> found = new HashSet<Resource>();
+
+ Queue<Resource> discoveryQueue = new LinkedList<Resource>();
+ discoveryQueue.add(parent);
+
+ while (!discoveryQueue.isEmpty()) {
+ Resource currentResource = discoveryQueue.poll();
+
+ log.info("Discovered resource of type: " + currentResource.getResourceType().getName());
+ if (currentResource.getResourceType().getPlugin().equals(PLUGIN_NAME)) {
+ found.add(currentResource);
+ }
+
+ if (currentResource.getChildResources() != null) {
+ for (Resource child : currentResource.getChildResources()) {
+ discoveryQueue.add(child);
+ }
+ }
+ }
+
+ return found;
+ }
+}
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
deleted file mode 100644
index f27b153..0000000
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ /dev/null
@@ -1,228 +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.plugins.modcluster.test;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Queue;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.testng.annotations.AfterSuite;
-import org.testng.annotations.BeforeSuite;
-import org.testng.annotations.Test;
-
-import org.rhq.core.clientapi.server.discovery.InventoryReport;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.measurement.MeasurementData;
-import org.rhq.core.domain.measurement.MeasurementDefinition;
-import org.rhq.core.domain.measurement.MeasurementReport;
-import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.pc.PluginContainer;
-import org.rhq.core.pc.PluginContainerConfiguration;
-import org.rhq.core.pc.plugin.FileSystemPluginFinder;
-import org.rhq.core.pc.plugin.PluginEnvironment;
-import org.rhq.core.pc.plugin.PluginManager;
-import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
-import org.rhq.core.pluginapi.inventory.ResourceComponent;
-import org.rhq.core.pluginapi.measurement.MeasurementFacet;
-import org.rhq.core.pluginapi.operation.OperationFacet;
-import org.rhq.core.pluginapi.operation.OperationResult;
-
-/**
- * @author Stefan Negrea
- */
-@SuppressWarnings("rawtypes")
-@Test(groups = "modcluster-plugin")
-public class ModclusterPluginTest {
- private Log log = LogFactory.getLog(this.getClass());
- private static final String PLUGIN_NAME = "mod_cluster";
-
- @BeforeSuite
- public void start() {
- try {
- File pluginDir = new File("target/testsetup/plugins");
- PluginContainerConfiguration pcConfig = new PluginContainerConfiguration();
- pcConfig.setPluginFinder(new FileSystemPluginFinder(pluginDir));
- pcConfig.setPluginDirectory(pluginDir);
-
- pcConfig.setInsideAgent(false);
- PluginContainer.getInstance().setConfiguration(pcConfig);
- PluginContainer.getInstance().initialize();
- log.info("PC started.");
- for (String plugin : PluginContainer.getInstance().getPluginManager().getMetadataManager().getPluginNames()) {
- log.info("...Loaded plugin: " + plugin);
- }
- } catch (Exception e) {
- log.info("Error initializing the context", e);
- }
- }
-
- @AfterSuite
- public void stop() {
- PluginContainer.getInstance().shutdown();
- }
-
- @Test
- public void testPluginLoad() {
- PluginManager pluginManager = PluginContainer.getInstance().getPluginManager();
- PluginEnvironment pluginEnvironment = pluginManager.getPlugin(PLUGIN_NAME);
- assert (pluginEnvironment != null) : "Null environment, plugin not loaded";
- assert (pluginEnvironment.getPluginName().equals(PLUGIN_NAME));
- }
-
- @Test(dependsOnMethods = "testPluginLoad")
- public void testDiscovery() throws Exception {
- InventoryReport report = PluginContainer.getInstance().getInventoryManager().executeServerScanImmediately();
- assert report != null;
- log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
-
- Thread.sleep(1000);
-
- report = PluginContainer.getInstance().getInventoryManager().executeServiceScanImmediately();
- assert report != null;
- log.info("Discovery took: " + (report.getEndTime() - report.getStartTime()) + "ms");
-
- List<String> typeNames = new ArrayList<String>() {
- private static final long serialVersionUID = 1L;
-
- {
- add(PLUGIN_NAME);
- add("Webapp Context");
- add("HA Service Configuration");
- add("HA Service");
- }
- };
-
- Set<Resource> resources = findResource(PluginContainer.getInstance().getInventoryManager().getPlatform(),
- typeNames);
- log.info("Found " + resources.size() + " mod_cluster and mod_cluster_context instance(s).");
-
- assert (resources.size() != 0) : "No mod_cluster or related instances found.";
-
- if (resources.size() != 0) {
- for (Object objectResource : resources.toArray()) {
- Resource resource = (Resource) objectResource;
- if (resource.getResourceType().getName().equals("mod_cluster")) {
- testResourceMeasurement(resource);
- } else if (resource.getResourceType().getName().equals("Webapp Context")) {
- testContextOperations(resource);
- } else if (resource.getResourceType().getName().equals("HA Service Configuration")) {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
- ((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
- } else if (resource.getResourceType().getName().equals("HA Service")) {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
-
- Configuration config = new Configuration();
- config.put(new PropertySimple("p1", "1"));
- config.put(new PropertySimple("p2", java.util.concurrent.TimeUnit.SECONDS));
- OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("stop", config);
- log.info("Result of operation stopContext was: " + result.getSimpleResult());
- }
- }
- }
- }
-
- private void testResourceMeasurement(Resource resource) throws Exception {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
- if (resourceComponent instanceof MeasurementFacet) {
- for (MeasurementDefinition def : resource.getResourceType().getMetricDefinitions()) {
- Set<MeasurementScheduleRequest> metricList = new HashSet<MeasurementScheduleRequest>();
- metricList.add(new MeasurementScheduleRequest(1, def.getName(), 1000, true, def.getDataType(), null));
- MeasurementReport report = new MeasurementReport();
- ((MeasurementFacet) resourceComponent).getValues(report, metricList);
-
- MeasurementData data = report.getTraitData().iterator().next();
- assert data != null : "Unable to collect trait [" + def.getName() + "] on " + resource;
- log.info("Measurement: " + def.getName() + "=" + data.getValue());
- }
- }
-
- if (resourceComponent instanceof OperationFacet) {
- OperationResult result = null;
-
- result = ((OperationFacet) resourceComponent).invokeOperation("reset", new Configuration());
- log.info("Result of operation test was: " + result);
-
- result = ((OperationFacet) resourceComponent).invokeOperation("disable", new Configuration());
- log.info("Result of operation test was: " + result.getSimpleResult());
- }
- }
-
- private void testContextOperations(Resource resource) throws Exception {
- ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
- .getResourceComponent(resource);
-
- if (resourceComponent instanceof OperationFacet) {
- try {
- OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
- log.info("Result of operation " + "enableContext" + " was: " + result.getSimpleResult());
-
- Configuration config = new Configuration();
- config.put(new PropertySimple("timeout", "1"));
- config.put(new PropertySimple("unit", java.util.concurrent.TimeUnit.SECONDS));
- result = ((OperationFacet) resourceComponent).invokeOperation("stopContext", config);
- log.info("Result of operation stopContext was: " + result.getSimpleResult());
-
- result = ((OperationFacet) resourceComponent).invokeOperation("enableContext", null);
- log.info("Result of operation enableContext was: " + result.getSimpleResult());
-
- result = ((OperationFacet) resourceComponent).invokeOperation("disableContext", null);
- log.info("Result of operation disableContext was: " + result.getSimpleResult());
-
- } catch (Exception e) {
- log.info("Operation failed. ", e);
- }
-
- }
- }
-
- private Set<Resource> findResource(Resource parent, List<String> typeNames) {
- Set<Resource> found = new HashSet<Resource>();
-
- Queue<Resource> discoveryQueue = new LinkedList<Resource>();
- discoveryQueue.add(parent);
-
- while (!discoveryQueue.isEmpty()) {
- Resource currentResource = discoveryQueue.poll();
-
- log.info("Discovered resource of type: " + currentResource.getResourceType().getName());
- if (typeNames.contains(currentResource.getResourceType().getName())) {
- found.add(currentResource);
- }
-
- if (currentResource.getChildResources() != null) {
- for (Resource child : currentResource.getChildResources()) {
- discoveryQueue.add(child);
- }
- }
- }
-
- return found;
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
index b9ce25e..b854398 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
@@ -89,7 +89,7 @@ public class ClassNameMBeanDiscoveryComponent<T extends JMXComponent> extends MB
emsConnection.queryBeans(objectName);
bean = emsConnection.getBean(objectName);
}
+
return bean;
}
-
-}
\ No newline at end of file
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
deleted file mode 100644
index 4c8b437..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ /dev/null
@@ -1,116 +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.plugins.modcluster;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.mc4j.ems.connection.bean.EmsBean;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.pluginapi.operation.OperationResult;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-import org.rhq.plugins.modcluster.helper.JBossHelper;
-
-/**
- * Manages a mod_cluster context entity.
- *
- * @author Stefan Negrea
- */
-@SuppressWarnings({ "rawtypes", "deprecation" })
-public class ContextComponent extends MBeanResourceComponent<MBeanResourceComponent> {
-
- private static final Log log = LogFactory.getLog(ContextComponent.class);
-
- @Override
- protected EmsBean loadBean() {
- return getResourceContext().getParentResourceComponent().getEmsBean();
- }
-
- @Override
- public AvailabilityType getAvailability() {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
- String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
-
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
-
- ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
-
- int indexOfCurrentContext = proxyInfo.getAvailableContexts().indexOf(context);
-
- if (indexOfCurrentContext != -1) {
- ProxyInfo.Context currentContext = proxyInfo.getAvailableContexts().get(indexOfCurrentContext);
-
- if (currentContext.isEnabled()) {
- return AvailabilityType.UP;
- }
- }
-
- return AvailabilityType.DOWN;
- } catch (Exception e) {
- log.info(e);
- return AvailabilityType.DOWN;
- } finally {
- Thread.currentThread().setContextClassLoader(cl);
- }
- }
-
- @Override
- public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
- if ("enableContext".equals(name) || "disableContext".equals(name) || "stopContext".equals(name)) {
-
- ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
-
- Object[] configuration = null;
- if ("stopContext".equals(name)) {
- configuration = new Object[] { context.getHost(), context.getPath(),
- parameters.getSimple("timeout").getLongValue(),
- TimeUnit.valueOf(parameters.getSimple("unit").getStringValue()) };
- } else {
- configuration = new Object[] { context.getHost(), context.getPath() };
- }
-
- if (context.getPath().equals("/")) {
- configuration[1] = "ROOT";
- }
-
- log.info(name + " - " + context.getHost() + " " + context.getPath());
-
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
- Object resultObject = getEmsBean().getOperation(name).invoke(configuration);
-
- if (resultObject instanceof OperationResult) {
- return (OperationResult) resultObject;
- } else {
- return new OperationResult(String.valueOf(resultObject));
- }
- } finally {
- Thread.currentThread().setContextClassLoader(cl);
- }
- }
-
- throw new Exception("Operation " + name + " not available mod_cluster WebApp service.");
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
deleted file mode 100644
index 788cbce..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
+++ /dev/null
@@ -1,104 +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.plugins.modcluster;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.mc4j.ems.connection.EmsConnection;
-import org.mc4j.ems.connection.bean.EmsBean;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-import org.rhq.plugins.modcluster.helper.JBossHelper;
-
-/**
- * Discovers mod_cluster contexts from the proxyInfo mbean property.
- *
- * @author Stefan Negrea
- */
-@SuppressWarnings("rawtypes")
-public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBeanResourceComponent> {
-
- private static final String JVM_ROUTE_PROPERTY = "jvmRoute";
- private static final String ENGINE_OBJECT_NAME = "engineObjectName";
-
- /* (non-Javadoc)
- * @see org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext)
- */
- public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent> context) {
- String jvmRoute = this.getJvmRoute(context);
-
- EmsBean configBean = context.getParentResourceComponent().getEmsBean();
- String rawProxyInfo = JBossHelper.getRawProxyInfo(configBean);
-
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
- Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();
-
- for (ProxyInfo.Context availableContext : proxyInfo.getAvailableContexts()) {
- if (availableContext.getJvmRoute().equals(jvmRoute)) {
- DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(),
- availableContext.createKey(), availableContext.createName(), null, "Webapp Context", null, null);
- entities.add(detail);
- }
- }
-
- return entities;
- }
-
- /**
- * Retrieves the jvm route for the node from the parent context.
- *
- * @param context the discovery context
- * @return node's jvm route
- */
- private String getJvmRoute(ResourceDiscoveryContext<MBeanResourceComponent> context) {
- Configuration pluginConfig = context.getParentResourceComponent().getResourceContext().getPluginConfiguration();
- String engineObjectName = pluginConfig.getSimple(ENGINE_OBJECT_NAME).getStringValue();
- EmsBean engineBean = this.loadBean(engineObjectName, context.getParentResourceComponent());
-
- return (String) engineBean.getAttribute(JVM_ROUTE_PROPERTY).refresh().toString();
- }
-
- /**
- * Loads the bean with the given object name.
- *
- * Subclasses are free to override this method in order to load the bean.
- *
- * @param objectName the name of the bean to load
- * @return the bean that is loaded
- */
- protected EmsBean loadBean(String objectName, MBeanResourceComponent context) {
- EmsConnection emsConnection = context.getEmsConnection();
- EmsBean bean = emsConnection.getBean(objectName);
- if (bean == null) {
- // In some cases, this resource component may have been discovered by some means other than querying its
- // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
- // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
- // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
- // bean before giving up.
- emsConnection.queryBeans(objectName);
- bean = emsConnection.getBean(objectName);
- }
- return bean;
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
index 7d5f0dc..0db722e 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
@@ -21,6 +21,7 @@ package org.rhq.plugins.modcluster;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.helper.JBossHelper;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
/**
* @author Stefan Negrea
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java
deleted file mode 100644
index 8614402..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ProxyInfo.java
+++ /dev/null
@@ -1,310 +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.plugins.modcluster;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Simple parser for the raw proxy information provided by mod_cluster.
- *
- * @author Stefan Negrea
- */
-public class ProxyInfo {
-
- private Map<String, Node> availableNodes = new HashMap<String, Node>();
- private Map<String, Vhost> availableVhosts = new HashMap<String, Vhost>();
- private List<Context> availableContexts = new ArrayList<ProxyInfo.Context>();
-
- public ProxyInfo(String rawProxyInfo) {
- parseNodes(rawProxyInfo);
- parseVhosts(rawProxyInfo);
- parseContexts(rawProxyInfo);
- }
-
- private void parseNodes(String rawProxyInfo) {
- Pattern nodePattern = Pattern.compile("Node:.*\n");
- Matcher nodeMatcher = nodePattern.matcher(rawProxyInfo);
- while (nodeMatcher.find()) {
- String rawNode = nodeMatcher.group();
- String[] nodePieces = rawNode.split(",");
-
- String identifier = nodePieces[0];
- identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
-
- String jvmRoute = nodePieces[1];
- jvmRoute = jvmRoute.substring(jvmRoute.indexOf(':') + 1).trim();
-
- availableNodes.put(identifier, new Node(jvmRoute, identifier));
- }
- }
-
- private void parseVhosts(String rawProxyInfo) {
- Pattern vhostPattern = Pattern.compile("Vhost:.*\n");
- Matcher vhostMatcher = vhostPattern.matcher(rawProxyInfo);
- while (vhostMatcher.find()) {
- String rawVhost = vhostMatcher.group();
- String[] vhostPieces = rawVhost.split(",");
-
- String identifier = vhostPieces[0].trim();
- identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
- identifier = identifier.substring(0, identifier.lastIndexOf(":"));
-
- String host = vhostPieces[1].trim();
- host = host.substring(host.indexOf(":") + 1).trim();
-
- availableVhosts.put(identifier, new Vhost(identifier, host));
- }
- }
-
- private void parseContexts(String rawProxyInfo) {
- Pattern contextPattern = Pattern.compile("Context:.*[\n|}]");
- Matcher contextMatcher = contextPattern.matcher(rawProxyInfo);
- while (contextMatcher.find()) {
- String rawContext = contextMatcher.group();
- String[] contextPieces = rawContext.split(",");
- String actualContext = contextPieces[1].substring(contextPieces[1].indexOf("/")).trim();
-
- String identifier = contextPieces[0];
- identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
- identifier = identifier.substring(0, identifier.lastIndexOf(":"));
-
- String nodeIdentifier = contextPieces[0];
- nodeIdentifier = nodeIdentifier.substring(nodeIdentifier.indexOf("[") + 1, nodeIdentifier.indexOf("]"));
- nodeIdentifier = nodeIdentifier.substring(0, nodeIdentifier.indexOf(":"));
- String jvmRoute = availableNodes.get(nodeIdentifier).getJvmRoute();
-
- String rawIsEnabled = contextPieces[2];
- rawIsEnabled = rawIsEnabled.substring(rawIsEnabled.indexOf(':') + 1).trim();
- boolean isEnabled = rawIsEnabled.equals("ENABLED") ? true : false;
-
- Vhost relatedVhost = availableVhosts.get(identifier);
-
- availableContexts.add(new Context(jvmRoute, relatedVhost.getHost(), actualContext, isEnabled));
- }
- }
-
- public List<Context> getAvailableContexts() {
- return Collections.unmodifiableList(availableContexts);
- }
-
- public List<Vhost> getAvailableVhosts() {
- return Collections.unmodifiableList(new ArrayList<Vhost>(availableVhosts.values()));
- }
-
- public List<Node> getAvailableNodes() {
- return Collections.unmodifiableList(new ArrayList<Node>(availableNodes.values()));
- }
-
- public static class Node {
- private String jvmRoute;
- private String nodeId;
-
- public Node(String jvmRoute, String nodeId) {
- this.jvmRoute = jvmRoute;
- this.nodeId = nodeId;
- }
-
- public String getNodeId() {
- return nodeId;
- }
-
- public String getJvmRoute() {
- return jvmRoute;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
- result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Node other = (Node) obj;
- if (jvmRoute == null) {
- if (other.jvmRoute != null)
- return false;
- } else if (!jvmRoute.equals(other.jvmRoute))
- return false;
- if (nodeId == null) {
- if (other.nodeId != null)
- return false;
- } else if (!nodeId.equals(other.nodeId))
- return false;
- return true;
- }
- }
-
- public static class Vhost {
- private String identifier;
- private String host;
-
- public Vhost(String identifier, String host) {
- this.identifier = identifier;
- this.host = host;
- }
-
- public String getIdentifier() {
- return identifier;
- }
-
- public String getHost() {
- return host;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((host == null) ? 0 : host.hashCode());
- result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Vhost other = (Vhost) obj;
- if (host == null) {
- if (other.host != null)
- return false;
- } else if (!host.equals(other.host))
- return false;
- if (identifier == null) {
- if (other.identifier != null)
- return false;
- } else if (!identifier.equals(other.identifier))
- return false;
- return true;
- }
- }
-
- public static class Context {
- private String path;
- private String host;
- private String jvmRoute;
- private boolean isEnabled;
-
- public Context(String jvmRoute, String host, String path) {
- this(jvmRoute, host, path, false);
- }
-
- public Context(String jvmRoute, String host, String path, boolean isEnabled) {
- this.jvmRoute = jvmRoute;
- this.host = host;
- this.path = path;
- this.isEnabled = isEnabled;
- }
-
- public String getPath() {
- return path;
- }
-
- public String getHost() {
- return host;
- }
-
- public String getJvmRoute() {
- return jvmRoute;
- }
-
- public boolean isEnabled() {
- return isEnabled;
- }
-
- public String createKey() {
- return jvmRoute + ":" + host + ":" + path;
- }
-
- public String createName() {
- return host + ":" + path;
- }
-
- @Override
- public String toString() {
- return createKey();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((host == null) ? 0 : host.hashCode());
- result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
- result = prime * result + ((path == null) ? 0 : path.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Context other = (Context) obj;
- if (host == null) {
- if (other.host != null)
- return false;
- } else if (!host.equals(other.host))
- return false;
- if (jvmRoute == null) {
- if (other.jvmRoute != null)
- return false;
- } else if (!jvmRoute.equals(other.jvmRoute))
- return false;
- if (path == null) {
- if (other.path != null)
- return false;
- } else if (!path.equals(other.path))
- return false;
- return true;
- }
-
- public static Context fromString(String stringRepresentation) throws Exception {
- String parts[] = stringRepresentation.trim().split(":");
- if (parts.length < 3) {
- throw new Exception("Parsing error. Not enough information to create a context.");
- }
-
- return new Context(parts[0], parts[1], parts[2]);
- }
- }
-}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java
new file mode 100644
index 0000000..6131578
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextComponent.java
@@ -0,0 +1,117 @@
+/*
+ * 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.plugins.modcluster;
+
+import java.util.concurrent.TimeUnit;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.operation.OperationResult;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
+
+/**
+ * Manages a mod_cluster context entity.
+ *
+ * @author Stefan Negrea
+ */
+@SuppressWarnings({ "rawtypes", "deprecation" })
+public class WebappContextComponent extends MBeanResourceComponent<MBeanResourceComponent> {
+
+ private static final Log log = LogFactory.getLog(WebappContextComponent.class);
+
+ @Override
+ protected EmsBean loadBean() {
+ return getResourceContext().getParentResourceComponent().getEmsBean();
+ }
+
+ @Override
+ public AvailabilityType getAvailability() {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
+
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+
+ ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
+
+ int indexOfCurrentContext = proxyInfo.getAvailableContexts().indexOf(context);
+
+ if (indexOfCurrentContext != -1) {
+ ProxyInfo.Context currentContext = proxyInfo.getAvailableContexts().get(indexOfCurrentContext);
+
+ if (currentContext.isEnabled()) {
+ return AvailabilityType.UP;
+ }
+ }
+
+ return AvailabilityType.DOWN;
+ } catch (Exception e) {
+ log.info(e);
+ return AvailabilityType.DOWN;
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+
+ @Override
+ public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
+ if ("enableContext".equals(name) || "disableContext".equals(name) || "stopContext".equals(name)) {
+
+ ProxyInfo.Context context = ProxyInfo.Context.fromString(resourceContext.getResourceKey());
+
+ Object[] configuration = null;
+ if ("stopContext".equals(name)) {
+ configuration = new Object[] { context.getHost(), context.getPath(),
+ parameters.getSimple("timeout").getLongValue(),
+ TimeUnit.valueOf(parameters.getSimple("unit").getStringValue()) };
+ } else {
+ configuration = new Object[] { context.getHost(), context.getPath() };
+ }
+
+ if (context.getPath().equals("/")) {
+ configuration[1] = "ROOT";
+ }
+
+ log.info(name + " - " + context.getHost() + " " + context.getPath());
+
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
+ Object resultObject = getEmsBean().getOperation(name).invoke(configuration);
+
+ if (resultObject instanceof OperationResult) {
+ return (OperationResult) resultObject;
+ } else {
+ return new OperationResult(String.valueOf(resultObject));
+ }
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+
+ throw new Exception("Operation " + name + " not available mod_cluster WebApp service.");
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java
new file mode 100644
index 0000000..559e1b6
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/WebappContextDiscoveryComponent.java
@@ -0,0 +1,105 @@
+/*
+ * 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.plugins.modcluster;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.mc4j.ems.connection.EmsConnection;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
+
+/**
+ * Discovers mod_cluster contexts from the proxyInfo mbean property.
+ *
+ * @author Stefan Negrea
+ */
+@SuppressWarnings("rawtypes")
+public class WebappContextDiscoveryComponent implements ResourceDiscoveryComponent<MBeanResourceComponent> {
+
+ private static final String JVM_ROUTE_PROPERTY = "jvmRoute";
+ private static final String ENGINE_OBJECT_NAME = "engineObjectName";
+
+ /* (non-Javadoc)
+ * @see org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext)
+ */
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent> context) {
+ String jvmRoute = this.getJvmRoute(context);
+
+ EmsBean configBean = context.getParentResourceComponent().getEmsBean();
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(configBean);
+
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();
+
+ for (ProxyInfo.Context availableContext : proxyInfo.getAvailableContexts()) {
+ if (availableContext.getJvmRoute().equals(jvmRoute)) {
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(),
+ availableContext.createKey(), availableContext.createName(), null, "Webapp Context", null, null);
+ entities.add(detail);
+ }
+ }
+
+ return entities;
+ }
+
+ /**
+ * Retrieves the jvm route for the node from the parent context.
+ *
+ * @param context the discovery context
+ * @return node's jvm route
+ */
+ private String getJvmRoute(ResourceDiscoveryContext<MBeanResourceComponent> context) {
+ Configuration pluginConfig = context.getParentResourceComponent().getResourceContext().getPluginConfiguration();
+ String engineObjectName = pluginConfig.getSimple(ENGINE_OBJECT_NAME).getStringValue();
+ EmsBean engineBean = this.loadBean(engineObjectName, context.getParentResourceComponent());
+
+ return (String) engineBean.getAttribute(JVM_ROUTE_PROPERTY).refresh().toString();
+ }
+
+ /**
+ * Loads the bean with the given object name.
+ *
+ * Subclasses are free to override this method in order to load the bean.
+ *
+ * @param objectName the name of the bean to load
+ * @return the bean that is loaded
+ */
+ protected EmsBean loadBean(String objectName, MBeanResourceComponent context) {
+ EmsConnection emsConnection = context.getEmsConnection();
+ EmsBean bean = emsConnection.getBean(objectName);
+ if (bean == null) {
+ // In some cases, this resource component may have been discovered by some means other than querying its
+ // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
+ // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
+ // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
+ // bean before giving up.
+ emsConnection.queryBeans(objectName);
+ bean = emsConnection.getBean(objectName);
+ }
+ return bean;
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java
new file mode 100644
index 0000000..9cedad5
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/model/ProxyInfo.java
@@ -0,0 +1,310 @@
+/*
+ * 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.plugins.modcluster.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Simple parser for the raw proxy information provided by mod_cluster.
+ *
+ * @author Stefan Negrea
+ */
+public class ProxyInfo {
+
+ private Map<String, Node> availableNodes = new HashMap<String, Node>();
+ private Map<String, Vhost> availableVhosts = new HashMap<String, Vhost>();
+ private List<Context> availableContexts = new ArrayList<ProxyInfo.Context>();
+
+ public ProxyInfo(String rawProxyInfo) {
+ parseNodes(rawProxyInfo);
+ parseVhosts(rawProxyInfo);
+ parseContexts(rawProxyInfo);
+ }
+
+ private void parseNodes(String rawProxyInfo) {
+ Pattern nodePattern = Pattern.compile("Node:.*\n");
+ Matcher nodeMatcher = nodePattern.matcher(rawProxyInfo);
+ while (nodeMatcher.find()) {
+ String rawNode = nodeMatcher.group();
+ String[] nodePieces = rawNode.split(",");
+
+ String identifier = nodePieces[0];
+ identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
+
+ String jvmRoute = nodePieces[1];
+ jvmRoute = jvmRoute.substring(jvmRoute.indexOf(':') + 1).trim();
+
+ availableNodes.put(identifier, new Node(jvmRoute, identifier));
+ }
+ }
+
+ private void parseVhosts(String rawProxyInfo) {
+ Pattern vhostPattern = Pattern.compile("Vhost:.*\n");
+ Matcher vhostMatcher = vhostPattern.matcher(rawProxyInfo);
+ while (vhostMatcher.find()) {
+ String rawVhost = vhostMatcher.group();
+ String[] vhostPieces = rawVhost.split(",");
+
+ String identifier = vhostPieces[0].trim();
+ identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
+ identifier = identifier.substring(0, identifier.lastIndexOf(":"));
+
+ String host = vhostPieces[1].trim();
+ host = host.substring(host.indexOf(":") + 1).trim();
+
+ availableVhosts.put(identifier, new Vhost(identifier, host));
+ }
+ }
+
+ private void parseContexts(String rawProxyInfo) {
+ Pattern contextPattern = Pattern.compile("Context:.*[\n|}]");
+ Matcher contextMatcher = contextPattern.matcher(rawProxyInfo);
+ while (contextMatcher.find()) {
+ String rawContext = contextMatcher.group();
+ String[] contextPieces = rawContext.split(",");
+ String actualContext = contextPieces[1].substring(contextPieces[1].indexOf("/")).trim();
+
+ String identifier = contextPieces[0];
+ identifier = identifier.substring(identifier.indexOf("[") + 1, identifier.indexOf("]"));
+ identifier = identifier.substring(0, identifier.lastIndexOf(":"));
+
+ String nodeIdentifier = contextPieces[0];
+ nodeIdentifier = nodeIdentifier.substring(nodeIdentifier.indexOf("[") + 1, nodeIdentifier.indexOf("]"));
+ nodeIdentifier = nodeIdentifier.substring(0, nodeIdentifier.indexOf(":"));
+ String jvmRoute = availableNodes.get(nodeIdentifier).getJvmRoute();
+
+ String rawIsEnabled = contextPieces[2];
+ rawIsEnabled = rawIsEnabled.substring(rawIsEnabled.indexOf(':') + 1).trim();
+ boolean isEnabled = rawIsEnabled.equals("ENABLED") ? true : false;
+
+ Vhost relatedVhost = availableVhosts.get(identifier);
+
+ availableContexts.add(new Context(jvmRoute, relatedVhost.getHost(), actualContext, isEnabled));
+ }
+ }
+
+ public List<Context> getAvailableContexts() {
+ return Collections.unmodifiableList(availableContexts);
+ }
+
+ public List<Vhost> getAvailableVhosts() {
+ return Collections.unmodifiableList(new ArrayList<Vhost>(availableVhosts.values()));
+ }
+
+ public List<Node> getAvailableNodes() {
+ return Collections.unmodifiableList(new ArrayList<Node>(availableNodes.values()));
+ }
+
+ public static class Node {
+ private String jvmRoute;
+ private String nodeId;
+
+ public Node(String jvmRoute, String nodeId) {
+ this.jvmRoute = jvmRoute;
+ this.nodeId = nodeId;
+ }
+
+ public String getNodeId() {
+ return nodeId;
+ }
+
+ public String getJvmRoute() {
+ return jvmRoute;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
+ result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Node other = (Node) obj;
+ if (jvmRoute == null) {
+ if (other.jvmRoute != null)
+ return false;
+ } else if (!jvmRoute.equals(other.jvmRoute))
+ return false;
+ if (nodeId == null) {
+ if (other.nodeId != null)
+ return false;
+ } else if (!nodeId.equals(other.nodeId))
+ return false;
+ return true;
+ }
+ }
+
+ public static class Vhost {
+ private String identifier;
+ private String host;
+
+ public Vhost(String identifier, String host) {
+ this.identifier = identifier;
+ this.host = host;
+ }
+
+ public String getIdentifier() {
+ return identifier;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((host == null) ? 0 : host.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Vhost other = (Vhost) obj;
+ if (host == null) {
+ if (other.host != null)
+ return false;
+ } else if (!host.equals(other.host))
+ return false;
+ if (identifier == null) {
+ if (other.identifier != null)
+ return false;
+ } else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+ }
+
+ public static class Context {
+ private String path;
+ private String host;
+ private String jvmRoute;
+ private boolean isEnabled;
+
+ public Context(String jvmRoute, String host, String path) {
+ this(jvmRoute, host, path, false);
+ }
+
+ public Context(String jvmRoute, String host, String path, boolean isEnabled) {
+ this.jvmRoute = jvmRoute;
+ this.host = host;
+ this.path = path;
+ this.isEnabled = isEnabled;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ public String getJvmRoute() {
+ return jvmRoute;
+ }
+
+ public boolean isEnabled() {
+ return isEnabled;
+ }
+
+ public String createKey() {
+ return jvmRoute + ":" + host + ":" + path;
+ }
+
+ public String createName() {
+ return host + ":" + path;
+ }
+
+ @Override
+ public String toString() {
+ return createKey();
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((host == null) ? 0 : host.hashCode());
+ result = prime * result + ((jvmRoute == null) ? 0 : jvmRoute.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Context other = (Context) obj;
+ if (host == null) {
+ if (other.host != null)
+ return false;
+ } else if (!host.equals(other.host))
+ return false;
+ if (jvmRoute == null) {
+ if (other.jvmRoute != null)
+ return false;
+ } else if (!jvmRoute.equals(other.jvmRoute))
+ return false;
+ if (path == null) {
+ if (other.path != null)
+ return false;
+ } else if (!path.equals(other.path))
+ return false;
+ return true;
+ }
+
+ public static Context fromString(String stringRepresentation) throws Exception {
+ String parts[] = stringRepresentation.trim().split(":");
+ if (parts.length < 3) {
+ throw new Exception("Parsing error. Not enough information to create a context.");
+ }
+
+ return new Context(parts[0], parts[1], parts[2]);
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 7e1a79f..6f46849 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -440,7 +440,7 @@
</resource-configuration>
</service>
- <service name="Webapp Context" discovery="ContextDiscoveryComponent" class="ContextComponent" description="Webapp Context">
+ <service name="Webapp Context" discovery="WebappContextDiscoveryComponent" class="WebappContextComponent" description="Webapp Context">
<operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
<results>
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java
index 625d8d4..ebadd86 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ProxyInfoTest.java
@@ -23,7 +23,7 @@ import java.io.InputStream;
import org.testng.annotations.Test;
-import org.rhq.plugins.modcluster.ProxyInfo;
+import org.rhq.plugins.modcluster.model.ProxyInfo;
/**
* @author Stefan Negrea
commit dee21cbe94b5d5befc5a087a74cc5884bea96ee4
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 23 16:12:11 2011 -0500
Renaming mod_cluster components to match their explicit purpose.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index 0a0a570..b87bfcd 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -30,14 +30,16 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
/**
* @author Stefan Negrea
*
*/
-@SuppressWarnings({ "deprecation" })
-public class FileConfiguredMBeanResourceComponent extends TimeUnitParamResourceComponent {
+@SuppressWarnings({ "deprecation", "rawtypes" })
+public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent<JMXComponent> {
private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java
new file mode 100644
index 0000000..d9da81c
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServiceComponent.java
@@ -0,0 +1,52 @@
+package org.rhq.plugins.modcluster;
+
+import java.util.concurrent.TimeUnit;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.
+ */
+
+/**
+ *
+ * @author Stefan Negrea
+ */
+public class ModClusterServiceComponent extends FileConfiguredMBeanResourceComponent {
+
+ @Override
+ public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
+ if (name.toLowerCase().startsWith("ping")) {
+ name = "ping";
+ }
+
+ return super.invokeOperation(name, parameters);
+ }
+
+ @Override
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ System.out.println(typeName);
+ if (typeName.equals(TimeUnit.class.getName())) {
+ return TimeUnit.valueOf(propSimple.getStringValue());
+ }
+
+ return super.getPropertyValueAsType(propSimple, typeName);
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
deleted file mode 100644
index c67bf61..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.rhq.plugins.modcluster;
-
-import java.util.concurrent.TimeUnit;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.pluginapi.operation.OperationResult;
-
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2009 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.
- */
-
-/**
- *
- * @author Stefan Negrea
- */
-public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceComponent {
-
- @Override
- public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
- if (name.toLowerCase().startsWith("ping")) {
- name = "ping";
- }
-
- return super.invokeOperation(name, parameters);
- }
-
- @Override
- protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
- System.out.println(typeName);
- if (typeName.equals(TimeUnit.class.getName())) {
- return TimeUnit.valueOf(propSimple.getStringValue());
- }
-
- return super.getPropertyValueAsType(propSimple, typeName);
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
deleted file mode 100644
index 0296eaf..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2009 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.plugins.modcluster;
-
-import java.util.concurrent.TimeUnit;
-
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-
-/**
- * @author Stefan Negrea
- *
- */
-@SuppressWarnings("rawtypes")
-public class TimeUnitParamResourceComponent extends MBeanResourceComponent {
-
- @Override
- protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
- System.out.println(typeName);
- if (typeName.equals(TimeUnit.class.getName())) {
- return TimeUnit.valueOf(propSimple.getStringValue());
- }
-
- return super.getPropertyValueAsType(propSimple, typeName);
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index ed82f7c..7e1a79f 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -27,7 +27,7 @@
<!-- Start - Configuration for HAModClusterService -->
<service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent"
- class="PolyPingMBeanResourceComponent"
+ class="ModClusterServiceComponent"
supportsManualAdd="true"
description="HA Service Listener" singleton="true">
@@ -199,7 +199,7 @@
<!-- End - Configuration for HAModClusterService -->
<!-- Start - Configuration for ModClusterService -->
- <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+ <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="ModClusterServiceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
commit 35d73023552f4b83976705e88f14e6fecf0eed6f
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 23 15:39:58 2011 -0500
Updates to support integration with JBoss' mod_cluster module for AS6 and EAP5.1.x
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index b642573..f27b153 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -112,6 +112,7 @@ public class ModclusterPluginTest {
add(PLUGIN_NAME);
add("Webapp Context");
add("HA Service Configuration");
+ add("HA Service");
}
};
@@ -132,6 +133,15 @@ public class ModclusterPluginTest {
ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
.getResourceComponent(resource);
((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
+ } else if (resource.getResourceType().getName().equals("HA Service")) {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+
+ Configuration config = new Configuration();
+ config.put(new PropertySimple("p1", "1"));
+ config.put(new PropertySimple("p2", java.util.concurrent.TimeUnit.SECONDS));
+ OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("stop", config);
+ log.info("Result of operation stopContext was: " + result.getSimpleResult());
}
}
}
diff --git a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
index 6a60a93..8da6a2d 100644
--- a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
+++ b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java
@@ -561,15 +561,15 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme
paramIndex = Integer.valueOf(propName.substring(propName.indexOf('[') + 1, propName.indexOf(']')));
if (paramIndex < 0 || paramIndex >= emsParams.size()) {
throw new IllegalStateException("Index [" + paramIndex + "] specified for parameter of operation ["
- + name + "] on MBean [" + emsBean.getBeanName() + "] is invalid. The MBean operation takes "
- + emsParams.size() + " parameters.");
+ + name + "] on MBean [" + emsBean.getBeanName() + "] is invalid. The MBean operation takes "
+ + emsParams.size() + " parameters.");
}
} else {
paramIndex = emsParamIndexesByName.get(propName);
if (paramIndex == null) {
throw new IllegalStateException("Name [" + propName + "] specified for parameter of operation ["
- + name + "] on MBean [" + emsBean.getBeanName()
- + "] is invalid. The MBean operation does not take a parameter by that name.");
+ + name + "] on MBean [" + emsBean.getBeanName()
+ + "] is invalid. The MBean operation does not take a parameter by that name.");
}
}
EmsParameter emsParam = emsParams.get(paramIndex);
@@ -611,7 +611,7 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme
return resultToReturn;
}
- private Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
Object value;
if (typeName.equals(String.class.getName())) {
value = (propSimple == null) ? null : propSimple.getStringValue();
@@ -626,7 +626,8 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme
} else if (typeName.equals(Double.class.getName()) || typeName.equals(double.class.getName())) {
value = (propSimple == null) ? null : propSimple.getDoubleValue();
} else {
- throw new IllegalStateException("Operation parameter maps to MBean parameter with an unsupported type (" + typeName + ").");
+ throw new IllegalStateException("Operation parameter maps to MBean parameter with an unsupported type ("
+ + typeName + ").");
}
// TODO GH: Handle rest of types. (I think i have a mapper for this in mc4j
return value;
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 35c5b28..3a6deaa 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -31,6 +31,11 @@
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.on</groupId>
+ <artifactId>jopr-jboss-as-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>log4j</groupId>
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
index c5343d0..4c8b437 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
@@ -90,6 +90,10 @@ public class ContextComponent extends MBeanResourceComponent<MBeanResourceCompon
configuration = new Object[] { context.getHost(), context.getPath() };
}
+ if (context.getPath().equals("/")) {
+ configuration[1] = "ROOT";
+ }
+
log.info(name + " - " + context.getHost() + " " + context.getPath());
ClassLoader cl = Thread.currentThread().getContextClassLoader();
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index ee0369c..0a0a570 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -30,21 +30,20 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.util.exception.ThrowableUtil;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
/**
* @author Stefan Negrea
*
*/
-@SuppressWarnings({ "rawtypes", "deprecation" })
-public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent {
+@SuppressWarnings({ "deprecation" })
+public class FileConfiguredMBeanResourceComponent extends TimeUnitParamResourceComponent {
private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
private static final String BEAN_CLASS_NAME_PROPERTY = "className";
private static final String DEPENDENCY_BEAN_CLASS_NAME_PROPERTY = "dependencyClassName";
- private static final String SERVER_HOME_DIR = "jboss.server.home.dir";
+ private static final String SERVER_HOME_DIR = "serverHomeDir";
private static final String CONFIGURATION_FILE_RELATIVE_PATH = "/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml";
/**
@@ -105,7 +104,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
}
private String getServerHomeDirectory() {
- ModclusterServerComponent modClusterComponent = (ModclusterServerComponent) this.resourceContext
+ ModClusterServerComponent modClusterComponent = (ModClusterServerComponent) this.resourceContext
.getParentResourceComponent();
PropertySimple property = modClusterComponent.getResourceContext().getPluginConfiguration()
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
index 496068c..3eb7cbe 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -36,9 +36,6 @@ import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
@SuppressWarnings("rawtypes")
public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponent<JMXComponent> {
- /* (non-Javadoc)
- * @see org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext, boolean)
- */
@Override
public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<JMXComponent> context,
boolean skipUnknownProps) {
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java
new file mode 100644
index 0000000..b9a73b5
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterDiscoveryComponent.java
@@ -0,0 +1,70 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import java.util.Set;
+
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jbossas.JBossASServerComponent;
+import org.rhq.plugins.jbossas5.ApplicationServerComponent;
+import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class ModClusterDiscoveryComponent extends MBeanResourceDiscoveryComponent {
+
+ private final static String JBOSS_SERVER_HOME_DIR = "serverHomeDir";
+
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext context) {
+ Set<DiscoveredResourceDetails> tempSet = super.discoverResources(context);
+
+ for (DiscoveredResourceDetails detail : tempSet) {
+ String serverHomeDirectory = findServerHomeDirectory(context.getParentResourceComponent());
+ detail.getPluginConfiguration().put(new PropertySimple(JBOSS_SERVER_HOME_DIR, serverHomeDirectory));
+ }
+
+ return tempSet;
+ }
+
+ @SuppressWarnings("static-access")
+ public String findServerHomeDirectory(ResourceComponent parentResourceComponent) {
+ if (parentResourceComponent instanceof ApplicationServerComponent) {
+ ApplicationServerComponent parentComponent = (ApplicationServerComponent) parentResourceComponent;
+
+ return parentComponent.getResourceContext().getPluginConfiguration().getSimple("serverHomeDir")
+ .getStringValue();
+
+ } else if (parentResourceComponent instanceof JBossASServerComponent) {
+ JBossASServerComponent parentComponent = (JBossASServerComponent) parentResourceComponent;
+
+ return parentComponent.getPluginConfiguration().getSimple(parentComponent.JBOSS_HOME_DIR_CONFIG_PROP)
+ .getStringValue();
+ }
+
+ return null;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
new file mode 100644
index 0000000..7d5f0dc
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModClusterServerComponent.java
@@ -0,0 +1,47 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings({ "rawtypes" })
+public class ModClusterServerComponent extends MBeanResourceComponent {
+
+ @Override
+ public AvailabilityType getAvailability() {
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
+
+ if (rawProxyInfo == null) {
+ return AvailabilityType.DOWN;
+ }
+
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ if (proxyInfo.getAvailableNodes().size() == 0) {
+ return AvailabilityType.DOWN;
+ }
+
+ return super.getAvailability();
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
deleted file mode 100644
index 03598e9..0000000
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2009 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.plugins.modcluster;
-
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.pluginapi.inventory.ResourceContext;
-import org.rhq.plugins.jbossas.JBossASServerComponent;
-import org.rhq.plugins.jbossas5.ApplicationServerComponent;
-import org.rhq.plugins.jmx.MBeanResourceComponent;
-import org.rhq.plugins.modcluster.helper.JBossHelper;
-
-/**
- * @author Stefan Negrea
- *
- */
-@SuppressWarnings({ "rawtypes" })
-public class ModclusterServerComponent extends MBeanResourceComponent {
-
- private final static String JBOSS_SERVER_HOME_DIR = "jboss.server.home.dir";
-
- @SuppressWarnings({ "unchecked", "deprecation", "static-access" })
- @Override
- public void start(ResourceContext context) {
- super.start(context);
-
- String serverHomeDirectory = null;
- if (this.resourceContext.getParentResourceComponent() instanceof ApplicationServerComponent) {
- ApplicationServerComponent parentComponent = (ApplicationServerComponent) this.resourceContext
- .getParentResourceComponent();
-
- serverHomeDirectory = parentComponent.getResourceContext().getPluginConfiguration()
- .getSimple("serverHomeDir").getStringValue();
-
- } else if (this.resourceContext.getParentResourceComponent() instanceof JBossASServerComponent) {
- JBossASServerComponent parentComponent = (JBossASServerComponent) this.resourceContext
- .getParentResourceComponent();
-
- serverHomeDirectory = parentComponent.getPluginConfiguration()
- .getSimple(parentComponent.JBOSS_HOME_DIR_CONFIG_PROP).getStringValue();
- }
-
- if (serverHomeDirectory != null) {
- PropertySimple serverHomeDirectoryProperty = null;
- serverHomeDirectoryProperty = new PropertySimple();
- serverHomeDirectoryProperty.setName(JBOSS_SERVER_HOME_DIR);
- serverHomeDirectoryProperty.setStringValue(serverHomeDirectory);
- this.resourceContext.getPluginConfiguration().put(serverHomeDirectoryProperty);
- }
- };
-
- //private final static String PROXY_INFO_PROPERTY_NAME
-
- /* (non-Javadoc)
- * @see org.rhq.plugins.jmx.MBeanResourceComponent#getAvailability()
- */
- @Override
- public AvailabilityType getAvailability() {
- String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
-
- if (rawProxyInfo == null) {
- return AvailabilityType.DOWN;
- }
-
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
- if (proxyInfo.getAvailableNodes().size() == 0) {
- return AvailabilityType.DOWN;
- }
-
- return super.getAvailability();
- }
-}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
index bc54267..c67bf61 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
@@ -1,6 +1,9 @@
package org.rhq.plugins.modcluster;
+import java.util.concurrent.TimeUnit;
+
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.pluginapi.operation.OperationResult;
/*
@@ -36,4 +39,14 @@ public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceC
return super.invokeOperation(name, parameters);
}
+
+ @Override
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ System.out.println(typeName);
+ if (typeName.equals(TimeUnit.class.getName())) {
+ return TimeUnit.valueOf(propSimple.getStringValue());
+ }
+
+ return super.getPropertyValueAsType(propSimple, typeName);
+ }
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
new file mode 100644
index 0000000..0296eaf
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/TimeUnitParamResourceComponent.java
@@ -0,0 +1,42 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import java.util.concurrent.TimeUnit;
+
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings("rawtypes")
+public class TimeUnitParamResourceComponent extends MBeanResourceComponent {
+
+ @Override
+ protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) {
+ System.out.println(typeName);
+ if (typeName.equals(TimeUnit.class.getName())) {
+ return TimeUnit.valueOf(propSimple.getStringValue());
+ }
+
+ return super.getPropertyValueAsType(propSimple, typeName);
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
index 6c00130..dee2f81 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -18,11 +18,18 @@
*/
package org.rhq.plugins.modcluster.config;
+import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
@@ -38,11 +45,13 @@ public abstract class AbstractConfigurationFile {
public AbstractConfigurationFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
this.fileName = fileName;
- DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
- this.document = docBuilder.parse(this.getFileName());
+ loadConfiguratonFile();
}
+ abstract void setPropertyValue(String propertyName, String value);
+
+ abstract String getPropertyValue(String propertyName);
+
/**
* @return the fileName
*/
@@ -57,9 +66,19 @@ public abstract class AbstractConfigurationFile {
return document;
}
- abstract void setPropertyValue(String propertyName, String value);
+ public void saveConfigurationFile() throws Exception {
+ File file = new File(this.getFileName());
+ StreamResult result = new StreamResult(file);
+ Source source = new DOMSource(this.getDocument());
- abstract String getPropertyValue(String propertyName);
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.transform(source, result);
+ }
- abstract void saveConfigurationFile() throws Exception;
+ private void loadConfiguratonFile() throws ParserConfigurationException, SAXException, IOException {
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+ this.document = docBuilder.parse(this.getFileName());
+ }
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 1d008ee..354fa99 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -47,11 +47,4 @@ public class JBossWebServerFile extends AbstractConfigurationFile {
// TODO Auto-generated method stub
return null;
}
-
- @Override
- void saveConfigurationFile() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 45053f7..6abf955 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -19,17 +19,10 @@
package org.rhq.plugins.modcluster.config;
import java.io.IOException;
-import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Attr;
import org.w3c.dom.Node;
@@ -129,22 +122,6 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
}
/**
- * @throws TransformerException
- */
- public void saveConfigurationFile() throws TransformerException {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "no");
-
- //initialize StreamResult with File object to save to file
- StreamResult result = new StreamResult(new StringWriter());
- DOMSource source = new DOMSource(this.getDocument());
- transformer.transform(source, result);
-
- String xmlString = result.getWriter().toString();
- System.out.println(xmlString);
- }
-
- /**
* @param className
* @return
*/
@@ -155,7 +132,6 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
Node node = result.item(i);
if (node.getAttributes().getNamedItem("class") != null
&& className.equals(node.getAttributes().getNamedItem("class").getTextContent())) {
- System.out.println(node.getAttributes().getNamedItem("class").getTextContent());
return node;
}
}
@@ -174,7 +150,6 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
Node node = result.item(i);
if (node.getAttributes().getNamedItem("name") != null
&& beanName.equals(node.getAttributes().getNamedItem("name").getTextContent())) {
- System.out.println(node.getAttributes().getNamedItem("name").getTextContent());
return node;
}
}
@@ -243,5 +218,4 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return listOfNodes;
}
-
}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 4f3010f..ed82f7c 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -6,7 +6,9 @@
<depends plugin="JMX" />
<service name="mod_cluster"
- discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
+ discovery="ModClusterDiscoveryComponent"
+ class="ModClusterServerComponent"
+ supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
<runs-inside>
<parent-resource-type name="JBossAS Server" plugin="JBossAS" />
@@ -17,13 +19,17 @@
<c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*|jboss.web:service=ModCluster" />
<c:simple-property name="engineObjectName" readOnly="true" default="jboss.web:type=Engine" />
<c:simple-property name="nameTemplate" default="mod_cluster" />
+ <c:simple-property name="serverHomeDir"/>
</plugin-configuration>
<operation name="reset" displayName="Reset the node" description="Move this application server out of an error state." />
<operation name="refresh" displayName="Refresh configuration" description="Refresh configuration for this application server." />
<!-- Start - Configuration for HAModClusterService -->
- <service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+ <service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent"
+ class="PolyPingMBeanResourceComponent"
+ supportsManualAdd="true"
+ description="HA Service Listener" singleton="true">
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
@@ -35,18 +41,18 @@
<!-- HA Operations -->
<operation name="disableDomain" displayName="Disable domain" description="Disables all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
<results>
- <c:simple-property name="result" description="The result of the operation" />
+ <c:simple-property name="operationResult" description="The result of the operation" />
</results>
</operation>
<operation name="enableDomain" displayName="Enable domain" description="Enable all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="stopDomain" displayName="Stop domain" description="Gracefully stops all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
<parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="The number of units of time for which to wait for all sessions to drain on a given node." />
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:simple-property required="true" name="p1" type="string" displayName="The number of units of time for which to wait for all sessions to drain on a given node." />
+ <c:simple-property required="true" name="p2" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
<c:property-options allowCustomValue="false">
<c:option value="MICROSECONDS" name="MICROSECONDS" />
<c:option value="MILLISECONDS" name="MILLISECONDS" />
@@ -58,7 +64,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -66,59 +72,60 @@
<operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
<results>
- <c:simple-property name="result" description="Map of PING_RPS response, grouped by proxy.">
+ <c:simple-property name="operationResult" description="Map of PING_RPS response, grouped by proxy.">
</c:simple-property>
</results>
</operation>
<operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ <c:simple-property required="true" name="p1" type="string" displayName="JVM Route of node to ping." />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="pingNodeByAddress" displayName="Ping node by address"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
- <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
- <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="p2" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="p3" type="integer" displayName="Port" />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
<operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
+
<operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" description="The result of the operation">
+ <c:simple-property name="operationResult" description="The result of the operation">
</c:simple-property>
</results>
</operation>
<operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" description="The result of the operation">
+ <c:simple-property name="operationResult" description="The result of the operation">
</c:simple-property>
</results>
</operation>
<operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
<parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:simple-property required="true" name="p1" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="p2" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
<c:property-options allowCustomValue="false">
<c:option value="MICROSECONDS" name="MICROSECONDS" />
<c:option value="MILLISECONDS" name="MILLISECONDS" />
@@ -130,7 +137,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -139,7 +146,7 @@
<metric property="ProxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
<resource-configuration>
- <c:simple-property name="processStatusFrequency" type="integer" description="Process status frequency." />
+ <c:simple-property name="processStatusFrequency" type="integer" required="false" description="Process status frequency." />
</resource-configuration>
</service>
@@ -203,56 +210,57 @@
<operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ <c:simple-property required="true" name="p1" type="string" displayName="JVM Route of node to ping." />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="pingNodeByAddress" displayName="Ping node by address"
description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
<parameters>
- <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
- <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
- <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="p2" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="p3" type="integer" displayName="Port" />
</parameters>
<results>
- <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ <c:simple-property name="operationResult" type="string" description="Map of PING_RPS response, grouped by proxy." />
</results>
</operation>
<operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
<operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
<parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ <c:simple-property required="true" name="p1" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="p2" type="integer" displayName="Proxy port" />
</parameters>
</operation>
+
<operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
<parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:simple-property required="true" name="p1" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="p2" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
<c:property-options allowCustomValue="false">
<c:option value="MICROSECONDS" name="MICROSECONDS" />
<c:option value="MILLISECONDS" name="MILLISECONDS" />
@@ -264,7 +272,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -338,12 +346,12 @@
</operation>
<operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
@@ -361,7 +369,7 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
@@ -396,11 +404,9 @@
<c:simple-property name="nameTemplate" default="Dynamic Load Balancer Factor" />
</plugin-configuration>
- <metric property="Metrics" displayName="Collected Metrics" displayType="summary" dataType="trait" />
-
<resource-configuration>
- <c:simple-property name="DecayFactor" type="integer" description="The number of historical load values used to determine load factor." />
- <c:simple-property name="History" type="integer" description="The exponential decay factor for historical load values." />
+ <c:simple-property name="decayFactor" type="integer" required="false" description="The number of historical load values used to determine load factor." />
+ <c:simple-property name="history" type="integer" required="false" description="The exponential decay factor for historical load values." />
</resource-configuration>
</service>
@@ -424,11 +430,13 @@
<c:simple-property name="nameTemplate" default="Load Metric" />
</plugin-configuration>
- <metric property="Load" displayName="Load" category="utilization" description="The current load of this metric as a percent of the metric's capacity." dataType="measurement" />
+ <metric property="Load" displayName="Load" category="utilization"
+ description="The current load of this metric as a percent of the metric's capacity." dataType="measurement"
+ defaultOn="true" displayType="summary"/>
<resource-configuration>
- <c:simple-property name="Weight" type="integer" description="The significance of this load metric compared to the other metrics." />
- <c:simple-property name="Capacity" type="double" description="Used to normalize the value returned by load expressed as a percentage of the capacity, such that: 0 < (load/capacity) < 1" />
+ <c:simple-property name="weight" type="integer" description="The significance of this load metric compared to the other metrics." />
+ <c:simple-property name="capacity" type="double" description="Used to normalize the value returned by load expressed as a percentage of the capacity, such that: 0 < (load/capacity) < 1" />
</resource-configuration>
</service>
@@ -436,7 +444,7 @@
<operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation." />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation." />
</results>
</operation>
<operation name="stopContext" displayName="Stop webapp" description="Gracefully stops this webapp.">
@@ -454,12 +462,12 @@
</c:simple-property>
</parameters>
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
<operation name="enableContext" displayName="Enable webapp" description="Enable this webapp.">
<results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ <c:simple-property name="operationResult" type="boolean" description="The result of the operation" />
</results>
</operation>
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index c50b0e6..cba5672 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -28,16 +28,19 @@ public class ServerConfigTest {
public void TestConfig() {
try {
+ //Test simple bean configuration
ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
"/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
- System.out.println(config.getPropertyValue("test"));
+ config.setPropertyValue("test", null);
+ config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
+ //Test bean configuration with constructor dependency
config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
"org.jboss.modcluster.config.ha.HAModClusterConfig",
"/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
@@ -45,11 +48,8 @@ public class ServerConfigTest {
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
- System.out.println(config.getPropertyValue("test"));
-
- config.saveConfigurationFile();
-
config.setPropertyValue("test", null);
+ config.setPropertyValue("processStatusFrequency", null);
config.saveConfigurationFile();
} catch (Exception e) {
// TODO Auto-generated catch block
commit 7b57da38ba1b16241e06480cf0b95a22c3508999
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon Aug 15 14:59:16 2011 -0500
The JBoss server home directory is now correctly retrieved from the parent resource component. Included some other minor code tweaks and refactorings.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
index 77a81b2..ba94746 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/pom.xml
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -42,7 +42,13 @@
</dependencyManagement>
<dependencies>
-
+ <dependency>
+ <groupId>org.jboss.on</groupId>
+ <artifactId>jopr-jboss-as-5-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>org.jboss.integration</groupId>
<artifactId>jboss-profileservice-spi</artifactId>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index 0a39eab..b642573 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -45,6 +45,7 @@ import org.rhq.core.pc.PluginContainerConfiguration;
import org.rhq.core.pc.plugin.FileSystemPluginFinder;
import org.rhq.core.pc.plugin.PluginEnvironment;
import org.rhq.core.pc.plugin.PluginManager;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
import org.rhq.core.pluginapi.inventory.ResourceComponent;
import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import org.rhq.core.pluginapi.operation.OperationFacet;
@@ -109,7 +110,8 @@ public class ModclusterPluginTest {
{
add(PLUGIN_NAME);
- add(PLUGIN_NAME + " Webapp Context");
+ add("Webapp Context");
+ add("HA Service Configuration");
}
};
@@ -124,8 +126,12 @@ public class ModclusterPluginTest {
Resource resource = (Resource) objectResource;
if (resource.getResourceType().getName().equals("mod_cluster")) {
testResourceMeasurement(resource);
- } else {
+ } else if (resource.getResourceType().getName().equals("Webapp Context")) {
testContextOperations(resource);
+ } else if (resource.getResourceType().getName().equals("HA Service Configuration")) {
+ ResourceComponent resourceComponent = PluginContainer.getInstance().getInventoryManager()
+ .getResourceComponent(resource);
+ ((ConfigurationFacet) resourceComponent).loadResourceConfiguration();
}
}
}
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index fdc4f37..35c5b28 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -23,6 +23,14 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.on</groupId>
+ <artifactId>jopr-jboss-as-5-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>log4j</groupId>
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
index 8e14f9b..c5343d0 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
@@ -20,6 +20,8 @@ package org.rhq.plugins.modcluster;
import java.util.concurrent.TimeUnit;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.mc4j.ems.connection.bean.EmsBean;
import org.rhq.core.domain.configuration.Configuration;
@@ -35,6 +37,9 @@ import org.rhq.plugins.modcluster.helper.JBossHelper;
*/
@SuppressWarnings({ "rawtypes", "deprecation" })
public class ContextComponent extends MBeanResourceComponent<MBeanResourceComponent> {
+
+ private static final Log log = LogFactory.getLog(ContextComponent.class);
+
@Override
protected EmsBean loadBean() {
return getResourceContext().getParentResourceComponent().getEmsBean();
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
index 9b511b3..ee0369c 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -19,6 +19,9 @@
package org.rhq.plugins.modcluster;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.configuration.PropertySimple;
@@ -34,11 +37,15 @@ import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
* @author Stefan Negrea
*
*/
-@SuppressWarnings("rawtypes")
+@SuppressWarnings({ "rawtypes", "deprecation" })
public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent {
+ private static final Log log = LogFactory.getLog(FileConfiguredMBeanResourceComponent.class);
+
private static final String BEAN_CLASS_NAME_PROPERTY = "className";
private static final String DEPENDENCY_BEAN_CLASS_NAME_PROPERTY = "dependencyClassName";
+ private static final String SERVER_HOME_DIR = "jboss.server.home.dir";
+ private static final String CONFIGURATION_FILE_RELATIVE_PATH = "/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml";
/**
* This default setup of configuration properties can map to mbean attributes
@@ -46,15 +53,14 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
* @return the configuration of the component
*/
@Override
- @SuppressWarnings("deprecation")
public Configuration loadResourceConfiguration() {
+
Configuration configuration = new Configuration();
ConfigurationDefinition configurationDefinition = this.resourceContext.getResourceType()
.getResourceConfigurationDefinition();
try {
- ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
- .getPluginConfiguration());
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance();
for (PropertyDefinition property : configurationDefinition.getPropertyDefinitions().values()) {
if (property instanceof PropertyDefinitionSimple) {
@@ -69,8 +75,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
}
}
} catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.debug("Unable to load mod_cluster configuration file.", e);
}
return configuration;
@@ -84,19 +89,35 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
updateResourceConfiguration(report, false);
}
- private ModClusterBeanFile getModClusterBeanFileInstance(Configuration pluginConfig) throws Exception {
+ private ModClusterBeanFile getModClusterBeanFileInstance() throws Exception {
+ Configuration pluginConfig = this.resourceContext.getPluginConfiguration();
String beanClassName = pluginConfig.getSimple(BEAN_CLASS_NAME_PROPERTY).getStringValue();
+ String fileName = this.getServerHomeDirectory() + CONFIGURATION_FILE_RELATIVE_PATH;
+
if (pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY) != null) {
String dependencyBeanClassName = pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY)
.getStringValue();
- return new ModClusterBeanFile(dependencyBeanClassName);
+ return new ModClusterBeanFile(beanClassName, dependencyBeanClassName, fileName);
+ }
+
+ return new ModClusterBeanFile(beanClassName, fileName);
+ }
+
+ private String getServerHomeDirectory() {
+ ModclusterServerComponent modClusterComponent = (ModclusterServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ PropertySimple property = modClusterComponent.getResourceContext().getPluginConfiguration()
+ .getSimple(SERVER_HOME_DIR);
+
+ if (property != null) {
+ return property.getStringValue();
}
- return new ModClusterBeanFile(beanClassName);
+ return null;
}
- @SuppressWarnings("deprecation")
@Override
public void updateResourceConfiguration(ConfigurationUpdateReport report, boolean ignoreReadOnly) {
ConfigurationDefinition configurationDefinition = this.getResourceContext().getResourceType()
@@ -106,8 +127,7 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
report.setStatus(ConfigurationUpdateStatus.SUCCESS);
try {
- ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
- .getPluginConfiguration());
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance();
for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
PropertySimple property = report.getConfiguration().getSimple(key);
@@ -127,10 +147,9 @@ public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent
}
}
- modClusterBeanFile.saveConfigFile();
+ modClusterBeanFile.saveConfigurationFile();
} catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.debug("Unable to save mod_cluster configuration file.", e);
}
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
index fb944c8..496068c 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -30,7 +30,7 @@ import org.rhq.plugins.jmx.JMXComponent;
import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
/**
- * @author snegrea
+ * @author Stefan Negrea
*
*/
@SuppressWarnings("rawtypes")
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
index 2c964c0..03598e9 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
@@ -18,7 +18,11 @@
*/
package org.rhq.plugins.modcluster;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.plugins.jbossas.JBossASServerComponent;
+import org.rhq.plugins.jbossas5.ApplicationServerComponent;
import org.rhq.plugins.jmx.MBeanResourceComponent;
import org.rhq.plugins.modcluster.helper.JBossHelper;
@@ -29,6 +33,38 @@ import org.rhq.plugins.modcluster.helper.JBossHelper;
@SuppressWarnings({ "rawtypes" })
public class ModclusterServerComponent extends MBeanResourceComponent {
+ private final static String JBOSS_SERVER_HOME_DIR = "jboss.server.home.dir";
+
+ @SuppressWarnings({ "unchecked", "deprecation", "static-access" })
+ @Override
+ public void start(ResourceContext context) {
+ super.start(context);
+
+ String serverHomeDirectory = null;
+ if (this.resourceContext.getParentResourceComponent() instanceof ApplicationServerComponent) {
+ ApplicationServerComponent parentComponent = (ApplicationServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ serverHomeDirectory = parentComponent.getResourceContext().getPluginConfiguration()
+ .getSimple("serverHomeDir").getStringValue();
+
+ } else if (this.resourceContext.getParentResourceComponent() instanceof JBossASServerComponent) {
+ JBossASServerComponent parentComponent = (JBossASServerComponent) this.resourceContext
+ .getParentResourceComponent();
+
+ serverHomeDirectory = parentComponent.getPluginConfiguration()
+ .getSimple(parentComponent.JBOSS_HOME_DIR_CONFIG_PROP).getStringValue();
+ }
+
+ if (serverHomeDirectory != null) {
+ PropertySimple serverHomeDirectoryProperty = null;
+ serverHomeDirectoryProperty = new PropertySimple();
+ serverHomeDirectoryProperty.setName(JBOSS_SERVER_HOME_DIR);
+ serverHomeDirectoryProperty.setStringValue(serverHomeDirectory);
+ this.resourceContext.getPluginConfiguration().put(serverHomeDirectoryProperty);
+ }
+ };
+
//private final static String PROXY_INFO_PROPERTY_NAME
/* (non-Javadoc)
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
index 8f5d08b..bc54267 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
@@ -22,6 +22,10 @@ import org.rhq.core.pluginapi.operation.OperationResult;
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+/**
+ *
+ * @author Stefan Negrea
+ */
public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceComponent {
@Override
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
index 4fe5788..6c00130 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -32,9 +32,6 @@ import org.xml.sax.SAXException;
* @author Stefan Negrea
*/
public abstract class AbstractConfigurationFile {
-
- public static final String SERVER_HOME_DIR = "jboss.server.home.dir";
-
private String fileName;
private Document document;
@@ -60,4 +57,9 @@ public abstract class AbstractConfigurationFile {
return document;
}
+ abstract void setPropertyValue(String propertyName, String value);
+
+ abstract String getPropertyValue(String propertyName);
+
+ abstract void saveConfigurationFile() throws Exception;
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
index 602e52b..1d008ee 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -36,4 +36,22 @@ public class JBossWebServerFile extends AbstractConfigurationFile {
// TODO Auto-generated constructor stub
}
+ @Override
+ void setPropertyValue(String propertyName, String value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ String getPropertyValue(String propertyName) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ void saveConfigurationFile() throws Exception {
+ // TODO Auto-generated method stub
+
+ }
+
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
index 0e25f26..45053f7 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -16,7 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
package org.rhq.plugins.modcluster.config;
import java.io.IOException;
@@ -38,24 +37,38 @@ import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
/**
- * @author snegrea
+ * @author Stefan Negrea
*
*/
public class ModClusterBeanFile extends AbstractConfigurationFile {
private Node beanNode;
- public ModClusterBeanFile(String className) throws ParserConfigurationException, SAXException, IOException {
- super(
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ /**
+ * @param className
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, String configurationFile) throws ParserConfigurationException,
+ SAXException, IOException {
+ super(configurationFile);
beanNode = this.getBeanNodeByClass(className);
}
- public ModClusterBeanFile(String className, String constructorArgumentClassName)
+ /**
+ * @param className
+ * @param constructorArgumentClassName
+ * @param configurationFile
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
+ */
+ public ModClusterBeanFile(String className, String constructorArgumentClassName, String configurationFile)
throws ParserConfigurationException, SAXException, IOException {
- super(
- "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+ super(configurationFile);
Node primaryBeanNode = this.getBeanNodeByClass(className);
String dependencyName = this.getBeanFromConstructorArgument(primaryBeanNode, constructorArgumentClassName);
@@ -63,58 +76,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
beanNode = this.getBeanNodeByName(dependencyName);
}
- private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
- List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
-
- if (tempNodeList.size() > 0) {
- Node constructorNode = tempNodeList.get(0);
-
- tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
-
- if (tempNodeList.size() > 0) {
- Node parameterNode = null;
-
- for (Node currentNode : tempNodeList) {
- if (currentNode.getAttributes().getNamedItem("class") != null
- && constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
- .getTextContent())) {
- parameterNode = currentNode;
- break;
- }
- }
-
- if (parameterNode != null) {
- tempNodeList = this.getChildNodesByName(parameterNode, "inject");
-
- if (tempNodeList.size() > 0) {
- Node injectNode = tempNodeList.get(0);
- Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
-
- if (beanAttribute != null) {
- return beanAttribute.getTextContent();
- }
- }
- }
- }
- }
-
- return null;
- }
-
- private List<Node> getChildNodesByName(Node node, String nodeName) {
- List<Node> listOfNodes = new ArrayList<Node>();
-
- for (int i = 0; i < node.getChildNodes().getLength(); i++) {
- Node currentNode = node.getChildNodes().item(i);
-
- if (nodeName.equals(currentNode.getNodeName())) {
- listOfNodes.add(currentNode);
- }
- }
-
- return listOfNodes;
- }
-
+ /**
+ * @param propertyName
+ * @param value
+ */
public void setPropertyValue(String propertyName, String value) {
boolean propertyFound = false;
for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
@@ -144,6 +109,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
}
}
+ /**
+ * @param propertyName
+ * @return
+ */
public String getPropertyValue(String propertyName) {
for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
Node currentNode = beanNode.getChildNodes().item(i);
@@ -159,7 +128,10 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return null;
}
- public void saveConfigFile() throws TransformerException {
+ /**
+ * @throws TransformerException
+ */
+ public void saveConfigurationFile() throws TransformerException {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "no");
@@ -172,7 +144,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
System.out.println(xmlString);
}
- public Node getBeanNodeByClass(String className) {
+ /**
+ * @param className
+ * @return
+ */
+ private Node getBeanNodeByClass(String className) {
NodeList result = this.getDocument().getElementsByTagName("bean");
for (int i = 1; i < result.getLength(); i++) {
@@ -187,7 +163,11 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return null;
}
- public Node getBeanNodeByName(String beanName) {
+ /**
+ * @param beanName
+ * @return
+ */
+ private Node getBeanNodeByName(String beanName) {
NodeList result = this.getDocument().getElementsByTagName("bean");
for (int i = 1; i < result.getLength(); i++) {
@@ -202,4 +182,66 @@ public class ModClusterBeanFile extends AbstractConfigurationFile {
return null;
}
+ /**
+ * @param beanNode
+ * @param constructorArgumentClassName
+ * @return
+ */
+ private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
+ List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
+
+ if (tempNodeList.size() > 0) {
+ Node constructorNode = tempNodeList.get(0);
+
+ tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
+
+ if (tempNodeList.size() > 0) {
+ Node parameterNode = null;
+
+ for (Node currentNode : tempNodeList) {
+ if (currentNode.getAttributes().getNamedItem("class") != null
+ && constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
+ .getTextContent())) {
+ parameterNode = currentNode;
+ break;
+ }
+ }
+
+ if (parameterNode != null) {
+ tempNodeList = this.getChildNodesByName(parameterNode, "inject");
+
+ if (tempNodeList.size() > 0) {
+ Node injectNode = tempNodeList.get(0);
+ Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
+
+ if (beanAttribute != null) {
+ return beanAttribute.getTextContent();
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param node
+ * @param nodeName
+ * @return
+ */
+ private List<Node> getChildNodesByName(Node node, String nodeName) {
+ List<Node> listOfNodes = new ArrayList<Node>();
+
+ for (int i = 0; i < node.getChildNodes().getLength(); i++) {
+ Node currentNode = node.getChildNodes().item(i);
+
+ if (nodeName.equals(currentNode.getNodeName())) {
+ listOfNodes.add(currentNode);
+ }
+ }
+
+ return listOfNodes;
+ }
+
}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index fe4ac7d..4f3010f 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -5,7 +5,8 @@
<depends plugin="JMX" />
- <service name="mod_cluster" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
+ <service name="mod_cluster"
+ discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
<runs-inside>
<parent-resource-type name="JBossAS Server" plugin="JBossAS" />
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
index 4e4aac1..c50b0e6 100644
--- a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -28,27 +28,29 @@ public class ServerConfigTest {
public void TestConfig() {
try {
- ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService");
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
System.out.println(config.getPropertyValue("test"));
- config.saveConfigFile();
+ config.saveConfigurationFile();
config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
- "org.jboss.modcluster.config.ha.HAModClusterConfig");
+ "org.jboss.modcluster.config.ha.HAModClusterConfig",
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
config.setPropertyValue("processStatusFrequency", "4");
config.setPropertyValue("test", "5");
config.setPropertyValue("test", "123");
System.out.println(config.getPropertyValue("test"));
- config.saveConfigFile();
+ config.saveConfigurationFile();
config.setPropertyValue("test", null);
- config.saveConfigFile();
+ config.saveConfigurationFile();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
commit c166ad34f0490dea2ea9c95ff6c1d2c1c8d9e0fc
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 14 12:06:26 2011 -0500
Enable mod_cluster support for JBoss 5&6 with simple and HA configuration listeners. Also, added metric collections and configuration save to bean file.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
new file mode 100644
index 0000000..b9ce25e
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ClassNameMBeanDiscoveryComponent.java
@@ -0,0 +1,95 @@
+/*
+ * 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.plugins.modcluster;
+
+import java.util.Set;
+
+import org.mc4j.ems.connection.EmsConnection;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
+
+/**
+ * Discovers mod_cluster contexts from the proxyInfo mbean property.
+ *
+ * @author Stefan Negrea
+ */
+@SuppressWarnings("rawtypes")
+public class ClassNameMBeanDiscoveryComponent<T extends JMXComponent> extends MBeanResourceDiscoveryComponent<T> {
+
+ private static final String CLASS_NAME = "className";
+
+ /* (non-Javadoc)
+ * @see org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext, boolean)
+ */
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<T> context,
+ boolean skipUnknownProps) {
+
+ Set<DiscoveredResourceDetails> results = super.discoverResources(context, skipUnknownProps);
+
+ for (DiscoveredResourceDetails discoveredResource : results) {
+ if (!isBeanConfiguredClassName(context, discoveredResource.getResourceKey())) {
+ results.remove(discoveredResource);
+ }
+ }
+
+ return results;
+ }
+
+ /**
+ * @param context
+ * @param objectName
+ * @return
+ */
+ public boolean isBeanConfiguredClassName(ResourceDiscoveryContext<T> context, String objectName) {
+ String className = context.getDefaultPluginConfiguration().getSimple(CLASS_NAME).getStringValue();
+
+ EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
+ EmsBean emsBean = loadBean(connection, objectName);
+
+ return className.equals(emsBean.getClassTypeName());
+ }
+
+ /**
+ * Loads the bean with the given object name.
+ *
+ * Subclasses are free to override this method in order to load the bean.
+ *
+ * @param objectName the name of the bean to load
+ * @return the bean that is loaded
+ */
+ protected EmsBean loadBean(EmsConnection emsConnection, String objectName) {
+ EmsBean bean = emsConnection.getBean(objectName);
+ if (bean == null) {
+ // In some cases, this resource component may have been discovered by some means other than querying its
+ // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
+ // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
+ // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
+ // bean before giving up.
+ emsConnection.queryBeans(objectName);
+ bean = emsConnection.getBean(objectName);
+ }
+ return bean;
+ }
+
+}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
index 3545fa5..8e14f9b 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextComponent.java
@@ -26,6 +26,7 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.pluginapi.operation.OperationResult;
import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
/**
* Manages a mod_cluster context entity.
@@ -44,7 +45,7 @@ public class ContextComponent extends MBeanResourceComponent<MBeanResourceCompon
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
- String rawProxyInfo = (String) getEmsBean().getAttribute("proxyInfo").refresh().toString();
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
@@ -91,12 +92,16 @@ public class ContextComponent extends MBeanResourceComponent<MBeanResourceCompon
Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());
Object resultObject = getEmsBean().getOperation(name).invoke(configuration);
- return new OperationResult(String.valueOf(resultObject));
+ if (resultObject instanceof OperationResult) {
+ return (OperationResult) resultObject;
+ } else {
+ return new OperationResult(String.valueOf(resultObject));
+ }
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
}
- throw new Exception("Operation " + name + " not available mod_cluster_context service");
+ throw new Exception("Operation " + name + " not available mod_cluster WebApp service.");
}
}
\ No newline at end of file
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
index 3d03715..788cbce 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ContextDiscoveryComponent.java
@@ -1,24 +1,20 @@
/*
- * Jopr Management Platform
+ * 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
+ * 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 and the GNU Lesser General Public License
- * for more details.
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.rhq.plugins.modcluster;
@@ -33,6 +29,7 @@ import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
/**
* Discovers mod_cluster contexts from the proxyInfo mbean property.
@@ -43,7 +40,6 @@ import org.rhq.plugins.jmx.MBeanResourceComponent;
public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBeanResourceComponent> {
private static final String JVM_ROUTE_PROPERTY = "jvmRoute";
- private static final String PROXY_INFO_PROPERTY = "proxyInfo";
private static final String ENGINE_OBJECT_NAME = "engineObjectName";
/* (non-Javadoc)
@@ -51,7 +47,9 @@ public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBe
*/
public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent> context) {
String jvmRoute = this.getJvmRoute(context);
- String rawProxyInfo = this.getRawProxyInfo(context);
+
+ EmsBean configBean = context.getParentResourceComponent().getEmsBean();
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(configBean);
ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();
@@ -59,8 +57,7 @@ public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBe
for (ProxyInfo.Context availableContext : proxyInfo.getAvailableContexts()) {
if (availableContext.getJvmRoute().equals(jvmRoute)) {
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(),
- availableContext.createKey(), availableContext.createName(), null, "mod_cluster Webapp Context",
- null, null);
+ availableContext.createKey(), availableContext.createName(), null, "Webapp Context", null, null);
entities.add(detail);
}
}
@@ -83,17 +80,6 @@ public class ContextDiscoveryComponent implements ResourceDiscoveryComponent<MBe
}
/**
- * Retrieves raw proxy configuration from the parent context.
- *
- * @param context the discovery context
- * @return raw proxy configuration
- */
- private String getRawProxyInfo(ResourceDiscoveryContext<MBeanResourceComponent> context) {
- EmsBean statsBean = context.getParentResourceComponent().getEmsBean();
- return (String) statsBean.getAttribute(PROXY_INFO_PROPERTY).refresh().toString();
- }
-
- /**
* Loads the bean with the given object name.
*
* Subclasses are free to override this method in order to load the bean.
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
new file mode 100644
index 0000000..9b511b3
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/FileConfiguredMBeanResourceComponent.java
@@ -0,0 +1,137 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+@SuppressWarnings("rawtypes")
+public class FileConfiguredMBeanResourceComponent extends MBeanResourceComponent {
+
+ private static final String BEAN_CLASS_NAME_PROPERTY = "className";
+ private static final String DEPENDENCY_BEAN_CLASS_NAME_PROPERTY = "dependencyClassName";
+
+ /**
+ * This default setup of configuration properties can map to mbean attributes
+ *
+ * @return the configuration of the component
+ */
+ @Override
+ @SuppressWarnings("deprecation")
+ public Configuration loadResourceConfiguration() {
+ Configuration configuration = new Configuration();
+ ConfigurationDefinition configurationDefinition = this.resourceContext.getResourceType()
+ .getResourceConfigurationDefinition();
+
+ try {
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
+ .getPluginConfiguration());
+
+ for (PropertyDefinition property : configurationDefinition.getPropertyDefinitions().values()) {
+ if (property instanceof PropertyDefinitionSimple) {
+ String value = modClusterBeanFile.getPropertyValue(property.getName());
+ if (value != null) {
+ configuration.put(new PropertySimple(property.getName(), value));
+ } else {
+ PropertyDefinitionSimple propertyDefinitionSimple = (PropertyDefinitionSimple) property;
+ configuration.put(new PropertySimple(property.getName(), propertyDefinitionSimple
+ .getDefaultValue()));
+ }
+ }
+ }
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return configuration;
+ }
+
+ /**
+ * Equivalent to updateResourceConfiguration(report, false);
+ */
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ updateResourceConfiguration(report, false);
+ }
+
+ private ModClusterBeanFile getModClusterBeanFileInstance(Configuration pluginConfig) throws Exception {
+ String beanClassName = pluginConfig.getSimple(BEAN_CLASS_NAME_PROPERTY).getStringValue();
+
+ if (pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY) != null) {
+ String dependencyBeanClassName = pluginConfig.getSimple(DEPENDENCY_BEAN_CLASS_NAME_PROPERTY)
+ .getStringValue();
+ return new ModClusterBeanFile(dependencyBeanClassName);
+ }
+
+ return new ModClusterBeanFile(beanClassName);
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report, boolean ignoreReadOnly) {
+ ConfigurationDefinition configurationDefinition = this.getResourceContext().getResourceType()
+ .getResourceConfigurationDefinition();
+
+ // assume we succeed - we'll set to failure if we can't set all properties
+ report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+
+ try {
+ ModClusterBeanFile modClusterBeanFile = this.getModClusterBeanFileInstance(this.resourceContext
+ .getPluginConfiguration());
+
+ for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
+ PropertySimple property = report.getConfiguration().getSimple(key);
+ if (property != null) {
+ try {
+ PropertyDefinitionSimple def = configurationDefinition.getPropertyDefinitionSimple(property
+ .getName());
+ if (!(ignoreReadOnly && def.isReadOnly())) {
+ modClusterBeanFile.setPropertyValue(property.getName(), property.getStringValue());
+ }
+ } catch (Exception e) {
+ property.setErrorMessage(ThrowableUtil.getStackAsString(e));
+ report
+ .setErrorMessage("Failed setting resource configuration - see property error messages for details");
+ log.info("Failure setting MBean Resource configuration value for " + key, e);
+ }
+ }
+ }
+
+ modClusterBeanFile.saveConfigFile();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
new file mode 100644
index 0000000..fb944c8
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/LoadMetricDiscoveryComponent.java
@@ -0,0 +1,95 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster;
+
+import java.util.Set;
+
+import org.mc4j.ems.connection.EmsConnection;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
+
+/**
+ * @author snegrea
+ *
+ */
+@SuppressWarnings("rawtypes")
+public class LoadMetricDiscoveryComponent extends MBeanResourceDiscoveryComponent<JMXComponent> {
+
+ /* (non-Javadoc)
+ * @see org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext, boolean)
+ */
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<JMXComponent> context,
+ boolean skipUnknownProps) {
+
+ Set<DiscoveredResourceDetails> results = super.discoverResources(context, skipUnknownProps);
+
+ for (DiscoveredResourceDetails discoveredResource : results) {
+
+ String name = getBeanConfiguredClassName(context, discoveredResource.getResourceKey());
+
+ name = name.substring(name.lastIndexOf(".") + 1);
+ name = name.substring(0, name.lastIndexOf("LoadMetric"));
+
+ discoveredResource.setResourceName(name);
+ discoveredResource.setResourceDescription("Load Metric");
+ }
+
+ return results;
+ }
+
+ /**
+ * @param context
+ * @param objectName
+ * @return
+ */
+ public String getBeanConfiguredClassName(ResourceDiscoveryContext<JMXComponent> context, String objectName) {
+ EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
+ EmsBean emsBean = loadBean(connection, objectName);
+
+ return emsBean.getClassTypeName();
+ }
+
+ /**
+ * Loads the bean with the given object name.
+ *
+ * Subclasses are free to override this method in order to load the bean.
+ *
+ * @param objectName the name of the bean to load
+ * @return the bean that is loaded
+ */
+ protected EmsBean loadBean(EmsConnection emsConnection, String objectName) {
+ EmsBean bean = emsConnection.getBean(objectName);
+ if (bean == null) {
+ // In some cases, this resource component may have been discovered by some means other than querying its
+ // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
+ // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
+ // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
+ // bean before giving up.
+ emsConnection.queryBeans(objectName);
+ bean = emsConnection.getBean(objectName);
+ }
+ return bean;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
index 70898ef..2c964c0 100644
--- a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/ModclusterServerComponent.java
@@ -20,6 +20,7 @@ package org.rhq.plugins.modcluster;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.modcluster.helper.JBossHelper;
/**
* @author Stefan Negrea
@@ -28,15 +29,21 @@ import org.rhq.plugins.jmx.MBeanResourceComponent;
@SuppressWarnings({ "rawtypes" })
public class ModclusterServerComponent extends MBeanResourceComponent {
+ //private final static String PROXY_INFO_PROPERTY_NAME
+
/* (non-Javadoc)
* @see org.rhq.plugins.jmx.MBeanResourceComponent#getAvailability()
*/
@Override
public AvailabilityType getAvailability() {
- String rawProxyInfo = (String) getEmsBean().getAttribute("proxyInfo").refresh().toString();
- ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ String rawProxyInfo = JBossHelper.getRawProxyInfo(getEmsBean());
+
+ if (rawProxyInfo == null) {
+ return AvailabilityType.DOWN;
+ }
- if (proxyInfo.getAvailableContexts().size() == 0) {
+ ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
+ if (proxyInfo.getAvailableNodes().size() == 0) {
return AvailabilityType.DOWN;
}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
new file mode 100644
index 0000000..8f5d08b
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/PolyPingMBeanResourceComponent.java
@@ -0,0 +1,35 @@
+package org.rhq.plugins.modcluster;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.
+ */
+
+public class PolyPingMBeanResourceComponent extends FileConfiguredMBeanResourceComponent {
+
+ @Override
+ public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
+ if (name.toLowerCase().startsWith("ping")) {
+ name = "ping";
+ }
+
+ return super.invokeOperation(name, parameters);
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
new file mode 100644
index 0000000..4fe5788
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/AbstractConfigurationFile.java
@@ -0,0 +1,63 @@
+/*
+ * 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.plugins.modcluster.config;
+
+import java.io.IOException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ *
+ * @author Stefan Negrea
+ */
+public abstract class AbstractConfigurationFile {
+
+ public static final String SERVER_HOME_DIR = "jboss.server.home.dir";
+
+ private String fileName;
+ private Document document;
+
+ public AbstractConfigurationFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
+ this.fileName = fileName;
+
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+ this.document = docBuilder.parse(this.getFileName());
+ }
+
+ /**
+ * @return the fileName
+ */
+ public String getFileName() {
+ return fileName;
+ }
+
+ /**
+ * @return the doc
+ */
+ public Document getDocument() {
+ return document;
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
new file mode 100644
index 0000000..602e52b
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/JBossWebServerFile.java
@@ -0,0 +1,39 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster.config;
+
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+public class JBossWebServerFile extends AbstractConfigurationFile {
+
+ public JBossWebServerFile(String fileName) throws ParserConfigurationException, SAXException, IOException {
+ super(fileName);
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
new file mode 100644
index 0000000..0e25f26
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/config/ModClusterBeanFile.java
@@ -0,0 +1,205 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster.config;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * @author snegrea
+ *
+ */
+public class ModClusterBeanFile extends AbstractConfigurationFile {
+
+ private Node beanNode;
+
+ public ModClusterBeanFile(String className) throws ParserConfigurationException, SAXException, IOException {
+ super(
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+
+ beanNode = this.getBeanNodeByClass(className);
+ }
+
+ public ModClusterBeanFile(String className, String constructorArgumentClassName)
+ throws ParserConfigurationException, SAXException, IOException {
+ super(
+ "/home/snegrea/Downloads/jboss51eap/jboss-as/server/all/deploy/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml");
+
+ Node primaryBeanNode = this.getBeanNodeByClass(className);
+ String dependencyName = this.getBeanFromConstructorArgument(primaryBeanNode, constructorArgumentClassName);
+
+ beanNode = this.getBeanNodeByName(dependencyName);
+ }
+
+ private String getBeanFromConstructorArgument(Node beanNode, String constructorArgumentClassName) {
+ List<Node> tempNodeList = this.getChildNodesByName(beanNode, "constructor");
+
+ if (tempNodeList.size() > 0) {
+ Node constructorNode = tempNodeList.get(0);
+
+ tempNodeList = this.getChildNodesByName(constructorNode, "parameter");
+
+ if (tempNodeList.size() > 0) {
+ Node parameterNode = null;
+
+ for (Node currentNode : tempNodeList) {
+ if (currentNode.getAttributes().getNamedItem("class") != null
+ && constructorArgumentClassName.equals(currentNode.getAttributes().getNamedItem("class")
+ .getTextContent())) {
+ parameterNode = currentNode;
+ break;
+ }
+ }
+
+ if (parameterNode != null) {
+ tempNodeList = this.getChildNodesByName(parameterNode, "inject");
+
+ if (tempNodeList.size() > 0) {
+ Node injectNode = tempNodeList.get(0);
+ Node beanAttribute = injectNode.getAttributes().getNamedItem("bean");
+
+ if (beanAttribute != null) {
+ return beanAttribute.getTextContent();
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private List<Node> getChildNodesByName(Node node, String nodeName) {
+ List<Node> listOfNodes = new ArrayList<Node>();
+
+ for (int i = 0; i < node.getChildNodes().getLength(); i++) {
+ Node currentNode = node.getChildNodes().item(i);
+
+ if (nodeName.equals(currentNode.getNodeName())) {
+ listOfNodes.add(currentNode);
+ }
+ }
+
+ return listOfNodes;
+ }
+
+ public void setPropertyValue(String propertyName, String value) {
+ boolean propertyFound = false;
+ for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
+ Node currentNode = beanNode.getChildNodes().item(i);
+
+ if (currentNode.getNodeName().equals("property")
+ && currentNode.getAttributes().getNamedItem("name") != null
+ && propertyName.equals(currentNode.getAttributes().getNamedItem("name").getTextContent())) {
+
+ if (value != null) {
+ currentNode.setTextContent(value);
+ } else {
+ beanNode.removeChild(currentNode);
+ }
+
+ propertyFound = true;
+ }
+ }
+
+ if (value != null && !propertyFound) {
+ Node propertyChild = this.getDocument().createElement("property");
+ Attr nameProperty = this.getDocument().createAttribute("name");
+ nameProperty.setValue(propertyName);
+ propertyChild.setTextContent(value);
+ propertyChild.getAttributes().setNamedItem(nameProperty);
+ beanNode.appendChild(propertyChild);
+ }
+ }
+
+ public String getPropertyValue(String propertyName) {
+ for (int i = 0; i < beanNode.getChildNodes().getLength(); i++) {
+ Node currentNode = beanNode.getChildNodes().item(i);
+
+ if (currentNode.getNodeName().equals("property")
+ && currentNode.getAttributes().getNamedItem("name") != null
+ && propertyName.equals(currentNode.getAttributes().getNamedItem("name").getTextContent())) {
+
+ return currentNode.getTextContent();
+ }
+ }
+
+ return null;
+ }
+
+ public void saveConfigFile() throws TransformerException {
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "no");
+
+ //initialize StreamResult with File object to save to file
+ StreamResult result = new StreamResult(new StringWriter());
+ DOMSource source = new DOMSource(this.getDocument());
+ transformer.transform(source, result);
+
+ String xmlString = result.getWriter().toString();
+ System.out.println(xmlString);
+ }
+
+ public Node getBeanNodeByClass(String className) {
+ NodeList result = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < result.getLength(); i++) {
+ Node node = result.item(i);
+ if (node.getAttributes().getNamedItem("class") != null
+ && className.equals(node.getAttributes().getNamedItem("class").getTextContent())) {
+ System.out.println(node.getAttributes().getNamedItem("class").getTextContent());
+ return node;
+ }
+ }
+
+ return null;
+ }
+
+ public Node getBeanNodeByName(String beanName) {
+ NodeList result = this.getDocument().getElementsByTagName("bean");
+
+ for (int i = 1; i < result.getLength(); i++) {
+ Node node = result.item(i);
+ if (node.getAttributes().getNamedItem("name") != null
+ && beanName.equals(node.getAttributes().getNamedItem("name").getTextContent())) {
+ System.out.println(node.getAttributes().getNamedItem("name").getTextContent());
+ return node;
+ }
+ }
+
+ return null;
+ }
+
+}
diff --git a/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java
new file mode 100644
index 0000000..364f3ef
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/main/java/org/rhq/plugins/modcluster/helper/JBossHelper.java
@@ -0,0 +1,49 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2009 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.plugins.modcluster.helper;
+
+import org.mc4j.ems.connection.bean.EmsBean;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+public class JBossHelper {
+
+ public static String getRawProxyInfo(EmsBean emsBean) {
+ String rawProxyInfo = null;
+
+ //try first to get the value for JBoss EAP5.x or AS6
+ try {
+ rawProxyInfo = (String) emsBean.getAttribute("ProxyInfo").refresh().toString();
+ } catch (Exception e) {
+ }
+
+ //if not able to get the value after the first attempt try to get the value for JBoss 4.2/4.3
+ if (rawProxyInfo == null) {
+ try {
+ rawProxyInfo = (String) emsBean.getAttribute("proxyInfo").refresh().toString();
+ } catch (Exception e) {
+ }
+ }
+
+ return rawProxyInfo;
+ }
+}
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 4846490..fe4ac7d 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -1,132 +1,466 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<plugin name="mod_cluster"
- displayName="mod_cluster"
- description="Monitoring and management of mod_cluster plugin."
- version="1.0"
- package="org.rhq.plugins.modcluster"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="urn:xmlns:rhq-plugin"
- xmlns:c="urn:xmlns:rhq-configuration">
+<plugin name="mod_cluster" displayName="mod_cluster" description="Monitoring and management of mod_cluster plugin." version="1.0" package="org.rhq.plugins.modcluster" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
<depends plugin="JMX" />
- <service name="mod_cluster"
- discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
- class="ModclusterServerComponent"
- supportsManualAdd="true"
- description="mod_cluster plugin"
- singleton="true">
-
+ <service name="mod_cluster" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="mod_cluster plugin" singleton="true">
+
<runs-inside>
- <parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
- <parent-resource-type name="JBossAS5 Server" plugin="JBossAS5"/>
+ <parent-resource-type name="JBossAS Server" plugin="JBossAS" />
+ <parent-resource-type name="JBossAS Server" plugin="JBossAS5" />
</runs-inside>
-
+
<plugin-configuration>
- <c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*"/>
- <c:simple-property name="engineObjectName" readOnly="true" default="jboss.web:type=Engine"/>
- <c:simple-property name="nameTemplate" default="mod_cluster"/>
+ <c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*|jboss.web:service=ModCluster" />
+ <c:simple-property name="engineObjectName" readOnly="true" default="jboss.web:type=Engine" />
+ <c:simple-property name="nameTemplate" default="mod_cluster" />
</plugin-configuration>
-
- <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
- <parameters>
- <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout"/>
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
- <c:property-options allowCustomValue="false">
- <c:option value="MICROSECONDS" name="MICROSECONDS"/>
- <c:option value="MILLISECONDS" name="MILLISECONDS"/>
- <c:option value="NANOSECONDS" name="NANOSECONDS"/>
- <c:option value="SECONDS" name="SECONDS"/>
- <c:option value="HOURS" name="HOURS"/>
- <c:option value="DAYS" name="DAYS"/>
- </c:property-options>
- </c:simple-property>
- </parameters>
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
- <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
- <parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address"/>
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port"/>
- </parameters>
- </operation>
- <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
+
<operation name="reset" displayName="Reset the node" description="Move this application server out of an error state." />
- <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
- <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
- <parameters>
- <c:simple-property required="true" name="host" type="string" displayName="Proxy address"/>
- <c:simple-property required="true" name="port" type="string" displayName="Proxy port"/>
- </parameters>
- </operation>
<operation name="refresh" displayName="Refresh configuration" description="Refresh configuration for this application server." />
-
- <metric property="proxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
- <metric property="modelerType" displayName="Type of the modeled resource" displayType="summary" dataType="trait" />
- <metric property="className" displayName="Fully qualified class name of the managed object" displayType="summary" dataType="trait" />
- <metric property="advertise" displayName="Enable autodiscovery of httpd servers." displayType="summary" dataType="trait" />
-
- <resource-configuration>
- <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
- <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the cluster."/>
- <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster."/>
- <c:simple-property name="smax" type="integer" description="Maximum time on seconds for idle connections above smax."/>
- <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server."/>
- <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery."/>
- <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node."/>
- <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer."/>
- <c:simple-property name="flushPackets" type="boolean" description="Allows controlling flusing of packets."/>
- <c:simple-property name="socketTimeout" type="integer" description="Connection timeout for communication with the proxy." />
- <c:simple-property name="advertisePort" type="integer" required="false" description="Multicast port for discovery" />
- <c:simple-property name="advertiseGroupAddress" type="string" required="false" description="Multicast address for discovery."/>
- <c:simple-property name="flushWait" type="integer" description="Time in ms to wait before flushing packets."/>
- <c:simple-property name="ping" type="integer" description="Time in s to wait for a pong answer to a ping."/>
- </resource-configuration>
-
- <service name="mod_cluster Webapp Context"
- discovery="ContextDiscoveryComponent"
- class="ContextComponent"
- description="mod_cluster webapp context">
-
- <operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation."/>
- </results>
- </operation>
- <operation name="stopContext" displayName="Stop webapp" description="Gracefully stops this webapp.">
+
+ <!-- Start - Configuration for HAModClusterService -->
+ <service name="HA Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ha.HAModClusterService" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <!-- HA Operations -->
+ <operation name="disableDomain" displayName="Disable domain" description="Disables all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
+ <results>
+ <c:simple-property name="result" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enableDomain" displayName="Enable domain" description="Enable all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="stopDomain" displayName="Stop domain" description="Gracefully stops all contexts on each node within the current domain. If the current domain is null, then all nodes are stopped.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="The number of units of time for which to wait for all sessions to drain on a given node." />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <!-- Regular Operations -->
+
+ <operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
+ <results>
+ <c:simple-property name="result" description="Map of PING_RPS response, grouped by proxy.">
+ </c:simple-property>
+ </results>
+ </operation>
+ <operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+ <operation name="pingNodeByAddress" displayName="Ping node by address"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+
+ <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" description="The result of the operation">
+ </c:simple-property>
+ </results>
+ </operation>
+ <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" description="The result of the operation">
+ </c:simple-property>
+ </results>
+ </operation>
+ <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <metric property="MasterNode" displayName="Master Node" displayType="summary" dataType="trait" />
+ <metric property="ProxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="ProxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
+
+ <resource-configuration>
+ <c:simple-property name="processStatusFrequency" type="integer" description="Process status frequency." />
+ </resource-configuration>
+ </service>
+
+ <service name="HA Service Configuration" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="HA Service Configuration" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service Configuration" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ha.HAModClusterService" />
+ <c:simple-property name="dependencyClassName" readOnly="true" default="org.jboss.modcluster.config.ha.HAModClusterConfig" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <resource-configuration>
+
+ <!-- HA Configuration -->
+ <c:simple-property name="masterPerLoadBalancingGroup" type="boolean" required="false" description="Enable current node to be master in the load balancing group." />
+
+ <!-- Handler Configuration -->
+ <c:simple-property name="advertise" type="boolean" required="false" default="false" description="Enable autodiscovery of httpd servers." />
+ <c:simple-property name="advertiseGroupAddress" type="string" description="Multicast address on which to listen for advertisements." />
+ <c:simple-property name="advertisePort" type="string" required="false" description="Multicast port for discovery" />
+ <c:simple-property name="advertiseInterface" type="string" required="false" description="Multicast interface for discovery" />
+ <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery." />
+ <c:simple-property name="proxyList" type="string" required="false" description="Comma separated list of address:port listing the httpd servers where mod_cluster is running." />
+ <c:simple-property name="proxyURL" type="string" required="false" description="URL prefix to send with commands to mod_cluster. Default is no prefix." />
+ <c:simple-property name="socketTimeout" type="integer" required="false" description="Connection timeout for communication with the proxy." />
+ <c:simple-property name="ssl" type="boolean" description="Whether to use SSL to communicate with mod_cluster. Note this has nothing to do with handling of https requests by JBoss Web" />
+ <c:simple-property name="excludedContexts" type="string" required="false" description="Comma delimited list of contexts that should *not* be auto-registered with httpd. Contexts may be qualified by host using a colon, e.g. host1:context1. If no host is defined, localhost is assumed." />
+ <c:simple-property name="autoEnableContexts" type="boolean" required="false" default="true" description="Toggle for context auto-enable during mod_cluster startup." />
+
+ <!-- Node Configuration -->
+ <c:simple-property name="loadBalancingGroup" type="string" required="false" description="Load balancing group." />
+ <c:simple-property name="flushPackets" type="boolean" required="false" description="Allows controlling flusing of packets." />
+ <c:simple-property name="flushWait" type="integer" required="false" description="Time in ms to wait before flushing packets." />
+ <c:simple-property name="ping" type="integer" required="false" description="Time in s to wait for a pong answer to a ping." />
+ <c:simple-property name="smax" type="integer" required="false" description="Maximum time on seconds for idle connections above smax." />
+ <c:simple-property name="ttl" type="integer" required="false" description="TTL" />
+ <c:simple-property name="nodeTimeout" type="integer" required="false" description="Node timeout" />
+ <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer" />
+
+ <!-- Balancer Configuration -->
+ <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the node." />
+ <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster." />
+ <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node." />
+ <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
+ <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server." />
+ </resource-configuration>
+ </service>
+ <!-- End - Configuration for HAModClusterService -->
+
+ <!-- Start - Configuration for ModClusterService -->
+ <service name="Service" discovery="ClassNameMBeanDiscoveryComponent" class="PolyPingMBeanResourceComponent" supportsManualAdd="true" description="HA Service Listener" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ModClusterService" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <operation name="pingHTTPD" displayName="Ping httpd" description="Ping httpd and determine whether each proxy is accessible and healthy. Returns the PING_RSP grouped by proxy address.">
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+ <operation name="pingNodeByJVMRoute" displayName="Ping node by JVM Route"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Dtermines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="jvmRoute" type="string" displayName="JVM Route of node to ping." />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+ <operation name="pingNodeByAddress" displayName="Ping node by address"
+ description="Ping a node from httpd and returns the PING_RSP grouped by proxy address. Determines whether the node configured with the specified jvm route is accessible from each proxy returning the PING_RSP grouped by proxy address.">
+ <parameters>
+ <c:simple-property required="true" name="scheme" type="string" displayName="Scheme (ajp, http, https)" />
+ <c:simple-property required="true" name="hostname" type="string" displayName="Name or ip address of a node." />
+ <c:simple-property required="true" name="port" type="string" displayName="Port" />
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="string" description="Map of PING_RPS response, grouped by proxy." />
+ </results>
+ </operation>
+
+ <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <metric property="ProxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="ProxyInfo" displayName="Proxy Info" displayType="summary" dataType="trait" />
+ </service>
+
+ <service name="Service Configuration" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="HA Service Configuration" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:service=ModCluster" />
+ <c:simple-property name="nameTemplate" default="HA Service Configuration" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.ModClusterService" />
+ <c:simple-property name="dependencyClassName" readOnly="true" default="org.jboss.modcluster.config.ModClusterConfig" />
+ <c:simple-property name="proxyInfoProperty" readOnly="true" default="ProxyInfo" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <!-- Handler Configuration -->
+ <c:simple-property name="advertise" type="boolean" required="false" default="false" description="Enable autodiscovery of httpd servers." />
+ <c:simple-property name="advertiseGroupAddress" type="string" description="Multicast address on which to listen for advertisements." />
+ <c:simple-property name="advertisePort" type="string" required="false" description="Multicast port for discovery" />
+ <c:simple-property name="advertiseInterface" type="string" required="false" description="Multicast interface for discovery" />
+ <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery." />
+ <c:simple-property name="proxyList" type="string" required="false" description="Comma separated list of address:port listing the httpd servers where mod_cluster is running." />
+ <c:simple-property name="proxyURL" type="string" required="false" description="URL prefix to send with commands to mod_cluster. Default is no prefix." />
+ <c:simple-property name="socketTimeout" type="integer" required="false" description="Connection timeout for communication with the proxy." />
+ <c:simple-property name="ssl" type="boolean" description="Whether to use SSL to communicate with mod_cluster. Note this has nothing to do with handling of https requests by JBoss Web" />
+ <c:simple-property name="excludedContexts" type="string" required="false"
+ description="Comma delimited list of contexts that should *not* be auto-registered with httpd. Contexts may be qualified by host using a colon, e.g. host1:context1. If no host is defined, localhost is assumed." />
+ <c:simple-property name="autoEnableContexts" type="boolean" required="false" default="true" description="Toggle for context auto-enable during mod_cluster startup." />
+
+ <!-- Node Configuration -->
+ <c:simple-property name="loadBalancingGroup" type="string" required="false" description="Load balancing group." />
+ <c:simple-property name="flushPackets" type="boolean" required="false" description="Allows controlling flusing of packets." />
+ <c:simple-property name="flushWait" type="integer" required="false" description="Time in ms to wait before flushing packets." />
+ <c:simple-property name="ping" type="integer" required="false" description="Time in s to wait for a pong answer to a ping." />
+ <c:simple-property name="smax" type="integer" required="false" description="Maximum time on seconds for idle connections above smax." />
+ <c:simple-property name="ttl" type="integer" required="false" description="TTL" />
+ <c:simple-property name="nodeTimeout" type="integer" required="false" description="Node timeout" />
+ <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer" />
+
+ <!-- Balancer Configuration -->
+ <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the node." />
+ <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster." />
+ <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node." />
+ <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
+ <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server." />
+ </resource-configuration>
+ </service>
+ <!-- End - Configuration for ModClusterService -->
+
+ <service name="Catalina Service" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="ModclusterServerComponent" supportsManualAdd="true" description="Catalina Service Listener" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="Catalina:type=ModClusterListener,*" />
+ <c:simple-property name="nameTemplate" default="mod_cluster Catalina Listener" />
+ </plugin-configuration>
+
+ <operation name="addProxy" displayName="Add a proxy" description="Add a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="removeProxy" displayName="Remove a proxy" description="Remove a proxy.">
+ <parameters>
+ <c:simple-property required="true" name="host" type="string" displayName="Proxy address" />
+ <c:simple-property required="true" name="port" type="string" displayName="Proxy port" />
+ </parameters>
+ </operation>
+ <operation name="disable" displayName="Disable all webpapps" description="Disable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enable" displayName="Enable all webapps" description="Enable all webapps for all virtual hosts of this application server.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="stop" displayName="Stop all webapps" description="Gracefully stops all webapps for all virtual hosts of this application server.">
+ <parameters>
+ <c:simple-property required="true" name="timeout" type="string" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+
+ <metric property="proxyConfiguration" displayName="Proxy Configuration" displayType="summary" dataType="trait" />
+ <metric property="modelerType" displayName="Type of the modeled resource" displayType="summary" dataType="trait" />
+ <metric property="className" displayName="Fully qualified class name of the managed object" displayType="summary" dataType="trait" />
+ <metric property="advertise" displayName="Enable autodiscovery of httpd servers." displayType="summary" dataType="trait" />
+
+ <resource-configuration>
+ <c:simple-property name="workerTimeout" type="integer" description="Timeout to wait for an available worker (default is no wait)." />
+ <c:simple-property name="stickySession" type="boolean" description="Enables sticky session for the cluster." />
+ <c:simple-property name="stickySessionRemove" type="boolean" description="Remove session when the request cannot be routed to the right node for this cluster." />
+ <c:simple-property name="smax" type="integer" description="Maximum time on seconds for idle connections above smax." />
+ <c:simple-property name="maxAttempts" type="integer" description="Maximum number of attempts to send the request to the backend server." />
+ <c:simple-property name="advertiseSecurityKey" type="string" required="false" description="Security key for discovery." />
+ <c:simple-property name="stickySessionForce" type="boolean" description="Return an error when the request cannot be routed to the right node." />
+ <c:simple-property name="balancer" type="string" required="false" description="Name of the balancer." />
+ <c:simple-property name="flushPackets" type="boolean" description="Allows controlling flusing of packets." />
+ <c:simple-property name="socketTimeout" type="integer" description="Connection timeout for communication with the proxy." />
+ <c:simple-property name="advertisePort" type="integer" required="false" description="Multicast port for discovery" />
+ <c:simple-property name="advertiseGroupAddress" type="string" required="false" description="Multicast address for discovery." />
+ <c:simple-property name="flushWait" type="integer" description="Time in ms to wait before flushing packets." />
+ <c:simple-property name="ping" type="integer" description="Time in s to wait for a pong answer to a ping." />
+ </resource-configuration>
+ </service>
+
+ <service name="Dynamic Load Balancer Factor" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="Dynamic Load balancer factor for mod_cluster" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,*" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProvider" />
+ <c:simple-property name="nameTemplate" default="Dynamic Load Balancer Factor" />
+ </plugin-configuration>
+
+ <metric property="Metrics" displayName="Collected Metrics" displayType="summary" dataType="trait" />
+
+ <resource-configuration>
+ <c:simple-property name="DecayFactor" type="integer" description="The number of historical load values used to determine load factor." />
+ <c:simple-property name="History" type="integer" description="The exponential decay factor for historical load values." />
+ </resource-configuration>
+ </service>
+
+ <service name="Simple Load Balancer Factor" discovery="ClassNameMBeanDiscoveryComponent" class="FileConfiguredMBeanResourceComponent" supportsManualAdd="true" description="Simple load balancer factor for mod_cluster" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,*" />
+ <c:simple-property name="className" readOnly="true" default="org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProvider" />
+ <c:simple-property name="nameTemplate" default="Simple Load Balancer Factor" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="loadBalanceFactor" type="integer" description="The load balance factor." />
+ </resource-configuration>
+ </service>
+
+ <service name="Load Metric" discovery="LoadMetricDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent" description="Load Metric">
+
+ <plugin-configuration>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.web:provider=LoadBalanceFactor,service=ModCluster,metric=*,*" />
+ <c:simple-property name="nameTemplate" default="Load Metric" />
+ </plugin-configuration>
+
+ <metric property="Load" displayName="Load" category="utilization" description="The current load of this metric as a percent of the metric's capacity." dataType="measurement" />
+
+ <resource-configuration>
+ <c:simple-property name="Weight" type="integer" description="The significance of this load metric compared to the other metrics." />
+ <c:simple-property name="Capacity" type="double" description="Used to normalize the value returned by load expressed as a percentage of the capacity, such that: 0 < (load/capacity) < 1" />
+ </resource-configuration>
+ </service>
+
+ <service name="Webapp Context" discovery="ContextDiscoveryComponent" class="ContextComponent" description="Webapp Context">
+
+ <operation name="disableContext" displayName="Disable webapp" description="Disable this webapp.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation." />
+ </results>
+ </operation>
+ <operation name="stopContext" displayName="Stop webapp" description="Gracefully stops this webapp.">
<parameters>
- <c:simple-property required="true" name="timeout" type="integer" displayName="Session draining timeout"/>
- <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
- <c:property-options allowCustomValue="false">
- <c:option value="MICROSECONDS" name="MICROSECONDS"/>
- <c:option value="MILLISECONDS" name="MILLISECONDS"/>
- <c:option value="NANOSECONDS" name="NANOSECONDS"/>
- <c:option value="SECONDS" name="SECONDS"/>
- <c:option value="HOURS" name="HOURS"/>
- <c:option value="DAYS" name="DAYS"/>
- </c:property-options>
- </c:simple-property>
+ <c:simple-property required="true" name="timeout" type="integer" displayName="Session draining timeout" />
+ <c:simple-property required="true" name="unit" default="MILLISECONDS" displayName="Time unit of the timeout parameter">
+ <c:property-options allowCustomValue="false">
+ <c:option value="MICROSECONDS" name="MICROSECONDS" />
+ <c:option value="MILLISECONDS" name="MILLISECONDS" />
+ <c:option value="NANOSECONDS" name="NANOSECONDS" />
+ <c:option value="SECONDS" name="SECONDS" />
+ <c:option value="HOURS" name="HOURS" />
+ <c:option value="DAYS" name="DAYS" />
+ </c:property-options>
+ </c:simple-property>
</parameters>
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
- <operation name="enableContext" displayName="Enable webapp" description="Enable this webapp.">
- <results>
- <c:simple-property name="result" type="boolean" description="The result of the operation" />
- </results>
- </operation>
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
+ <operation name="enableContext" displayName="Enable webapp" description="Enable this webapp.">
+ <results>
+ <c:simple-property name="result" type="boolean" description="The result of the operation" />
+ </results>
+ </operation>
</service>
</service>
diff --git a/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
new file mode 100644
index 0000000..4e4aac1
--- /dev/null
+++ b/modules/plugins/mod-cluster/src/test/java/org/rhq/plugins/modcluster/test/ServerConfigTest.java
@@ -0,0 +1,58 @@
+/*
+ * 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.plugins.modcluster.test;
+
+import org.testng.annotations.Test;
+
+import org.rhq.plugins.modcluster.config.ModClusterBeanFile;
+
+public class ServerConfigTest {
+
+ @Test
+ public void TestConfig() {
+
+ try {
+ ModClusterBeanFile config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService");
+ config.setPropertyValue("processStatusFrequency", "4");
+ config.setPropertyValue("test", "5");
+ config.setPropertyValue("test", "123");
+
+ System.out.println(config.getPropertyValue("test"));
+
+ config.saveConfigFile();
+
+ config = new ModClusterBeanFile("org.jboss.modcluster.ha.HAModClusterService",
+ "org.jboss.modcluster.config.ha.HAModClusterConfig");
+ config.setPropertyValue("processStatusFrequency", "4");
+ config.setPropertyValue("test", "5");
+ config.setPropertyValue("test", "123");
+
+ System.out.println(config.getPropertyValue("test"));
+
+ config.saveConfigFile();
+
+ config.setPropertyValue("test", null);
+ config.saveConfigFile();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
commit f9107f719e5fa14265be4e4f6e2ed4c4d7f8a509
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 14 12:03:44 2011 -0500
With JBoss 5, the timeout is blocking the operation call for the period set. Reduce this period for these integration tests.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index dc98d78..0a39eab 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -168,7 +168,7 @@ public class ModclusterPluginTest {
log.info("Result of operation " + "enableContext" + " was: " + result.getSimpleResult());
Configuration config = new Configuration();
- config.put(new PropertySimple("timeout", "1000"));
+ config.put(new PropertySimple("timeout", "1"));
config.put(new PropertySimple("unit", java.util.concurrent.TimeUnit.SECONDS));
result = ((OperationFacet) resourceComponent).invokeOperation("stopContext", config);
log.info("Result of operation stopContext was: " + result.getSimpleResult());
commit 47ccc7a36d1dbce6c2e99ef5a83ec1bfcd250988
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sun Aug 14 12:02:34 2011 -0500
Add jar dependencies for testing with JBoss 5&6.
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
index 0cc3f4f..77a81b2 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/pom.xml
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -17,9 +17,37 @@
<properties>
<scm.module.path>modules/integration-tests/mod_cluster-plugin-test</scm.module.path>
+ <!-- jbossas.version>6.0.0.20100429-M3</jbossas.version-->
+ <jbossas.version>6.0.0.M1</jbossas.version>
+
</properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-parent</artifactId>
+ <version>${jbossas.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-component-matrix</artifactId>
+ <version>${jbossas.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
<dependencies>
+
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-profileservice-spi</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>${rhq.groupId}</groupId>
@@ -41,6 +69,213 @@
<version>1.2.14</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.naming</groupId>
+ <artifactId>jnp-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-aspects</artifactId>
+ <version>5.1.0.CR1</version>
+ <classifier>jboss-aspect-jdk50-client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>trove</groupId>
+ <artifactId>trove</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-security-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-javaee</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <dependency>
+ <groupId>oswego-concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <version>1.3.4-jboss</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-server</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <!-- dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-security</artifactId>
+ <version>5.1.0.CR1</version>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-transaction-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-common</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-core</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-ext-api</artifactId>
+ <version>1.0.0</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-proxy-spi</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-proxy-impl</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-security</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <!-- dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbosssx-client</artifactId>
+ <scope>test</scope>
+ </dependency-->
+
+ <dependency>
+ <groupId>org.jboss.aspects</groupId>
+ <artifactId>jboss-security-aspects</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-serialization</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-profileservice</artifactId>
+ <classifier>client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-server</artifactId>
+ <classifier>jmx-invoker-adaptor-client</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>jboss.messaging</groupId>
+ <artifactId>jboss-messaging-client</artifactId>
+ <scope>test</scope>
+ </dependency-->
</dependencies>
commit 58bcfd2f5c502b59f4a362f05daa20e6a3c4ac0b
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Aug 10 18:04:02 2011 -0500
Get the integration tests to compile and run again by creating the maven module and deploying the correct resources to target folder.
diff --git a/.classpath b/.classpath
index a46eaf4..e5225db 100644
--- a/.classpath
+++ b/.classpath
@@ -280,5 +280,6 @@
<classpathentry kind="src" path="modules/plugins/jboss-as-7/src/main/java"/>
<classpathentry kind="src" path="modules/plugins/jboss-as-7/src/test/java"/>
<classpathentry kind="src" path="modules/integration-tests/jboss-as-7-plugin-test/src/test/java"/>
+ <classpathentry kind="src" path="modules/integration-tests/mod_cluster-plugin-test/src/test/java"/>
<classpathentry kind="output" path="eclipse-classes"/>
</classpath>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
new file mode 100644
index 0000000..0cc3f4f
--- /dev/null
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -0,0 +1,155 @@
+<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-plugins-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>modcluster-plugin-test</artifactId>
+ <packaging>jar</packaging>
+
+ <name>RHQ mod_cluster Plugin Integration Test</name>
+ <description>Integration tests for mod_cluster RHQ Agent plugin</description>
+
+ <properties>
+ <scm.module.path>modules/integration-tests/mod_cluster-plugin-test</scm.module.path>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-jmx-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>modcluster-plugin</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+
+ <profile>
+ <id>integration-tests</id>
+ <activation>
+ <property>
+ <name>maven.test.skip</name>
+ <value>!true</value>
+ </property>
+ </activation>
+
+ <properties>
+ <rhq.rootDir>../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <tasks>
+ <echo>Setting up plugin dependencies...</echo>
+ <property name="settings.localRepository" location="${user.home}/.m2/repository" />
+ <mkdir dir="target/testsetup" />
+
+ <mkdir dir="target/testsetup/plugins" />
+ <copy toDir="target/testsetup/plugins" flatten="true">
+ <fileset dir="${settings.localRepository}/">
+ <include name="org/rhq/rhq-platform-plugin/${project.version}/rhq-platform-plugin-${project.version}.jar" />
+ <include name="org/rhq/rhq-jmx-plugin/${project.version}/rhq-jmx-plugin-${project.version}.jar" />
+ <include name="org/jboss/on/jopr-jboss-as-plugin/${project.version}/jopr-jboss-as-plugin-${project.version}.jar" />
+ <include name="org/jboss/on/jopr-jboss-as-5-plugin/${project.version}/jopr-jboss-as-5-plugin-${project.version}.jar" />
+ <include name="org/rhq/modcluster-plugin/${project.version}/modcluster-plugin-${project.version}.jar" />
+ </fileset>
+ <fileset dir="${rhq.deploymentDir}">
+ <include name="${project.artifactId}-${project.version}.jar" />
+ </fileset>
+ </copy>
+
+ <mkdir dir="target/testsetup/lib" />
+ <unzip dest="target/testsetup/lib">
+ <fileset dir="${settings.localRepository}/org/hyperic/sigar-dist/${sigar.version}" includes="*.zip" />
+ <patternset>
+ <include name="**/lib/sigar.jar" />
+ <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="target/testsetup/lib" flatten="true">
+ <fileset dir="target/testsetup/lib">
+ <include name="**/lib/*" />
+ </fileset>
+ </move>
+ <delete dir="target/testsetup/lib/hyperic-sigar-${sigar.version}" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${maven.test.skip}</skip>
+ <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
+ <useSystemClassLoader>false</useSystemClassLoader>
+ <argLine>-Dorg.hyperic.sigar.path=${basedir}/target/testsetup/lib</argLine>
+ <systemProperties>
+ <property>
+ <name>project.artifactId</name>
+ <value>${project.artifactId}</value>
+ </property>
+ <property>
+ <name>project.version</name>
+ <value>${project.version}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
index 0f644fc..dc98d78 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
+++ b/modules/integration-tests/mod_cluster-plugin-test/src/test/java/org/rhq/plugins/modcluster/test/ModclusterPluginTest.java
@@ -148,10 +148,12 @@ public class ModclusterPluginTest {
}
if (resourceComponent instanceof OperationFacet) {
- OperationResult result = ((OperationFacet) resourceComponent).invokeOperation("reset", null);
+ OperationResult result = null;
+
+ result = ((OperationFacet) resourceComponent).invokeOperation("reset", new Configuration());
log.info("Result of operation test was: " + result);
- result = ((OperationFacet) resourceComponent).invokeOperation("disable", null);
+ result = ((OperationFacet) resourceComponent).invokeOperation("disable", new Configuration());
log.info("Result of operation test was: " + result.getSimpleResult());
}
}
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index ab52e84..fdc4f37 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -56,51 +56,6 @@
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
- <execution>
- <phase>process-test-resources</phase>
- <configuration>
- <tasks>
- <echo>Setting up plugin dependencies...</echo>
- <property name="settings.localRepository" location="${user.home}/.m2/repository" />
- <mkdir dir="target/testsetup" />
-
- <mkdir dir="target/testsetup/plugins" />
- <copy toDir="target/testsetup/plugins" flatten="true">
- <fileset dir="${settings.localRepository}/">
- <include name="org/rhq/rhq-platform-plugin/${project.version}/rhq-platform-plugin-${project.version}.jar" />
- <include name="org/rhq/rhq-jmx-plugin/${project.version}/rhq-jmx-plugin-${project.version}.jar" />
- <include name="org/jboss/on/jopr-jboss-as-plugin/${project.version}/jopr-jboss-as-plugin-${project.version}.jar" />
- <include name="org/jboss/on/jopr-jboss-as-5-plugin/${project.version}/jopr-jboss-as-5-plugin-${project.version}.jar" />
- </fileset>
- <fileset dir="${rhq.deploymentDir}">
- <include name="${project.artifactId}-${project.version}.jar" />
- </fileset>
- </copy>
-
- <mkdir dir="target/testsetup/lib" />
- <unzip dest="target/testsetup/lib">
- <fileset dir="${settings.localRepository}/org/hyperic/sigar-dist/${sigar.version}" includes="*.zip" />
- <patternset>
- <include name="**/lib/sigar.jar" />
- <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="target/testsetup/lib" flatten="true">
- <fileset dir="target/testsetup/lib">
- <include name="**/lib/*" />
- </fileset>
- </move>
- <delete dir="target/testsetup/lib/hyperic-sigar-${sigar.version}" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
<execution>
<id>deploy</id>
@@ -203,12 +158,10 @@
<build>
<plugins>
-
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
-
<execution>
<id>deploy</id>
<phase>compile</phase>
@@ -258,14 +211,10 @@
<goal>run</goal>
</goals>
</execution>
-
</executions>
</plugin>
-
</plugins>
</build>
</profile>
-
</profiles>
-
</project>
12 years, 8 months