[rhq] Branch 'release/jon3.1.x' - modules/plugins
snegrea
snegrea at fedoraproject.org
Mon Aug 13 20:27:33 UTC 2012
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java | 17 +++++++---
1 file changed, 12 insertions(+), 5 deletions(-)
New commits:
commit 33f5f3e4d9fe4ab9e75bf78add28eedf7db22be9
Author: Stefan Negrea <snegrea at redhat.com>
Date: Mon Aug 13 15:27:23 2012 -0500
[BZ 847674] Prevent exceptions from bubbling up because that is an indication the server is still down after the restart. Consider a thrown exception just a failed attempt to connect to the server, equivalent to success == false response for the test operation.
(cherry picked from commit 1b2ba60b043c4c9e8feff247dcb0b53f342b9371)
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 8b85deb..75bc091 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
@@ -406,12 +406,19 @@ public abstract class BaseServerComponent<T extends ResourceComponent<?>> extend
int count = 0;
while (!up) {
Operation op = new ReadAttribute(new Address(), "release-version");
- Result res = getASConnection().execute(op);
- if (res.isSuccess()) { // If op succeeds, server is not down
- up = true;
- } else if (count > 20) {
- break;
+ try{
+ Result res = getASConnection().execute(op);
+ if (res.isSuccess()) { // If op succeeds, server is not down
+ up = true;
+ } else if (count > 20) {
+ break;
+ }
+ } catch (Exception e) {
+ //do absolutely nothing
+ //if an exception is thrown that means the server is still down, so consider this
+ //a single failed attempt, equivalent to res.isSuccess == false
}
+
if (!up) {
try {
Thread.sleep(1000); // Wait 1s
More information about the rhq-commits
mailing list