Author: thomas.diesler(a)jboss.com
Date: 2010-02-03 03:31:45 -0500 (Wed, 03 Feb 2010)
New Revision: 100330
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
Log:
Improve remote getStatus() error handling
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
===================================================================
---
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2010-02-03
08:02:56 UTC (rev 100329)
+++
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2010-02-03
08:31:45 UTC (rev 100330)
@@ -31,6 +31,7 @@
import java.net.URLStreamHandler;
import java.util.Dictionary;
+import javax.management.InstanceNotFoundException;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
@@ -106,10 +107,19 @@
MBeanServerConnection server = getRuntime().getMBeanServer();
isRegistered = server.isRegistered(objectName);
}
- catch (IOException e)
+ catch (RuntimeException rte)
{
+ Throwable cause = rte.getCause() != null ? rte.getCause() : null;
+ if (cause instanceof InstanceNotFoundException == false)
+ log.warn("Cannot get state for: " + objectName, cause);
+
isRegistered = false;
}
+ catch (IOException ex)
+ {
+ log.warn("Cannot get state for: " + objectName, ex);
+ isRegistered = false;
+ }
return isRegistered ? bundle.getState() : Bundle.UNINSTALLED;
}
Show replies by date