- @Override
- public void onRpcImplementationRemoved(QName rpc) {
- LOG.debug("Removing registration for [{}]", rpc);
- RouteIdentifierImpl routeId = new RouteIdentifierImpl(null, rpc, null);
- RemoveRpc removeRpcMsg = new RemoveRpc(routeId);
- try {
- ActorUtil.executeLocalOperation(rpcRegistry, removeRpcMsg, ActorUtil.LOCAL_ASK_DURATION, ActorUtil.LOCAL_AWAIT_DURATION);
- } catch (Exception e) {
- // Just logging it because Akka API throws this exception
- LOG.error(e.toString());
+ @Override
+ public void onRpcUnavailable(@Nonnull final Collection<DOMRpcIdentifier> rpcs) {
+ Preconditions.checkArgument(rpcs != null, "Input Collection of DOMRpcIdentifier can not be null.");
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Removing registration for [{}]", rpcs);
+ }
+ final List<RpcRouter.RouteIdentifier<?,?,?>> routeIds = new ArrayList<>();
+ for (final DOMRpcIdentifier rpc : rpcs) {
+ final RpcRouter.RouteIdentifier<?,?,?> routeId = new RouteIdentifierImpl(null, rpc.getType().getLastComponent(), null);
+ routeIds.add(routeId);
+ }
+ final RpcRegistry.Messages.RemoveRoutes removeRpcMsg = new RpcRegistry.Messages.RemoveRoutes(routeIds);
+ rpcRegistry.tell(removeRpcMsg, ActorRef.noSender());