Change RTE to an ISE
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / src / main / java / org / opendaylight / controller / remote / rpc / registry / mbeans / AbstractRegistryMXBean.java
index 6bf195d093dba3ea2b1f42a505c88865fdac19d5..a38b8c4d890903f834c7fb33238ee13139e7cc4a 100644 (file)
@@ -13,6 +13,7 @@ import akka.actor.Address;
 import akka.util.Timeout;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.util.Map;
+import java.util.concurrent.TimeoutException;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.controller.md.sal.common.util.jmx.AbstractMXBean;
 import org.opendaylight.controller.remote.rpc.registry.AbstractRoutingTable;
@@ -45,30 +46,30 @@ abstract class AbstractRegistryMXBean<T extends AbstractRoutingTable<T, I>, I> e
         registerMBean();
     }
 
-    @SuppressWarnings({"unchecked", "checkstyle:IllegalCatch", "rawtypes"})
+    @SuppressWarnings({"unchecked", "rawtypes"})
     final T localData() {
         try {
             return (T) Await.result((Future) bucketAccess.getLocalData(), timeout);
-        } catch (Exception e) {
-            throw new RuntimeException("getLocalData failed", e);
+        } catch (InterruptedException | TimeoutException e) {
+            throw new IllegalStateException("getLocalData failed", e);
         }
     }
 
-    @SuppressWarnings({"unchecked", "checkstyle:IllegalCatch", "rawtypes"})
+    @SuppressWarnings({"unchecked", "rawtypes"})
     final Map<Address, Bucket<T>> remoteBuckets() {
         try {
             return (Map<Address, Bucket<T>>) Await.result((Future)bucketAccess.getRemoteBuckets(), timeout);
-        } catch (Exception e) {
-            throw new RuntimeException("getRemoteBuckets failed", e);
+        } catch (InterruptedException | TimeoutException e) {
+            throw new IllegalStateException("getRemoteBuckets failed", e);
         }
     }
 
-    @SuppressWarnings({"unchecked", "checkstyle:IllegalCatch", "rawtypes"})
+    @SuppressWarnings({"unchecked", "rawtypes"})
     final String bucketVersions() {
         try {
             return Await.result((Future)bucketAccess.getBucketVersions(), timeout).toString();
-        } catch (Exception e) {
-            throw new RuntimeException("getVersions failed", e);
+        } catch (InterruptedException | TimeoutException e) {
+            throw new IllegalStateException("getVersions failed", e);
         }
     }
 }