modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
| 31 +
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java
| 17
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConnectorDiscoveryGroupValidatorComponent.java
| 83 ++++
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java
| 43 ++
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HornetQComponent.java
| 27 -
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java
| 7
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JmsComponent.java
| 32 -
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SocketBindingGroupComponent.java
| 11
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java
| 56 ++-
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/TransactionsComponent.java
| 62 +++
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
| 175 ++++++----
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationUpdatingTest.java
| 21 -
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
| 3
13 files changed, 411 insertions(+), 157 deletions(-)
New commits:
commit c6c1e7819fbd8f667649223e12355e66ddd33252
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Aug 29 03:06:38 2012 -0500
[BZ 852632] Remove allow-direct-connections-only property from configuration to
prevent sending the value to the application server. If this property is not left
undefined, the configuration file for the server becomes invalid if the user attempts to
use discovery-group-name.
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 01618e2..46b3084 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
@@ -4714,7 +4714,6 @@
<metric property="started" dataType="trait"
description="Whether the cluster connection is started."/>
<resource-configuration>
- <c:simple-property name="allow-direct-connections-only"
required="false" type="boolean" readOnly="true"
defaultValue="false" description="Whether, if a node learns of the
existence of a node that is more than 1 hop away, we do not create a bridge for direct
cluster connection. Only relevant if 'static-connectors' is
defined. The default value is false."/>
<c:simple-property name="call-timeout"
required="false" type="long" readOnly="true"
defaultValue="30000" description="The timeout (in ms) for remote calls made
by the cluster connection. The default value is 30000."/>
<c:simple-property name="check-period"
required="false" type="long" readOnly="true"
defaultValue="30000" description="The period (in milliseconds) between
client failure check. The default value is 30000."/>
<c:simple-property name="cluster-connection-address"
required="true" type="string" readOnly="true"
description="Each cluster connection only applies to messages sent to an address that
starts with this value."/>
@@ -6843,7 +6842,6 @@
</plugin-configuration>
<resource-configuration>
- <c:simple-property name="allow-direct-connections-only"
required="false" type="boolean" readOnly="false"
defaultValue="false" description="Whether, if a node learns of the
existence of a node that is more than 1 hop away, we do not create a bridge for direct
cluster connection. Only relevant if 'static-connectors' is
defined. The default value is false."/>
<c:simple-property name="call-timeout"
required="false" type="long" readOnly="false"
defaultValue="30000" description="The timeout (in ms) for remote calls made
by the cluster connection. The default value is 30000."/>
<c:simple-property name="check-period"
required="false" type="long" readOnly="false"
defaultValue="30000" description="The period (in milliseconds) between
client failure check. The default value is 30000."/>
<c:simple-property name="cluster-connection-address"
required="true" type="string" readOnly="false"
description="Each cluster connection only applies to messages sent to an address that
starts with this value."/>
@@ -12948,7 +12946,6 @@
<metric property="started" dataType="trait"
description="Whether the cluster connection is started."/>
<resource-configuration>
- <c:simple-property name="allow-direct-connections-only"
required="false" type="boolean" readOnly="false"
defaultValue="false" description="Whether, if a node learns of the
existence of a node that is more than 1 hop away, we do not create a bridge for direct
cluster connection. Only relevant if 'static-connectors' is
defined. The default value is false."/>
<c:simple-property name="call-timeout" required="false"
type="long" readOnly="false" defaultValue="30000"
description="The timeout (in ms) for remote calls made by the cluster connection. The
default value is 30000."/>
<c:simple-property name="check-period" required="false"
type="long" readOnly="false" defaultValue="30000"
description="The period (in milliseconds) between client failure check. The default
value is 30000."/>
<c:simple-property name="cluster-connection-address"
required="true" type="string" readOnly="false"
description="Each cluster connection only applies to messages sent to an address that
starts with this value."/>
commit 74aa0f7f9b0f2dd1044450d924f61b3faee78c27
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Aug 29 02:52:42 2012 -0500
[BZ 852552] Updates to set correctly all the data-source and xa-data-source properties
that do not support null values and cannot be undefined.
While these properties look undefined in the server, they cannot undefined or set to
null at any point in time. The application server makes use of the default value at all
times.
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java
index a4efae1..5011120 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DatasourceComponent.java
@@ -13,6 +13,9 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.Property;
import org.rhq.core.domain.configuration.PropertyList;
import org.rhq.core.domain.configuration.PropertyMap;
+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.domain.measurement.MeasurementDataNumeric;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
import org.rhq.core.domain.measurement.MeasurementReport;
@@ -174,6 +177,27 @@ public class DatasourceComponent extends
BaseComponent<BaseComponent<?>> impleme
}
}
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ Configuration config = report.getConfiguration();
+ ConfigurationDefinition configDef =
context.getResourceType().getResourceConfigurationDefinition();
+
+ //These properties cannot be undefined once set.
+ //Also the AS7 server does not accept null values even if the properties are
still unset.
+ replaceWithDefaultIfNull("max-pool-size", config, configDef);
+ replaceWithDefaultIfNull("min-pool-size", config, configDef);
+ replaceWithDefaultIfNull("pool-prefill", config, configDef);
+ replaceWithDefaultIfNull("pool-use-strict-min", config, configDef);
+ replaceWithDefaultIfNull("blocking-timeout-wait-millis", config,
configDef);
+ replaceWithDefaultIfNull("idle-timeout-minutes", config, configDef);
+ replaceWithDefaultIfNull("background-validation-millis", config,
configDef);
+ replaceWithDefaultIfNull("background-validation-minutes", config,
configDef);
+ replaceWithDefaultIfNull("background-validation", config, configDef);
+
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(configDef,
getASConnection(), address);
+ delegate.updateResourceConfiguration(report);
+ }
+
private void getRCAsMetric(MeasurementReport report, MeasurementScheduleRequest
request) {
Operation op = new ReadAttribute(getAddress(), request.getName());
Result res = getASConnection().execute(op);
@@ -204,4 +228,23 @@ public class DatasourceComponent extends
BaseComponent<BaseComponent<?>> impleme
return trait;
}
+
+ /**
+ * Replace the value configured by the user with the default value from the resource
descriptor if
+ * the value to be sent to the server is null or empty.
+ *
+ * @param propertyName property name
+ * @param config configuration update
+ * @param configDef configuration definition
+ */
+ private void replaceWithDefaultIfNull(String propertyName, Configuration config,
ConfigurationDefinition configDef) {
+ PropertyDefinitionSimple propertyDefinition =
configDef.getPropertyDefinitionSimple(propertyName);
+
+ if (propertyDefinition != null) {
+ String propertyValue = config.getSimpleValue(propertyName);
+ if (propertyValue == null || propertyValue.isEmpty()) {
+ config.put(new PropertySimple(propertyName,
propertyDefinition.getDefaultValue()));
+ }
+ }
+ }
}
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 29ef057..01618e2 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
@@ -412,10 +412,10 @@
<c:simple-property name="use-java-context" type="boolean"
readOnly="false" required="false" default="true"
description="Setting this to false will bind the DataSource into global
JNDI;"/>
<c:simple-property name="enabled" type="boolean"
readOnly="true" required="false" description="Specifies if the
datasource should be enabled"/>
<c:simple-property name="jta" type="boolean"
readOnly="false" required="false" default="true"
description="Enable JTA integration"/>
- <c:simple-property name="max-pool-size" type="integer"
readOnly="false" required="false" description="The max-pool-size
element indicates the maximum number of connections for a pool. No more connections will
be created in each sub-pool."/>
- <c:simple-property name="min-pool-size" type="integer"
readOnly="false" required="false" description="The min-pool-size
element indicates the minimum number of connections a pool should hold. These are not
created until a Subject is known from a request for a connection."/>
- <c:simple-property name="pool-prefill" type="boolean"
readOnly="false" required="false" default="false"
description="Whether to attempt to prefill the connection pool. Changing this value
require a server restart."/>
- <c:simple-property name="pool-use-strict-min"
type="boolean" readOnly="false" required="false"
default="false" description="Define if the min-pool-size should be
considered a strictly."/>
+ <c:simple-property name="max-pool-size" type="integer"
readOnly="false" required="false" defaultValue="20"
description="The max-pool-size element indicates the maximum number of connections
for a pool. No more connections will be created in each sub-pool."/>
+ <c:simple-property name="min-pool-size" type="integer"
readOnly="false" required="false" defaultValue="0"
description="The min-pool-size element indicates the minimum number of connections a
pool should hold. These are not created until a Subject is known from a request for a
connection."/>
+ <c:simple-property name="pool-prefill" type="boolean"
readOnly="false" required="false" defaultValue="false"
description="Whether to attempt to prefill the connection pool. Changing this value
require a server restart."/>
+ <c:simple-property name="pool-use-strict-min"
type="boolean" readOnly="false" required="false"
defaultValue="false" description="Define if the min-pool-size should be
considered a strictly."/>
<c:simple-property name="security-domain" required="false"
type="string" readOnly="false" description="Indicates Subject
(from security domain) are used to distinguish connections in the pool. The content of the
security-domain is the name of the JAAS security manager that will handleauthentication.
This name correlates to the JAAS login-config.xml descriptor application-policy/name
attribute."/>
<c:simple-property name="reauth-plugin-class-name"
required="false" type="string" readOnly="false"
description="re-authentication plugin implementation provided for specific purpose
(i.e vendor)"/>
<!--
@@ -433,7 +433,7 @@
</c:simple-property>
<c:simple-property name="allow-multiple-users"
type="boolean" required="false" readOnly="false"
description="Specifies if multiple users will access the datasource through the
getConnection(user, password) method and hence if the internal pool type should account
for that"/>
- <c:simple-property name="prepared-statements-cacheSize"
type="long" readOnly="false" required="false"
description="The number of prepared statements per connection in an LRU
cache"/>
+ <c:simple-property name="prepared-statements-cache-size"
type="long" readOnly="false" required="false"
description="The number of prepared statements per connection in an LRU
cache"/>
<c:simple-property name="share-prepared-statements"
type="boolean" readOnly="false" required="false"
default="false" description="Whether to share prepare statements, i.e.
whether asking for same statement twice without closing uses the same underlying prepared
statement"/>
<c:simple-property name="track-statements" type="string"
readOnly="false" required="false" description="Whether to check
for unclosed statements when a connection is returned to the pool and result sets are
closed when a statement is closed/return to the prepared statement cache. valid values
are: false - do not track statements and results true - track statements and result sets
and warn when they are not closed nowarn - track statements but do no warn about them
being unclosed">
<c:property-options>
@@ -444,8 +444,8 @@
</c:simple-property>
<c:simple-property name="allocation-retry" type="integer"
readOnly="false" required="false" description="The allocation
retry element indicates the number of times that allocating a connection should be tried
before throwing an exception."/>
<c:simple-property name="allocation-retry-wait-millis"
type="long" readOnly="false" required="false"
description="Indicates the time in milliseconds to wait between retrying to allocate
a connection."/>
- <c:simple-property name="blocking-timeout-wait-millis"
type="long" readOnly="false" required="false"
description="The blocking-timeout-millis element indicates the maximum time in
milliseconds to block while waiting for a connection before throwing an exception. Note
that this blocks only while waiting for a permit for a connection, and will never throw an
exception if creating a new connection takes an inordinately long time."/>
- <c:simple-property name="idle-timeout-minutes" type="long"
readOnly="false" required="false" description="The
idle-timeout-minutes elements indicates the maximum time in minutes a connection may be
idle before being closed. The actual maximum time depends also on the IdleRemover scan
time, which is 1/2 the smallest idle-timeout-minutes of any pool. Changing this value
require a server restart."/>
+ <c:simple-property name="blocking-timeout-wait-millis"
type="long" readOnly="false" required="false"
defaultValue="30000" description="The blocking-timeout-millis element
indicates the maximum time in milliseconds to block while waiting for a connection before
throwing an exception. Note that this blocks only while waiting for a permit for a
connection, and will never throw an exception if creating a new connection takes an
inordinately long time."/>
+ <c:simple-property name="idle-timeout-minutes" type="long"
readOnly="false" required="false" defaultValue="15"
description="The idle-timeout-minutes elements indicates the maximum time in minutes
a connection may be idle before being closed. The actual maximum time depends also on the
IdleRemover scan time, which is 1/2 the smallest idle-timeout-minutes of any pool.
Changing this value require a server restart."/>
<c:simple-property name="query-timeout" type="long"
readOnly="false" required="false" description="Any configured
query timeout in seconds The default is no timeout"/>
<c:simple-property name="use-try-lock" type="long"
readOnly="false" required="false" description="Any configured
timeout for internal locks on the resource adapter objects in seconds"/>
<c:simple-property name="set-tx-query-timeout"
type="boolean" readOnly="false" required="false"
default="false" description="Whether to set the query timeout based on the
time remaining until transaction timeout, any configured query timeout will be used if
there is no transaction."/>
@@ -462,8 +462,8 @@
<c:simple-property name="exception-sorter-class-name"
type="string" readOnly="false" required="false"
description="An org.jboss.jca.adapters.jdbc.ExceptionSorter that provides a boolean
isExceptionFatal(SQLException e) method to validate is an exception should be broadcast to
all javax.resource.spi.ConnectionEventListener as a connectionErrorOccurred"/>
<c:simple-property name="stale-connection-checker-class-name"
type="string" readOnly="false" required="false"
description="An org.jboss.jca.adapters.jdbc.StaleConnectionChecker that provides a
boolean isStaleConnection(SQLException e) method which if it it returns true will wrap the
exception in an org.jboss.jca.adapters.jdbc.StaleConnectionException"/>
<c:simple-property name="valid-connection-checker-class-name"
type="string" readOnly="false" required="false"
description="An org.jboss.jca.adapters.jdbc.ValidConnectionChecker that provides a
SQLException isValidConnection(Connection e) method to validate is a connection is valid.
An exception means the connection is destroyed. This overrides the
check-valid-connection-sql when present."/>
- <c:simple-property name="background-validation-millis"
type="long" readOnly="false" required="false"
description="The background-validation-minutes element specifies the amount of time,
in minutes, that background validation will run. Changing this value require a server
restart."/>
- <c:simple-property name="background-validation"
type="boolean" readOnly="false" required="false"
default="false" description="An element to specify that connections should
be validated on a background thread versus being validated prior to use. Changing this
value require a server restart."/>
+ <c:simple-property name="background-validation-millis"
type="long" readOnly="false" required="false"
defaultValue="600000" description="The background-validation-minutes
element specifies the amount of time, in minutes, that background validation will run.
Changing this value require a server restart."/>
+ <c:simple-property name="background-validation"
type="boolean" readOnly="false" required="false"
defaultValue="false" description="An element to specify that connections
should be validated on a background thread versus being validated prior to use. Changing
this value require a server restart."/>
<c:simple-property name="use-fast-fail" type="boolean"
readOnly="false" required="false" description="Whether fail a
connection allocation on the first connection if it is invalid (true) or keep trying until
the pool is exhausted of all potential connections (false)"/>
<c:simple-property name="validate-on-match" type="boolean"
readOnly="false" required="false" default="false"
description="The validate-on-match element indicates whether or not connection level
validation should be done when a connection factory attempts to match a managed connection
for a given set. This is typically exclusive to the use of background
validation"/>
<c:simple-property name="spy" type="boolean"
readOnly="false" required="false" defaultValue="false"
description="whatever spy or not the jdbc connection"/>
@@ -515,7 +515,7 @@
</c:property-options>
</c:simple-property>
- <c:simple-property name="prepared-statements-cacheSize"
type="long" readOnly="true" required="false"
description="The number of prepared statements per connection in an LRU
cache"/>
+ <c:simple-property name="prepared-statements-cache-size"
type="long" readOnly="true" required="false"
description="The number of prepared statements per connection in an LRU
cache"/>
<c:simple-property name="share-prepared-statements"
type="boolean" readOnly="true" required="false"
description="Whether to share prepare statements, i.e. whether asking for same
statement twice without closing uses the same underlying prepared statement"/>
<c:simple-property name="track-statements" type="string"
readOnly="true" required="false" description="Whether to check
for unclosed statements when a connection is returned to the pool and result sets are
closed when a statement is closed/return to the prepared statement cache. valid values
are: false - do not track statements and results true - track statements and result sets
and warn when they are not closed nowarn - track statements but do no warn about them
being unclosed"/>
<c:simple-property name="allocation-retry" type="integer"
readOnly="true" required="false" description="The allocation
retry element indicates the number of times that allocating a connection should be tried
before throwing an exception."/>
@@ -570,10 +570,10 @@
<c:simple-property name="url-selector-strategy-class-name"
required="false" type="string" readOnly="true"
description="A class that implements
org.jboss.jca.adapters.jdbc.URLSelectorStrategy"/>
<c:simple-property name="use-java-context"
required="false" type="boolean" readOnly="true"
description="Setting this to false will bind the DataSource into global
JNDI;"/>
<c:simple-property name="enabled" required="false"
type="boolean" readOnly="true" description="Specifies if the
datasource should be enabled"/>
- <c:simple-property name="max-pool-size" required="false"
type="integer" readOnly="false" description="The max-pool-size
element indicates the maximum number of connections for a pool. No more connections will
be created in each sub-pool."/>
- <c:simple-property name="min-pool-size" required="false"
type="integer" readOnly="false" description="The min-pool-size
element indicates the minimum number of connections a pool should hold. These are not
created until a Subject is known from a request for a connection."/>
- <c:simple-property name="pool-prefill" required="false"
type="boolean" readOnly="false" description="Whether to attempt
to prefill the connection pool. Changing this value require a server restart."/>
- <c:simple-property name="pool-use-strict-min"
required="false" type="boolean" readOnly="false"
description="Define if the min-pool-size should be considered a strictly."/>
+ <c:simple-property name="max-pool-size" required="false"
type="integer" readOnly="false" defaultValue="20"
description="The max-pool-size element indicates the maximum number of connections
for a pool. No more connections will be created in each sub-pool."/>
+ <c:simple-property name="min-pool-size" required="false"
type="integer" readOnly="false" defaultValue="0"
description="The min-pool-size element indicates the minimum number of connections a
pool should hold. These are not created until a Subject is known from a request for a
connection."/>
+ <c:simple-property name="pool-prefill" required="false"
type="boolean" readOnly="false" defaultValue="false"
description="Whether to attempt to prefill the connection pool. Changing this value
require a server restart."/>
+ <c:simple-property name="pool-use-strict-min"
required="false" type="boolean" readOnly="false"
defaultValue="false" description="Define if the min-pool-size should be
considered a strictly."/>
<c:simple-property name="interleaving" required="false"
type="boolean" readOnly="true" description="An element to enable
interleaving for XA connection factories"/>
<c:simple-property name="no-tx-separate-pool"
required="false" type="boolean" readOnly="true"
description="Oracle does not like XA connections getting used both inside and outside
a JTA transaction. To workaround the problem you can create separate sub-pools for the
different context"/>
<c:simple-property name="pad-xid" required="false"
type="boolean" readOnly="true" description="Should the Xid be
padded"/>
@@ -596,13 +596,13 @@
<c:option value="EntirePool"/>
</c:property-options>
</c:simple-property>
- <c:simple-property name="prepared-statements-cacheSize"
required="false" type="long" readOnly="true"
description="The number of prepared statements per connection in an LRU
cache"/>
+ <c:simple-property name="prepared-statements-cache-size"
required="false" type="long" readOnly="true"
description="The number of prepared statements per connection in an LRU
cache"/>
<c:simple-property name="share-prepared-statements"
required="false" type="boolean" readOnly="true"
description="Whether to share prepare statements, i.e. whether asking for same
statement twice without closing uses the same underlying prepared statement"/>
<c:simple-property name="track-statements"
required="false" type="string" readOnly="true"
description="Whether to check for unclosed statements when a connection is returned
to the pool and result sets are closed when a statement is closed/return to the prepared
statement cache. valid values are: false - do not track statements and results true -
track statements and result sets and warn when they are not closed nowarn - track
statements but do no warn about them being unclosed"/>
<c:simple-property name="allocation-retry"
required="false" type="integer" readOnly="true"
description="The allocation retry element indicates the number of times that
allocating a connection should be tried before throwing an exception."/>
<c:simple-property name="allocation-retry-wait-millis"
required="false" type="long" readOnly="true"
description="he allocation retry wait millis element indicates the time in
milliseconds to wait between retrying to allocate a connection."/>
- <c:simple-property name="blocking-timeout-wait-millis"
required="false" type="long" readOnly="false"
description="The blocking-timeout-millis element indicates the maximum time in
milliseconds to block while waiting for a connection before throwing an exception. Note
that this blocks only while waiting for a permit for a connection, and will never throw an
exception if creating a new connection takes an inordinately long time."/>
- <c:simple-property name="idle-timeout-minutes"
required="false" type="long" readOnly="false"
description="The idle-timeout-minutes elements indicates the maximum time in minutes
a connection may be idle before being closed. The actual maximum time depends also on the
IdleRemover scan time, which is 1/2 the smallest idle-timeout-minutes of any pool.
Changing this value require a server restart."/>
+ <c:simple-property name="blocking-timeout-wait-millis"
required="false" type="long" readOnly="false"
defaultValue="30000" description="The blocking-timeout-millis element
indicates the maximum time in milliseconds to block while waiting for a connection before
throwing an exception. Note that this blocks only while waiting for a permit for a
connection, and will never throw an exception if creating a new connection takes an
inordinately long time."/>
+ <c:simple-property name="idle-timeout-minutes"
required="false" type="long" readOnly="false"
defaultValue="15" description="The idle-timeout-minutes elements indicates
the maximum time in minutes a connection may be idle before being closed. The actual
maximum time depends also on the IdleRemover scan time, which is 1/2 the smallest
idle-timeout-minutes of any pool. Changing this value require a server
restart."/>
<c:simple-property name="query-timeout" required="false"
type="long" readOnly="true" description="Any configured query
timeout in seconds The default is no timeout"/>
<c:simple-property name="use-try-lock" required="false"
type="long" readOnly="true" description="Any configured timeout
for internal locks on the resource adapter objects in seconds"/>
<c:simple-property name="set-tx-query-timeout"
required="false" type="boolean" readOnly="true"
description="Whether to set the query timeout based on the time remaining until
transaction timeout, any configured query timeout will be used if there is no
transaction."/>
@@ -637,8 +637,8 @@
configuration
</c:map-property>
-->
- <c:simple-property name="background-validation-minutes"
required="false" type="long" readOnly="false"
description="The background-validation-minutes element specifies the amount of time,
in minutes, that background validation will run. Changing this value require a server
restart."/>
- <c:simple-property name="background-validation"
required="false" type="boolean" readOnly="false"
description="An element to specify that connections should be validated on a
background thread versus being validated prior to use. Changing this value require a
server restart."/>
+ <c:simple-property name="background-validation-minutes"
required="false" type="long" readOnly="false"
defaultValue="10" description="The background-validation-minutes element
specifies the amount of time, in minutes, that background validation will run. Changing
this value require a server restart."/>
+ <c:simple-property name="background-validation"
required="false" type="boolean" readOnly="false"
defaultValue="false" description="An element to specify that connections
should be validated on a background thread versus being validated prior to use. Changing
this value require a server restart."/>
<c:simple-property name="use-fast-fail" required="false"
type="boolean" readOnly="false" description="Whether fail a
connection allocation on the first connection if it is invalid (true) or keep trying until
the pool is exhausted of all potential connections (false)"/>
<c:simple-property name="validate-on-match"
required="false" type="boolean" readOnly="true"
description="The validate-on-match element indicates whether or not connection level
validation should be done when a connection factory attempts to match a managed connection
for a given set. This is typically exclusive to the use of background
validation"/>
<c:simple-property name="xa-resource-timeout"
required="false" type="integer" readOnly="true"
description="Passed to XAResource.setTransactionTimeout() Default is zero which does
not invoke the setter. In seconds"/>
@@ -706,7 +706,7 @@
<c:option value="EntirePool"/>
</c:property-options>
</c:simple-property>
- <c:simple-property name="prepared-statements-cacheSize"
required="false" type="long" readOnly="true"
description="The number of prepared statements per connection in an LRU
cache"/>
+ <c:simple-property name="prepared-statements-cache-size"
required="false" type="long" readOnly="true"
description="The number of prepared statements per connection in an LRU
cache"/>
<c:simple-property name="share-prepared-statements"
required="false" type="boolean" readOnly="true"
description="Whether to share prepare statements, i.e. whether asking for same
statement twice without closing uses the same underlying prepared statement"/>
<c:simple-property name="track-statements"
required="false" type="string" readOnly="true"
description="Whether to check for unclosed statements when a connection is returned
to the pool and result sets are closed when a statement is closed/return to the prepared
statement cache. valid values are: false - do not track statements and results true -
track statements and result sets and warn when they are not closed nowarn - track
statements but do no warn about them being unclosed"/>
<c:simple-property name="allocation-retry"
required="false" type="integer" readOnly="true"
description="The allocation retry element indicates the number of times that
allocating a connection should be tried before throwing an exception."/>
commit e6e91058f3ac76c6458847bd66a8ee5c9c24493e
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Aug 29 02:20:24 2012 -0500
[BZ 847674] Updated all the wait methods for reload, shutdown, and restart to have the
same design. All the methods now take into account possible exceptions for the test
operation sent to the application server.
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
index 27b1133..98a46d2 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
@@ -241,25 +241,36 @@ public abstract class BaseServerComponent<T extends
ResourceComponent<?>> extend
return startServer();
}
- protected boolean waitUntilDown(OperationResult tmp) throws InterruptedException {
+ protected boolean waitUntilDown() throws InterruptedException {
boolean down=false;
int count=0;
+
while (!down) {
Operation op = new ReadAttribute(new Address(),"release-version");
- Result res = getASConnection().execute(op);
- if (!res.isSuccess()) { // If op succeeds, server is not down
- down=true;
- } else if (count > 20) {
- tmp.setErrorMessage("Was not able to shut down the server");
- return true;
+
+ try{
+ Result res = getASConnection().execute(op);
+ if (!res.isSuccess()) { // If op succeeds, server is not down
+ down = true;
+ } else if (count > 20) {
+ break;
+ }
+ } catch (Exception e) {
+ down = true;
}
+
if (!down) {
- Thread.sleep(1000); // Wait 1s
+ try {
+ Thread.sleep(1000); // Wait 1s
+ } catch (InterruptedException e) {
+ // ignore
+ }
}
count++;
}
- log.debug("waitUntilDown: Used " + count + " delay round(s) to
shut down");
- return false;
+
+ log.debug("waitUntilDown: Used " + count + " delay round(s) to
shut down. Server down=" + down);
+ return down;
}
/**
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java
index 565add2..7ea12b9 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java
@@ -92,8 +92,11 @@ public class HostControllerComponent<T extends
ResourceComponent<?>> extends Bas
Result res = getASConnection().execute(op);
operationResult = postProcessResult(name, res);
- waitUntilDown(operationResult);
-
+ if (waitUntilDown()) {
+ operationResult.setSimpleResult("Success");
+ } else {
+ operationResult.setErrorMessage("Was not able to shut down the
server.");
+ }
} else if (name.equals("installRhqUser")) {
operationResult = installManagementUser(parameters, pluginConfiguration);
} else {
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java
index 573742e..778d127 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/StandaloneASComponent.java
@@ -163,39 +163,59 @@ public class StandaloneASComponent<T extends
ResourceComponent<?>> extends BaseS
OperationResult operationResult = postProcessResult(name, res);
- if (name.equals("shutdown"))
- waitUntilDown(operationResult);
+ if (name.equals("shutdown")) {
+ if (waitUntilDown()) {
+ operationResult.setSimpleResult("Success");
+ } else {
+ operationResult.setErrorMessage("Was not able to shut down the
server.");
+ }
+ }
- if (name.equals("reload"))
- waitUntilReloaded(operationResult);
+ if (name.equals("reload")) {
+ if (waitUntilReloaded()) {
+ operationResult.setSimpleResult("Success");
+ } else {
+ operationResult.setErrorMessage("Was not able to reload the
server.");
+ }
+ }
context.getAvailabilityContext().requestAvailabilityCheck();
return operationResult;
}
- private void waitUntilReloaded(OperationResult operationResult) {
+ private boolean waitUntilReloaded() {
boolean reloaded = false;
int count = 0;
+
while (!reloaded) {
- try {
- Thread.sleep(2000); // Wait 2s
- } catch (InterruptedException e) {
- // Ignore
+ Operation op = new ReadAttribute(new Address(),
"release-version");
+ try{
+ Result res = getASConnection().execute(op);
+ if (res.isSuccess() && !res.isReloadRequired()) {
+ reloaded = true;
+ } else if (count > 20) {
+ break;
+ }
+ } catch (Exception e) {
+ //do absolutely nothing
+ //if an exception is thrown that means the server is still reloading, so
consider this
+ //a single failed attempt, equivalent to res.isSuccess == false
}
- Operation op = new ReadAttribute(new Address(),
"release-version");
- Result res = getASConnection().execute(op);
- if (res.isSuccess() && !res.isReloadRequired()) {
- reloaded = true;
- } else if (count > 20) {
- operationResult.setErrorMessage("Was not able to reload the
server");
- return;
+ if (!reloaded) {
+ try {
+ Thread.sleep(1000); // Wait 1s
+ } catch (InterruptedException e) {
+ // ignore
+ }
}
count++;
}
- log.debug("waitUntilReloaded: Used " + count + " delay round(s) to
reload");
- return;
+
+ log.debug("waitUntilReloaded: Used " + count + " delay round(s) to
reload. Reload=" + reloaded);
+
+ return reloaded;
}
@Override
commit 96602db100b087e36016b1aa6a2e39780b583898
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 28 23:33:45 2012 -0500
[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
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.">
commit b8d890aaf85b9d3f74eb60d1bad32af02d030759
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 28 23:01:08 2012 -0500
[BZ 852552] Add two resource types to the list of ignored resources for this
integration test. Both of these resources have special requirements with regards to
configuration updates.
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
index aad8739..824162a 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
@@ -86,6 +86,9 @@ public class ResourcesStandaloneServerTest extends
AbstractJBossAS7PluginTest {
//will revisit after BZ 826542 is resolved
// ignoredResources.add("Authentication (Classic)");
+ ignoredResources.add("Memory Pool");
+ ignoredResources.add("Periodic Rotating File Handler");
+
Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
Resource server = getResourceByTypeAndKey(platform,
StandaloneServerComponentTest.RESOURCE_TYPE,
StandaloneServerComponentTest.RESOURCE_KEY);
commit a31197fcd63548c6e49606525b9938c123e5ffb2
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 28 22:59:02 2012 -0500
[BZ 852552] Update socket binding group to not send at all port-offset for
non-standalone servers.
Just setting port-offset to null was not enough since now all the unset properties are
sent to the AS7 server. The property and property definition are now removed from updates
sent host controllers.
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SocketBindingGroupComponent.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SocketBindingGroupComponent.java
index 00d28ca..573db2e 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SocketBindingGroupComponent.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SocketBindingGroupComponent.java
@@ -2,6 +2,7 @@ package org.rhq.modules.plugins.jbossas7;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
@@ -29,12 +30,14 @@ public class SocketBindingGroupComponent extends BaseComponent
implements Config
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
Configuration config = report.getConfiguration();
+ ConfigurationDefinition configDef =
context.getResourceType().getResourceConfigurationDefinition();
+
if (!(context.getParentResourceComponent() instanceof StandaloneASComponent)) {
// TODO what about managed servers
- config.put(new PropertySimple("port-offset",null));
+ configDef.getPropertyDefinitions().remove("port-offset");
+ config.remove("port-offset");
}
- super.updateResourceConfiguration(report);
-
-
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(configDef,
getASConnection(), address);
+ delegate.updateResourceConfiguration(report);
}
}
commit 91aaaf71e585022ca85f62e371a7d63ae554ff6d
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 28 22:55:05 2012 -0500
[BZ 852552] Create a separate distributed cache definition because this resource
contains addtional properties not available for invalidation and replicate caches.
The diferrence between these caches was obvious only after the updates to always send
unset properties. All these extra properties (which are null) were sent to the server
causing failures for caches that do not have them in their definition.
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 81ddfe9..0f150a4 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
@@ -2002,7 +2002,7 @@
class="TemplatedComponent">
<plugin-configuration>
- <c:simple-property name="path" readOnly="true"
default="distributed-cache|invalidation-cache|replicated-cache"/>
+ <c:simple-property name="path" readOnly="true"
default="invalidation-cache|replicated-cache"/>
</plugin-configuration>
<resource-configuration>
@@ -2031,30 +2031,64 @@
<c:simple-property name="queue-flush-interval"
required="false" type="long" readOnly="true"
default="10" description="In ASYNC mode, this attribute controls how often
the asynchronous thread used to flush the replication queue runs. This should be a
positive integer which represents thread wakeup time in milliseconds."/>
<c:simple-property name="remote-timeout"
required="false" type="long" readOnly="true"
default="17500" description="In SYNC mode, the timeout (in ms) used to wait
for an acknowledgment when making a remote call, after which the call is aborted and an
exception is thrown."/>
<c:simple-property name="async-marshalling"
required="false" type="boolean" readOnly="true"
defaultValue="false" description="If enabled, this will cause marshalling
of entries to be performed asynchronously. The default value is false."/>
- <c:simple-property name="l1-lifespan" required="false"
type="long" readOnly="true" defaultValue="600000"
description="Maximum lifespan of an entry placed in the L1 cache. This element
configures the L1 cache behavior in 'distributed' caches instances. In
any other cache modes, this element is ignored. The default value is 600000."/>
<c:simple-property name="module" required="false"
type="string" readOnly="true" description="The module whose class
loader should be used when building this cache's configuration."/>
- <c:simple-property name="owners" required="false"
type="integer" readOnly="true" defaultValue="2"
description="Number of cluster-wide replicas for each cache entry. The
default value is 2."/>
- <c:simple-property name="virtual-nodes"
required="false" type="integer" readOnly="true"
defaultValue="1" description="Controls the number of virtual nodes per
'real' node. If numVirtualNodes is 1, then virtual nodes are disabled.
The topology aware consistent hash must be used if you wish to take advantage of virtual
nodes. A default of 1 is used. The default value is 1."/>
- <c:simple-property name="__type" displayName="Type of
cache" required="true" readOnly="true"
default="local-cache" description="Type of cache">
+ <c:simple-property name="__type" displayName="Type of
cache" required="true" readOnly="true"
default="invalidation-cache" description="Type of cache">
<c:property-options>
<c:option value="invalidation-cache"/>
- <c:option value="distributed-cache"/>
<c:option value="replicated-cache"/>
</c:property-options>
</c:simple-property>
<c:template name="Invalidation Cache"
description="Invalidation Cache">
<c:simple-property name="__type" readOnly="true"
default="invalidation-cache"/>
</c:template>
- <c:template name="Distributed Cache"
description="Distributed Cache">
- <c:simple-property name="__type" readOnly="true"
default="distributed-cache"/>
- </c:template>
<c:template name="Replicated Cache" description="Replicated
Cache">
<c:simple-property name="__type" readOnly="true"
default="replicated-cache"/>
</c:template>
</resource-configuration>
</service>
+ <service name="Distributed Cache (Managed Server)"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true"
default="distributed-cache"/>
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="start" required="false"
type="string" readOnly="true" default="LAZY"
description="The cache start mode, which can be EAGER (immediate start) or LAZY
(on-demand start).">
+ <c:property-options>
+ <c:option value="LAZY"/>
+ <c:option value="EAGER"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="batching" required="false"
type="boolean" readOnly="true" default="false"
description="If enabled, the invocation batching API will be made available for this
cache."/>
+ <c:simple-property name="indexing" required="false"
type="string" readOnly="true" default="NONE"
description="If enabled, entries will be indexed when they are added to the cache.
Indexes will be updated as entries change or are removed.">
+ <c:property-options>
+ <c:option value="NONE"/>
+ <c:option value="LOCAL"/>
+ <c:option value="ALL"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="jndi-name" required="false"
type="string" readOnly="true" description="The jndi-name to which
to bind this cache instance."/>
+ <c:simple-property name="mode" required="false"
type="string" readOnly="true" default="SYNC"
description="Sets the clustered cache mode, ASYNC for asynchronous operation, or SYNC
for synchronous operation.">
+ <c:property-options>
+ <c:option value="SYNC"/>
+ <c:option value="ASYNC"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="queue-size" required="false"
type="integer" readOnly="true" default="0"
description="In ASYNC mode, this attribute can be used to trigger flushing of the
queue when it reaches a specific threshold."/>
+ <c:simple-property name="queue-flush-interval"
required="false" type="long" readOnly="true"
default="10" description="In ASYNC mode, this attribute controls how often
the asynchronous thread used to flush the replication queue runs. This should be a
positive integer which represents thread wakeup time in milliseconds."/>
+ <c:simple-property name="remote-timeout"
required="false" type="long" readOnly="true"
default="17500" description="In SYNC mode, the timeout (in ms) used to wait
for an acknowledgment when making a remote call, after which the call is aborted and an
exception is thrown."/>
+ <c:simple-property name="async-marshalling"
required="false" type="boolean" readOnly="true"
defaultValue="false" description="If enabled, this will cause marshalling
of entries to be performed asynchronously. The default value is false."/>
+ <c:simple-property name="l1-lifespan" required="false"
type="long" readOnly="true" defaultValue="600000"
description="Maximum lifespan of an entry placed in the L1 cache. This element
configures the L1 cache behavior in 'distributed' caches instances. In
any other cache modes, this element is ignored. The default value is 600000."/>
+ <c:simple-property name="module" required="false"
type="string" readOnly="true" description="The module whose class
loader should be used when building this cache's configuration."/>
+ <c:simple-property name="owners" required="false"
type="integer" readOnly="true" defaultValue="2"
description="Number of cluster-wide replicas for each cache entry. The
default value is 2."/>
+ <c:simple-property name="virtual-nodes"
required="false" type="integer" readOnly="true"
defaultValue="1" description="Controls the number of virtual nodes per
'real' node. If numVirtualNodes is 1, then virtual nodes are disabled.
The topology aware consistent hash must be used if you wish to take advantage of virtual
nodes. A default of 1 is used. The default value is 1."/>
+ </resource-configuration>
+ </service>
+
<service name="Local Cache (Managed Server)"
discovery="SubsystemDiscovery"
class="BaseComponent"
@@ -11331,7 +11365,7 @@
creationDataType="configuration">
<plugin-configuration>
- <c:simple-property name="path" readOnly="true"
default="distributed-cache|invalidation-cache|replicated-cache"/>
+ <c:simple-property name="path" readOnly="true"
default="invalidation-cache|replicated-cache"/>
</plugin-configuration>
<resource-configuration>
@@ -11360,30 +11394,66 @@
<c:simple-property name="queue-flush-interval"
required="false" type="long" readOnly="false"
default="10" description="In ASYNC mode, this attribute controls how often
the asynchronous thread used to flush the replication queue runs. This should be a
positive integer which represents thread wakeup time in milliseconds."/>
<c:simple-property name="remote-timeout"
required="false" type="long" readOnly="false"
default="17500" description="In SYNC mode, the timeout (in ms) used to wait
for an acknowledgment when making a remote call, after which the call is aborted and an
exception is thrown."/>
<c:simple-property name="async-marshalling"
required="false" type="boolean" readOnly="false"
defaultValue="false" description="If enabled, this will cause marshalling
of entries to be performed asynchronously. The default value is false."/>
- <c:simple-property name="l1-lifespan" required="false"
type="long" readOnly="false" defaultValue="600000"
description="Maximum lifespan of an entry placed in the L1 cache. This element
configures the L1 cache behavior in 'distributed' caches instances. In
any other cache modes, this element is ignored. The default value is 600000."/>
<c:simple-property name="module" required="false"
type="string" readOnly="false" description="The module whose
class loader should be used when building this cache's configuration."/>
- <c:simple-property name="owners" required="false"
type="integer" readOnly="false" defaultValue="2"
description="Number of cluster-wide replicas for each cache entry. The
default value is 2."/>
- <c:simple-property name="virtual-nodes" required="false"
type="integer" readOnly="false" defaultValue="1"
description="Controls the number of virtual nodes per 'real' node.
If numVirtualNodes is 1, then virtual nodes are disabled. The topology aware consistent
hash must be used if you wish to take advantage of virtual nodes. A default of 1 is used.
The default value is 1."/>
- <c:simple-property name="__type" displayName="Type of
cache" required="true" readOnly="true"
default="local-cache" description="Type of cache">
+ <c:simple-property name="__type" displayName="Type of
cache" required="true" readOnly="true"
default="invalidation-cache" description="Type of cache">
<c:property-options>
<c:option value="invalidation-cache"/>
- <c:option value="distributed-cache"/>
<c:option value="replicated-cache"/>
</c:property-options>
</c:simple-property>
<c:template name="Invalidation Cache"
description="Invalidation Cache">
<c:simple-property name="__type" readOnly="true"
default="invalidation-cache"/>
</c:template>
- <c:template name="Distributed Cache" description="Distributed
Cache">
- <c:simple-property name="__type" readOnly="true"
default="distributed-cache"/>
- </c:template>
<c:template name="Replicated Cache" description="Replicated
Cache">
<c:simple-property name="__type" readOnly="true"
default="replicated-cache"/>
</c:template>
</resource-configuration>
</service>
+ <service name="Distributed Cache"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent"
+ createDeletePolicy="both"
+ creationDataType="configuration">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true"
default="distributed-cache"/>
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="start" required="false"
type="string" readOnly="false" default="LAZY"
description="The cache start mode, which can be EAGER (immediate start) or LAZY
(on-demand start).">
+ <c:property-options>
+ <c:option value="LAZY"/>
+ <c:option value="EAGER"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="batching" required="false"
type="boolean" readOnly="false" default="false"
description="If enabled, the invocation batching API will be made available for this
cache."/>
+ <c:simple-property name="indexing" required="false"
type="string" readOnly="false" default="NONE"
description="If enabled, entries will be indexed when they are added to the cache.
Indexes will be updated as entries change or are removed.">
+ <c:property-options>
+ <c:option value="NONE"/>
+ <c:option value="LOCAL"/>
+ <c:option value="ALL"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="jndi-name" required="false"
type="string" readOnly="false" description="The jndi-name to
which to bind this cache instance."/>
+ <c:simple-property name="mode" required="true"
type="string" readOnly="false" default="SYNC"
defaultValue="SYNC" description="Sets the clustered cache mode, ASYNC for
asynchronous operation, or SYNC for synchronous operation.">
+ <c:property-options>
+ <c:option value="SYNC"/>
+ <c:option value="ASYNC"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="queue-size" required="false"
type="integer" readOnly="false" default="0"
description="In ASYNC mode, this attribute can be used to trigger flushing of the
queue when it reaches a specific threshold."/>
+ <c:simple-property name="queue-flush-interval"
required="false" type="long" readOnly="false"
default="10" description="In ASYNC mode, this attribute controls how often
the asynchronous thread used to flush the replication queue runs. This should be a
positive integer which represents thread wakeup time in milliseconds."/>
+ <c:simple-property name="remote-timeout"
required="false" type="long" readOnly="false"
default="17500" description="In SYNC mode, the timeout (in ms) used to wait
for an acknowledgment when making a remote call, after which the call is aborted and an
exception is thrown."/>
+ <c:simple-property name="async-marshalling"
required="false" type="boolean" readOnly="false"
defaultValue="false" description="If enabled, this will cause marshalling
of entries to be performed asynchronously. The default value is false."/>
+ <c:simple-property name="l1-lifespan" required="false"
type="long" readOnly="false" defaultValue="600000"
description="Maximum lifespan of an entry placed in the L1 cache. This element
configures the L1 cache behavior in 'distributed' caches instances. In
any other cache modes, this element is ignored. The default value is 600000."/>
+ <c:simple-property name="module" required="false"
type="string" readOnly="false" description="The module whose
class loader should be used when building this cache's configuration."/>
+ <c:simple-property name="owners" required="false"
type="integer" readOnly="false" defaultValue="2"
description="Number of cluster-wide replicas for each cache entry. The
default value is 2."/>
+ <c:simple-property name="virtual-nodes" required="false"
type="integer" readOnly="false" defaultValue="1"
description="Controls the number of virtual nodes per 'real' node.
If numVirtualNodes is 1, then virtual nodes are disabled. The topology aware consistent
hash must be used if you wish to take advantage of virtual nodes. A default of 1 is used.
The default value is 1."/>
+ </resource-configuration>
+ </service>
+
<service name="Local Cache"
discovery="SubsystemDiscovery"
class="BaseComponent"
commit 9320bfa050c332a5f89334fcf5606395e5ef9098
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 28 22:46:02 2012 -0500
[BZ 852552] Update mod-cluster property name to load-balancing-group. The
"domain" alias no longer works for load-balancing-group causing configuration
updates to fail with unknown domain property.
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 bef06ec..81ddfe9 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
@@ -168,7 +168,7 @@
<c:simple-property name="connector" required="true"
type="string" readOnly="false" defaultValue="ajp"
description="Name of the web connector used to communicate with the load
balancer.">
<c:option-source target="resource"
expression="type=Connector plugin=&pluginName;"/>
</c:simple-property>
- <c:simple-property name="domain" required="false"
type="string" readOnly="false" description="loadBalancingGroup
name."/>
+ <c:simple-property name="load-balancing-group"
required="false" type="string" readOnly="false"
description="loadBalancingGroup name."/>
</c:group>
<c:group name="context" displayName="Web Context
Options">
commit 9f82d413e980967ea3fae7ffe2579c44cc29cbb7
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 28 22:44:05 2012 -0500
[BZ 852552] Removing properties from the Transport subresource because the resource
definition no longer contains them.
Because unset properties are now always sent to the AS7 server, all these removed
Transport properties were sent to the AS7 causing an unknown property failure.
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 6f13412..bef06ec 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
@@ -2099,9 +2099,6 @@
<c:simple-property name="cluster" required="false"
type="string" readOnly="true" description="The name of the group
communication cluster"/>
<c:simple-property name="executor" required="false"
type="string" readOnly="true" description="The executor to use
for the transport"/>
<c:simple-property name="lock-timeout"
required="false" type="long" readOnly="true"
defaultValue="240000" description="The timeout for locks for the transport.
The default value is 240000."/>
- <c:simple-property name="machine" required="false"
type="string" readOnly="true" description="A machine identifier
for the transport"/>
- <c:simple-property name="rack" required="false"
type="string" readOnly="true" description="A rack identifier for
the transport"/>
- <c:simple-property name="site" required="false"
type="string" readOnly="true" description="A site identifier for
the transport"/>
<c:simple-property name="stack" required="false"
type="string" readOnly="true" description="The jgroups stack to
use for the transport"/>
</resource-configuration>
</service>
@@ -11431,9 +11428,6 @@
<c:simple-property name="cluster" required="false"
type="string" readOnly="false" description="The name of the group
communication cluster"/>
<c:simple-property name="executor" required="false"
type="string" readOnly="false" description="The executor to use
for the transport"/>
<c:simple-property name="lock-timeout" required="false"
type="long" readOnly="false" defaultValue="240000"
description="The timeout for locks for the transport. The default value is
240000."/>
- <c:simple-property name="machine" required="false"
type="string" readOnly="false" description="A machine identifier
for the transport"/>
- <c:simple-property name="rack" required="false"
type="string" readOnly="false" description="A rack identifier for
the transport"/>
- <c:simple-property name="site" required="false"
type="string" readOnly="false" description="A site identifier for
the transport"/>
<c:simple-property name="stack" required="false"
type="string" readOnly="false" description="The jgroups stack to
use for the transport"/>
</resource-configuration>
</service>
commit c1655d4d576311b9034a31b505e75981b1d6e720
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 28 22:39:35 2012 -0500
[BZ 852552] Send unset properties to AS7 as null.
Existing code was not sending updates for unset properties at all to AS7 making it
impossible to unset (or set to empty) a property after it was set to something not null.
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java
index aad2105..f73ccf5 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java
@@ -431,16 +431,25 @@ public class ConfigurationWriteDelegate implements
ConfigurationFacet {
private void createWriteAttributePropertySimple(CompositeOperation cop,
PropertySimple property,
PropertyDefinitionSimple propertyDefinition, Address address) {
- // If the property value is null and the property is optional, skip too
- if (property.getStringValue() == null &&
!propertyDefinition.isRequired())
- return;
-
if (property.getName().endsWith(":ignore")) // Caller takes care
return;
if (propertyDefinition.isReadOnly() && !createChildRequested)
return;
+ //If the property value is null and the property is optional,
+ //then send default value or null to the server
+ if (property.getStringValue() == null &&
!propertyDefinition.isRequired()) {
+ String name = property.getName();
+ if (name.indexOf(':') != -1) {
+ name = name.substring(0, name.indexOf(":"));
+ }
+
+ Operation writeAttribute = new WriteAttribute(address, name, null);
+ cop.addStep(writeAttribute);
+ return;
+ }
+
SimpleEntry<String, Object> entry = this.preparePropertySimple(property,
propertyDefinition);
Operation writeAttribute = new WriteAttribute(address, entry.getKey(),
entry.getValue());
cop.addStep(writeAttribute);
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationUpdatingTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationUpdatingTest.java
index 21e3d5f..48b6783 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationUpdatingTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationUpdatingTest.java
@@ -59,7 +59,6 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
public void test1() throws Exception {
ConfigurationDefinition definition = loadDescriptor("simple1");
-
FakeConnection connection = new FakeConnection();
ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
@@ -70,12 +69,22 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new
Address());
- assert cop.numberOfSteps() == 1;
- Operation step1 = cop.step(0);
- assert step1.getOperation().equals("write-attribute");
- Map<String, Object> props = step1.getAdditionalProperties();
- assert props.size() == 2;
+ Assert.assertEquals(cop.numberOfSteps(), 2);
+ for (int i = 0; i < cop.numberOfSteps(); i++) {
+ Operation step = cop.step(0);
+ Assert.assertEquals(step.getOperation(), "write-attribute");
+ Map<String, Object> stepProps = step.getAdditionalProperties();
+ Assert.assertEquals(stepProps.size(), 2);
+
+ if (stepProps.get("name").equals("needed")) {
+ Assert.assertEquals(stepProps.get("value"), "test");
+ } else if (stepProps.get("name").equals("optional")) {
+ Assert.assertEquals(stepProps.get("value"), null);
+ } else {
+ Assert.fail("Unexepected property found!");
+ }
+ }
}
public void test2() throws Exception {
commit e1d2190442ddcfe023696fa59b040f78929a27c6
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Aug 28 20:14:08 2012 -0500
[BZ 846400] Add validation for components that rely connectors and discovery group
name. A compoment should have either the connector or discovery group configured, but not
both.
This validation is handled by the AS7 server itself for new resource creation but the
validation is missing for configuration updates. Without this validation code in place,
the AS7 server accepts the commands, persists the configuration, but fails to reload or
restart rendering the server unusable until the configuration file is manually edited.
With this fix, the AS7 plugin will not send the configuration updates to the AS7 server
unless they meet the descriptor requirements.
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConnectorDiscoveryGroupValidatorComponent.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConnectorDiscoveryGroupValidatorComponent.java
new file mode 100644
index 0000000..fab342f
--- /dev/null
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConnectorDiscoveryGroupValidatorComponent.java
@@ -0,0 +1,83 @@
+/*
+ * 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.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+
+/**
+ * @author Stefan Negrea
+ *
+ */
+public class ConnectorDiscoveryGroupValidatorComponent extends
BaseComponent<ResourceComponent<?>> {
+
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ Configuration resourceConfiguration = report.getConfiguration();
+ ResourceType resourceType = this.context.getResourceType();
+
+ // we need to check that a connector XOR a discovery-group-name is given
+ int configuredItemsFound = 0;
+ String errorMessage = "";
+
+ if (resourceType.getName().equals("Connection Factory")
+ || resourceType.getName().equals("Pooled Connection Factory")) {
+
+ PropertyMap connector =
resourceConfiguration.getMap("connector:collapsed");
+ if (connector != null) {
+ String name = connector.getSimpleValue("name:0",
"");
+ if (!name.isEmpty()) {
+ configuredItemsFound++;
+ }
+ }
+
+ errorMessage = "You need to provide either a connector name OR a
discovery-group-name. ";
+ } else if (resourceType.getName().equals("Bridge") ||
resourceType.getName().equals("Cluster Connection")) {
+
+ PropertyList staticConnectors =
resourceConfiguration.getList("static-connectors:nullable");
+ if (staticConnectors != null) {
+ if (!staticConnectors.getList().isEmpty()) {
+ configuredItemsFound++;
+ }
+ }
+
+ errorMessage = "You need to provide either static connectors name OR a
discovery-group-name. ";
+ }
+
+ String discoveryGroup =
resourceConfiguration.getSimpleValue("discovery-group-name", "");
+ if (!discoveryGroup.isEmpty()) {
+ configuredItemsFound++;
+ }
+
+ if (configuredItemsFound != 1) {
+ errorMessage += (configuredItemsFound == 0) ? "You provided none."
: "You provided both.";
+ report.setErrorMessage(errorMessage);
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ } else {
+ super.updateResourceConfiguration(report);
+ }
+ }
+}
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HornetQComponent.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HornetQComponent.java
index dad90bc..cd791fa 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HornetQComponent.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HornetQComponent.java
@@ -21,9 +21,7 @@ package org.rhq.modules.plugins.jbossas7;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertyList;
-import org.rhq.core.domain.configuration.PropertyMap;
import org.rhq.core.domain.resource.CreateResourceStatus;
-import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.pluginapi.inventory.CreateResourceReport;
/**
@@ -43,31 +41,6 @@ public class HornetQComponent extends TemplatedSubResourcesComponent {
return report;
}
- ResourceType resourceType = report.getResourceType();
- if (resourceType.getName().equals("Connection-Factory")) {
- // we need to check that a connector XOR a discovery-group-name is given
- int found = 0;
- PropertyMap connector =
resourceConfiguration.getMap("connector:collapsed");
-
- if (connector != null) {
-
- String name = connector.getSimpleValue("name:0",
"");
- if (!name.isEmpty())
- found++;
- }
- String discoveryGroup =
resourceConfiguration.getSimpleValue("discovery-group-name", "");
- if (!discoveryGroup.isEmpty())
- found++;
-
- if (found == 0 || found == 2) {
- String errorMessage = "You need to provide either a connector name
OR a discovery-group-name. You provided ";
- errorMessage += (found == 0) ? "none" : "both";
- report.setErrorMessage(errorMessage);
- report.setStatus(CreateResourceStatus.FAILURE);
- return report;
- }
- }
-
report = super.createResource(report);
return report;
}
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JmsComponent.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JmsComponent.java
index 8b6eb12..1ede55e 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JmsComponent.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/JmsComponent.java
@@ -21,16 +21,13 @@ package org.rhq.modules.plugins.jbossas7;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.configuration.PropertyList;
-import org.rhq.core.domain.configuration.PropertyMap;
-import org.rhq.core.domain.resource.CreateResourceStatus;
-import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
/**
* Component class for the JMS subsystem
* @author Heiko W. Rupp
*/
-public class JmsComponent extends BaseComponent {
+public class JmsComponent extends ConnectorDiscoveryGroupValidatorComponent {
@Override
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
@@ -43,31 +40,8 @@ public class JmsComponent extends BaseComponent {
return;
}
- ResourceType resourceType = context.getResourceType();
- if (resourceType.getName().equals("Connection-Factory")) {
- // we need to check that a connector XOR a discovery-group-name is given
- int found = 0;
- PropertyMap connector =
resourceConfiguration.getMap("connector:collapsed");
-
- if (connector != null) {
-
- String name = connector.getSimpleValue("name:0",
"");
- if (!name.isEmpty())
- found++;
- }
- String discoveryGroup =
resourceConfiguration.getSimpleValue("discovery-group-name", "");
- if (!discoveryGroup.isEmpty())
- found++;
-
- if (found == 0 || found == 2) {
- String errorMessage = "You need to provide either a connector name
OR a discovery-group-name. You provided ";
- errorMessage += (found == 0) ? "none" : "both";
- report.setErrorMessage(errorMessage);
- report.setStatus(ConfigurationUpdateStatus.FAILURE);
- return;
- }
- }
-
+ //defer the rest of the validation for connector and discovery group name to
+ //the base class
super.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 8143d04..6f13412 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
@@ -4654,7 +4654,7 @@
<service name="Cluster Connection (Managed Server)"
discovery="SubsystemDiscovery"
- class="BaseComponent"
+ class="ConnectorDiscoveryGroupValidatorComponent"
createDeletePolicy="neither">
<plugin-configuration>
@@ -4784,7 +4784,7 @@
<service name="Bridge (Managed Server)"
discovery="SubsystemDiscovery"
- class="BaseComponent"
+ class="ConnectorDiscoveryGroupValidatorComponent"
createDeletePolicy="neither">
<plugin-configuration>
@@ -6804,7 +6804,7 @@
<service name="Cluster Connection (Profile)"
discovery="SubsystemDiscovery"
- class="BaseComponent"
+ class="ConnectorDiscoveryGroupValidatorComponent"
createDeletePolicy="both">
<plugin-configuration>
@@ -6893,7 +6893,7 @@
<service name="Bridge (Profile)"
discovery="SubsystemDiscovery"
- class="BaseComponent"
+ class="ConnectorDiscoveryGroupValidatorComponent"
createDeletePolicy="both">
<plugin-configuration>
@@ -12855,7 +12855,7 @@
<service name="Cluster Connection"
discovery="SubsystemDiscovery"
- class="BaseComponent"
+ class="ConnectorDiscoveryGroupValidatorComponent"
createDeletePolicy="both">
<plugin-configuration>
@@ -12985,7 +12985,7 @@
<service name="Bridge"
discovery="SubsystemDiscovery"
- class="BaseComponent"
+ class="ConnectorDiscoveryGroupValidatorComponent"
createDeletePolicy="both">
<plugin-configuration>