- private static final ThreadFactory THREAD_FACTORY = new ThreadFactoryBuilder().setNameFormat("DOMRpcRouter-listener-%s").setDaemon(true).build();
- private final ExecutorService listenerNotifier = Executors.newSingleThreadExecutor(THREAD_FACTORY);
- @GuardedBy("this")
- private Collection<ListenerRegistration<? extends DOMRpcAvailabilityListener>> listeners = Collections.emptyList();
- private volatile DOMRpcRoutingTable routingTable = DOMRpcRoutingTable.EMPTY;
+ private static final ExceptionMapper<org.opendaylight.mdsal.dom.api.DOMRpcException> MDSAL_DOM_RPC_EX_MAPPER =
+ new ExceptionMapper<org.opendaylight.mdsal.dom.api.DOMRpcException>(
+ "rpc", org.opendaylight.mdsal.dom.api.DOMRpcException.class) {
+ @Override
+ protected org.opendaylight.mdsal.dom.api.DOMRpcException newWithCause(String message, Throwable cause) {
+ return cause instanceof org.opendaylight.mdsal.dom.api.DOMRpcException
+ ? (org.opendaylight.mdsal.dom.api.DOMRpcException)cause
+ : new org.opendaylight.mdsal.dom.api.DefaultDOMRpcException("RPC failed", cause);
+ }
+ };
+
+ private static final ExceptionMapper<DOMRpcException> LEGACY_DOM_RPC_EX_MAPPER =
+ new ExceptionMapper<DOMRpcException>("rpc", DOMRpcException.class) {
+ @Override
+ protected DOMRpcException newWithCause(String message, Throwable cause) {
+ return cause instanceof DOMRpcException ? (DOMRpcException)cause
+ : cause instanceof org.opendaylight.mdsal.dom.api.DOMRpcImplementationNotAvailableException
+ ? new DOMRpcImplementationNotAvailableException(cause.getMessage(), cause.getCause())
+ : new DefaultDOMRpcException("RPC failed", cause);
+ }
+ };