[rhq] modules/plugins
snegrea
snegrea at fedoraproject.org
Mon Aug 13 20:07:43 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 1b2ba60b043c4c9e8feff247dcb0b53f342b9371
Author: Stefan Negrea <snegrea at redhat.com>
Date: Mon Aug 13 15:07:10 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.
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 9bc01f2..ff55c8d 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