summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Negrea <snegrea@redhat.com>2012-08-13 20:07:10 (GMT)
committerStefan Negrea <snegrea@redhat.com>2012-08-13 20:07:39 (GMT)
commit1b2ba60b043c4c9e8feff247dcb0b53f342b9371 (patch)
tree201fd94bd6db406959d095fc5fb0abf07d29bc9f
parent35d9093ac3c6118d1fc9ad5a8eef3a6bce6fe398 (diff)
downloadrhq-1b2ba60b043c4c9e8feff247dcb0b53f342b9371.zip
rhq-1b2ba60b043c4c9e8feff247dcb0b53f342b9371.tar.gz
rhq-1b2ba60b043c4c9e8feff247dcb0b53f342b9371.tar.xz
[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.
-rw-r--r--modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java17
1 files changed, 12 insertions, 5 deletions
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