summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Negrea <snegrea@redhat.com>2012-08-29 04:33:45 (GMT)
committerStefan Negrea <snegrea@redhat.com>2012-08-29 04:33:45 (GMT)
commit96602db100b087e36016b1aa6a2e39780b583898 (patch)
tree054822be7a076527d6fe3cb8647ed386beb9ec00
parentb8d890aaf85b9d3f74eb60d1bad32af02d030759 (diff)
downloadrhq-96602db100b087e36016b1aa6a2e39780b583898.zip
rhq-96602db100b087e36016b1aa6a2e39780b583898.tar.gz
rhq-96602db100b087e36016b1aa6a2e39780b583898.tar.xz
[BZ 852552] Adding special validation for the transaction subsystem.
The special case for this subsystem: If [process-id-uuid] == true then do not send updates for [process-id-socket-binding], this property will be undefined by the AS7 on the next reload/restart If [process-id-uuid] == false then allow AS7 to perform property validation * If [process-id-uuid] == false then send [process-id-socket-binding] value and allow AS7 to perform property validation
-rw-r--r--modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/TransactionsComponent.java62
-rw-r--r--modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml6
2 files changed, 65 insertions, 3 deletions
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/TransactionsComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/TransactionsComponent.java
new file mode 100644
index 0000000..102118b
--- /dev/null
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/TransactionsComponent.java
@@ -0,0 +1,62 @@
+/*
+ * RHQ Management Platform
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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.modules.plugins.jbossas7;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+
+/**
+ * Support for transactions subsystem configuration updates.
+ *
+ * The special case for this subsystem:
+ *
+ * If [process-id-uuid] == true then do not send updates for [process-id-socket-binding], this property
+ * will be undefined by the AS7 on the next server reload/restart
+ *
+ * If [process-id-uuid] == false then send [process-id-socket-binding] value and
+ * allow AS7 to perform property validation
+ *
+ *
+ * @author Stefan Negrea
+ */
+public class TransactionsComponent extends BaseComponent<ResourceComponent<?>> {
+
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ Configuration config = report.getConfiguration();
+ ConfigurationDefinition configDef = context.getResourceType().getResourceConfigurationDefinition();
+
+ boolean processIdUuid = Boolean.valueOf(config.getSimpleValue("process-id-uuid"));
+ if (processIdUuid == true) {
+ //Do not even send the updates for [process-id-socket-binding] because the AS7 will
+ //undefine it during the next reload/restart.
+ //Also, sending null for [process-id-socket-binding] with [process-id-uuid] == true causes
+ //a validation error on the server.
+ configDef.getPropertyDefinitions().remove("process-id-socket-binding");
+ config.remove("process-id-socket-binding");
+ }
+
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(configDef, getASConnection(), address);
+ delegate.updateResourceConfiguration(report);
+ }
+}
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index 0f150a4..29ef057 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -8338,7 +8338,7 @@
<service name="Transactions Subsystem (Standalone)"
discovery="SubsystemDiscovery"
- class="BaseComponent"
+ class="TransactionsComponent"
singleton="true"
description="The transactions subsystem.">
@@ -8460,7 +8460,7 @@
<service name="Transactions Subsystem (Profile)"
discovery="SubsystemDiscovery"
- class="BaseComponent"
+ class="TransactionsComponent"
singleton="true"
description="The transactions subsystem.">
@@ -8516,7 +8516,7 @@
<service name="Transactions Subsystem (Managed)"
discovery="SubsystemDiscovery"
- class="BaseComponent"
+ class="TransactionsComponent"
singleton="true"
description="The transactions subsystem.">