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;
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);
}
}
}