Split out OperationInvocation
[mdsal.git] / dom / mdsal-dom-broker / src / main / java / org / opendaylight / mdsal / dom / broker / DOMRpcRouter.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.dom.broker;
9
10 import static com.google.common.base.Preconditions.checkArgument;
11 import static com.google.common.base.Verify.verifyNotNull;
12 import static java.util.Objects.requireNonNull;
13
14 import com.google.common.annotations.VisibleForTesting;
15 import com.google.common.collect.ClassToInstanceMap;
16 import com.google.common.collect.Collections2;
17 import com.google.common.collect.ImmutableClassToInstanceMap;
18 import com.google.common.collect.ImmutableList;
19 import com.google.common.collect.ImmutableSet;
20 import com.google.common.collect.ImmutableTable;
21 import com.google.common.collect.MapDifference;
22 import com.google.common.collect.MapDifference.ValueDifference;
23 import com.google.common.collect.Maps;
24 import com.google.common.collect.Sets;
25 import com.google.common.util.concurrent.Futures;
26 import com.google.common.util.concurrent.ListenableFuture;
27 import com.google.common.util.concurrent.ThreadFactoryBuilder;
28 import java.util.ArrayList;
29 import java.util.Collection;
30 import java.util.HashSet;
31 import java.util.List;
32 import java.util.Map;
33 import java.util.Map.Entry;
34 import java.util.Set;
35 import java.util.concurrent.ExecutorService;
36 import java.util.concurrent.Executors;
37 import java.util.concurrent.ThreadFactory;
38 import javax.annotation.PreDestroy;
39 import javax.inject.Inject;
40 import javax.inject.Singleton;
41 import org.checkerframework.checker.lock.qual.GuardedBy;
42 import org.eclipse.jdt.annotation.NonNull;
43 import org.eclipse.jdt.annotation.NonNullByDefault;
44 import org.opendaylight.mdsal.dom.api.DOMActionAvailabilityExtension;
45 import org.opendaylight.mdsal.dom.api.DOMActionAvailabilityExtension.AvailabilityListener;
46 import org.opendaylight.mdsal.dom.api.DOMActionImplementation;
47 import org.opendaylight.mdsal.dom.api.DOMActionInstance;
48 import org.opendaylight.mdsal.dom.api.DOMActionNotAvailableException;
49 import org.opendaylight.mdsal.dom.api.DOMActionProviderService;
50 import org.opendaylight.mdsal.dom.api.DOMActionResult;
51 import org.opendaylight.mdsal.dom.api.DOMActionService;
52 import org.opendaylight.mdsal.dom.api.DOMActionServiceExtension;
53 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
54 import org.opendaylight.mdsal.dom.api.DOMRpcAvailabilityListener;
55 import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
56 import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
57 import org.opendaylight.mdsal.dom.api.DOMRpcImplementationNotAvailableException;
58 import org.opendaylight.mdsal.dom.api.DOMRpcImplementationRegistration;
59 import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
60 import org.opendaylight.mdsal.dom.api.DOMRpcResult;
61 import org.opendaylight.mdsal.dom.api.DOMRpcService;
62 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
63 import org.opendaylight.mdsal.dom.spi.AbstractDOMRpcImplementationRegistration;
64 import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
65 import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
66 import org.opendaylight.yangtools.concepts.AbstractRegistration;
67 import org.opendaylight.yangtools.concepts.ListenerRegistration;
68 import org.opendaylight.yangtools.concepts.ObjectRegistration;
69 import org.opendaylight.yangtools.concepts.Registration;
70 import org.opendaylight.yangtools.yang.common.QName;
71 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
72 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
73 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
74 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContextListener;
75 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
76 import org.osgi.service.component.annotations.Activate;
77 import org.osgi.service.component.annotations.Component;
78 import org.osgi.service.component.annotations.Deactivate;
79 import org.osgi.service.component.annotations.Reference;
80 import org.slf4j.Logger;
81 import org.slf4j.LoggerFactory;
82
83 @Singleton
84 @Component(immediate = true, service = DOMRpcRouterServices.class)
85 public final class DOMRpcRouter extends AbstractRegistration
86         implements DOMRpcRouterServices, EffectiveModelContextListener {
87     private static final Logger LOG = LoggerFactory.getLogger(DOMRpcRouter.class);
88     private static final ThreadFactory THREAD_FACTORY = new ThreadFactoryBuilder().setNameFormat(
89             "DOMRpcRouter-listener-%s").setDaemon(true).build();
90
91     private final ExecutorService listenerNotifier = Executors.newSingleThreadExecutor(THREAD_FACTORY);
92     private final @NonNull DOMActionProviderService actionProviderService = new ActionProviderServiceFacade();
93     private final @NonNull DOMActionService actionService = new ActionServiceFacade();
94     private final @NonNull DOMRpcProviderService rpcProviderService = new RpcProviderServiceFacade();
95     private final @NonNull DOMRpcService rpcService = new RpcServiceFacade();
96
97     @GuardedBy("this")
98     private ImmutableList<RegImpl<?>> listeners = ImmutableList.of();
99
100     @GuardedBy("this")
101     private ImmutableList<ActionRegistration<?>> actionListeners = ImmutableList.of();
102
103     private volatile DOMRpcRoutingTable routingTable = DOMRpcRoutingTable.EMPTY;
104
105     private volatile DOMActionRoutingTable actionRoutingTable = DOMActionRoutingTable.EMPTY;
106
107     private Registration listenerRegistration;
108
109     @Deprecated
110     @VisibleForTesting
111     // FIXME: 9.0.0: make this constructor package-private
112     public DOMRpcRouter() {
113
114     }
115
116     @Inject
117     @Activate
118     public DOMRpcRouter(@Reference final DOMSchemaService schemaService) {
119         listenerRegistration = schemaService.registerSchemaContextListener(this);
120         LOG.info("DOM RPC/Action router started");
121     }
122
123     @Deprecated(forRemoval = true)
124     public static DOMRpcRouter newInstance(final DOMSchemaService schemaService) {
125         return new DOMRpcRouter(schemaService);
126     }
127
128     @PreDestroy
129     @Deactivate
130     public void shutdown() {
131         close();
132     }
133
134     @Override
135     public DOMActionService getActionService() {
136         return actionService;
137     }
138
139     @Override
140     public DOMActionProviderService getActionProviderService() {
141         return actionProviderService;
142     }
143
144     @Override
145     public DOMRpcService getRpcService() {
146         return rpcService;
147     }
148
149     @Override
150     public DOMRpcProviderService getRpcProviderService() {
151         return rpcProviderService;
152     }
153
154     private synchronized void removeRpcImplementation(final DOMRpcImplementation implementation,
155             final Set<DOMRpcIdentifier> rpcs) {
156         final DOMRpcRoutingTable oldTable = routingTable;
157         final DOMRpcRoutingTable newTable = (DOMRpcRoutingTable) oldTable.remove(implementation, rpcs);
158         routingTable = newTable;
159
160         listenerNotifier.execute(() -> notifyRemoved(newTable, implementation));
161     }
162
163     private synchronized void removeRpcImplementations(
164             final ImmutableTable<QName, YangInstanceIdentifier, DOMRpcImplementation> implTable) {
165         final DOMRpcRoutingTable oldTable = routingTable;
166         final DOMRpcRoutingTable newTable = (DOMRpcRoutingTable) oldTable.removeAll(implTable);
167         routingTable = newTable;
168
169         listenerNotifier.execute(() -> notifyRemoved(newTable, implTable.values()));
170     }
171
172     private synchronized void removeActionImplementation(final DOMActionImplementation implementation,
173             final Set<DOMActionInstance> actions) {
174         final DOMActionRoutingTable oldTable = actionRoutingTable;
175         final DOMActionRoutingTable newTable = (DOMActionRoutingTable) oldTable.remove(implementation, actions);
176         actionRoutingTable = newTable;
177
178         listenerNotifier.execute(() -> notifyActionChanged(newTable, implementation));
179     }
180
181     private synchronized void removeListener(final ListenerRegistration<? extends DOMRpcAvailabilityListener> reg) {
182         listeners = ImmutableList.copyOf(Collections2.filter(listeners, input -> !reg.equals(input)));
183     }
184
185     private synchronized void removeActionListener(final ListenerRegistration<? extends AvailabilityListener> reg) {
186         actionListeners = ImmutableList.copyOf(Collections2.filter(actionListeners, input -> !reg.equals(input)));
187     }
188
189     private synchronized void notifyAdded(final DOMRpcRoutingTable newTable, final DOMRpcImplementation impl) {
190         for (RegImpl<?> l : listeners) {
191             l.addRpc(newTable, impl);
192         }
193     }
194
195     private synchronized void notifyAdded(final DOMRpcRoutingTable newTable,
196             final Collection<? extends DOMRpcImplementation> impls) {
197         for (RegImpl<?> l : listeners) {
198             for (DOMRpcImplementation impl : impls) {
199                 l.addRpc(newTable, impl);
200             }
201         }
202     }
203
204     private synchronized void notifyRemoved(final DOMRpcRoutingTable newTable, final DOMRpcImplementation impl) {
205         for (RegImpl<?> l : listeners) {
206             l.removeRpc(newTable, impl);
207         }
208     }
209
210     private synchronized void notifyRemoved(final DOMRpcRoutingTable newTable,
211             final Collection<? extends DOMRpcImplementation> impls) {
212         for (RegImpl<?> l : listeners) {
213             for (DOMRpcImplementation impl : impls) {
214                 l.removeRpc(newTable, impl);
215             }
216         }
217     }
218
219     private synchronized void notifyActionChanged(final DOMActionRoutingTable newTable,
220             final DOMActionImplementation impl) {
221         for (ActionRegistration<?> l : actionListeners) {
222             l.actionChanged(newTable, impl);
223         }
224     }
225
226     @Override
227     public synchronized void onModelContextUpdated(final EffectiveModelContext newModelContext) {
228         final DOMRpcRoutingTable oldTable = routingTable;
229         final DOMRpcRoutingTable newTable = (DOMRpcRoutingTable) oldTable.setSchemaContext(newModelContext);
230         routingTable = newTable;
231
232         final DOMActionRoutingTable oldActionTable = actionRoutingTable;
233         final DOMActionRoutingTable newActionTable =
234                 (DOMActionRoutingTable) oldActionTable.setSchemaContext(newModelContext);
235         actionRoutingTable = newActionTable;
236     }
237
238     @Override
239     protected void removeRegistration() {
240         if (listenerRegistration != null) {
241             listenerRegistration.close();
242             listenerRegistration = null;
243         }
244         listenerNotifier.shutdown();
245         LOG.info("DOM RPC/Action router stopped");
246     }
247
248     @VisibleForTesting
249     synchronized List<?> listeners() {
250         return listeners;
251     }
252
253     @VisibleForTesting
254     synchronized List<?> actionListeners() {
255         return actionListeners;
256     }
257
258     @VisibleForTesting
259     DOMRpcRoutingTable routingTable() {
260         return routingTable;
261     }
262
263     private static final class RegImpl<T extends DOMRpcAvailabilityListener> extends AbstractListenerRegistration<T> {
264         private Map<QName, Set<YangInstanceIdentifier>> prevRpcs;
265         private DOMRpcRouter router;
266
267         RegImpl(final DOMRpcRouter router, final T listener, final Map<QName, Set<YangInstanceIdentifier>> rpcs) {
268             super(listener);
269             this.router = requireNonNull(router);
270             prevRpcs = requireNonNull(rpcs);
271         }
272
273         @Override
274         protected void removeRegistration() {
275             router.removeListener(this);
276             router = null;
277         }
278
279         void initialTable() {
280             final List<DOMRpcIdentifier> added = new ArrayList<>();
281             for (Entry<QName, Set<YangInstanceIdentifier>> e : prevRpcs.entrySet()) {
282                 added.addAll(Collections2.transform(e.getValue(), i -> DOMRpcIdentifier.create(e.getKey(), i)));
283             }
284             if (!added.isEmpty()) {
285                 getInstance().onRpcAvailable(added);
286             }
287         }
288
289         void addRpc(final DOMRpcRoutingTable newTable, final DOMRpcImplementation impl) {
290             final T l = getInstance();
291             if (!l.acceptsImplementation(impl)) {
292                 return;
293             }
294
295             final Map<QName, Set<YangInstanceIdentifier>> rpcs = verifyNotNull(newTable.getOperations(l));
296             final MapDifference<QName, Set<YangInstanceIdentifier>> diff = Maps.difference(prevRpcs, rpcs);
297
298             final List<DOMRpcIdentifier> added = new ArrayList<>();
299             for (Entry<QName, Set<YangInstanceIdentifier>> e : diff.entriesOnlyOnRight().entrySet()) {
300                 added.addAll(Collections2.transform(e.getValue(), i -> DOMRpcIdentifier.create(e.getKey(), i)));
301             }
302             for (Entry<QName, ValueDifference<Set<YangInstanceIdentifier>>> e : diff.entriesDiffering().entrySet()) {
303                 for (YangInstanceIdentifier i : Sets.difference(e.getValue().rightValue(), e.getValue().leftValue())) {
304                     added.add(DOMRpcIdentifier.create(e.getKey(), i));
305                 }
306             }
307
308             prevRpcs = rpcs;
309             if (!added.isEmpty()) {
310                 l.onRpcAvailable(added);
311             }
312         }
313
314         void removeRpc(final DOMRpcRoutingTable newTable, final DOMRpcImplementation impl) {
315             final T l = getInstance();
316             if (!l.acceptsImplementation(impl)) {
317                 return;
318             }
319
320             final Map<QName, Set<YangInstanceIdentifier>> rpcs = verifyNotNull(newTable.getOperations(l));
321             final MapDifference<QName, Set<YangInstanceIdentifier>> diff = Maps.difference(prevRpcs, rpcs);
322
323             final List<DOMRpcIdentifier> removed = new ArrayList<>();
324             for (Entry<QName, Set<YangInstanceIdentifier>> e : diff.entriesOnlyOnLeft().entrySet()) {
325                 removed.addAll(Collections2.transform(e.getValue(), i -> DOMRpcIdentifier.create(e.getKey(), i)));
326             }
327             for (Entry<QName, ValueDifference<Set<YangInstanceIdentifier>>> e : diff.entriesDiffering().entrySet()) {
328                 for (YangInstanceIdentifier i : Sets.difference(e.getValue().leftValue(), e.getValue().rightValue())) {
329                     removed.add(DOMRpcIdentifier.create(e.getKey(), i));
330                 }
331             }
332
333             prevRpcs = rpcs;
334             if (!removed.isEmpty()) {
335                 l.onRpcUnavailable(removed);
336             }
337         }
338     }
339
340     private static final class ActionRegistration<T extends AvailabilityListener>
341         extends AbstractListenerRegistration<T> {
342
343         private Map<Absolute, Set<DOMDataTreeIdentifier>> prevActions;
344         private DOMRpcRouter router;
345
346         ActionRegistration(final DOMRpcRouter router, final T listener,
347                 final Map<Absolute, Set<DOMDataTreeIdentifier>> actions) {
348             super(listener);
349             this.router = requireNonNull(router);
350             prevActions = requireNonNull(actions);
351         }
352
353         @Override
354         protected void removeRegistration() {
355             router.removeActionListener(this);
356             router = null;
357         }
358
359         void initialTable() {
360             final List<DOMActionInstance> added = new ArrayList<>();
361             for (Entry<Absolute, Set<DOMDataTreeIdentifier>> e : prevActions.entrySet()) {
362                 added.addAll(Collections2.transform(e.getValue(), i -> DOMActionInstance.of(e.getKey(), i)));
363             }
364             if (!added.isEmpty()) {
365                 getInstance().onActionsChanged(ImmutableSet.of(), ImmutableSet.copyOf(added));
366             }
367         }
368
369         void actionChanged(final DOMActionRoutingTable newTable, final DOMActionImplementation impl) {
370             final T l = getInstance();
371             if (!l.acceptsImplementation(impl)) {
372                 return;
373             }
374
375             final Map<Absolute, Set<DOMDataTreeIdentifier>> actions = verifyNotNull(newTable.getOperations(l));
376             final MapDifference<Absolute, Set<DOMDataTreeIdentifier>> diff = Maps.difference(prevActions, actions);
377
378             final Set<DOMActionInstance> removed = new HashSet<>();
379             final Set<DOMActionInstance> added = new HashSet<>();
380
381             for (Entry<Absolute, Set<DOMDataTreeIdentifier>> e : diff.entriesOnlyOnLeft().entrySet()) {
382                 removed.addAll(Collections2.transform(e.getValue(), i -> DOMActionInstance.of(e.getKey(), i)));
383             }
384
385             for (Entry<Absolute, Set<DOMDataTreeIdentifier>> e : diff.entriesOnlyOnRight().entrySet()) {
386                 added.addAll(Collections2.transform(e.getValue(), i -> DOMActionInstance.of(e.getKey(), i)));
387             }
388
389             for (Entry<Absolute, ValueDifference<Set<DOMDataTreeIdentifier>>> e : diff.entriesDiffering().entrySet()) {
390                 for (DOMDataTreeIdentifier i : Sets.difference(e.getValue().leftValue(), e.getValue().rightValue())) {
391                     removed.add(DOMActionInstance.of(e.getKey(), i));
392                 }
393
394                 for (DOMDataTreeIdentifier i : Sets.difference(e.getValue().rightValue(), e.getValue().leftValue())) {
395                     added.add(DOMActionInstance.of(e.getKey(), i));
396                 }
397             }
398
399             prevActions = actions;
400             if (!removed.isEmpty() || !added.isEmpty()) {
401                 l.onActionsChanged(removed, added);
402             }
403         }
404     }
405
406     @NonNullByDefault
407     private final class ActionAvailabilityFacade implements DOMActionAvailabilityExtension {
408         @Override
409         public <T extends AvailabilityListener> ListenerRegistration<T> registerAvailabilityListener(final T listener) {
410             synchronized (DOMRpcRouter.this) {
411                 final ActionRegistration<T> ret = new ActionRegistration<>(DOMRpcRouter.this, listener,
412                     actionRoutingTable.getOperations(listener));
413                 actionListeners = ImmutableList.<ActionRegistration<?>>builder()
414                     .addAll(actionListeners)
415                     .add(ret)
416                     .build();
417
418                 listenerNotifier.execute(ret::initialTable);
419                 return ret;
420             }
421         }
422     }
423
424     @NonNullByDefault
425     private final class ActionServiceFacade implements DOMActionService {
426         private final ClassToInstanceMap<DOMActionServiceExtension> extensions = ImmutableClassToInstanceMap.of(
427             DOMActionAvailabilityExtension.class, new ActionAvailabilityFacade());
428
429         @Override
430         public ClassToInstanceMap<DOMActionServiceExtension> getExtensions() {
431             return extensions;
432         }
433
434         @Override
435         public ListenableFuture<? extends DOMActionResult> invokeAction(final Absolute type,
436                 final DOMDataTreeIdentifier path, final ContainerNode input) {
437             final YangInstanceIdentifier pathRoot = path.getRootIdentifier();
438             checkArgument(!pathRoot.isEmpty(), "Action path must not be empty");
439
440             final DOMActionRoutingTableEntry entry = (DOMActionRoutingTableEntry) actionRoutingTable.getEntry(type);
441             return entry != null ? OperationInvocation.invoke(entry, type, path, requireNonNull(input))
442                 : Futures.immediateFailedFuture(
443                     new DOMActionNotAvailableException("No implementation of Action %s available", type));
444         }
445     }
446
447     @NonNullByDefault
448     private final class ActionProviderServiceFacade implements DOMActionProviderService {
449         @Override
450         public <T extends DOMActionImplementation> ObjectRegistration<T> registerActionImplementation(
451                 final T implementation, final Set<DOMActionInstance> instances) {
452             checkArgument(!instances.isEmpty(), "Instances must not be empty");
453
454             synchronized (DOMRpcRouter.this) {
455                 final DOMActionRoutingTable oldTable = actionRoutingTable;
456                 final DOMActionRoutingTable newTable = (DOMActionRoutingTable) oldTable.add(implementation, instances);
457                 actionRoutingTable = newTable;
458
459                 listenerNotifier.execute(() -> notifyActionChanged(newTable, implementation));
460             }
461
462             return new AbstractObjectRegistration<>(implementation) {
463                 @Override
464                 protected void removeRegistration() {
465                     removeActionImplementation(getInstance(), instances);
466                 }
467             };
468         }
469     }
470
471     private final class RpcServiceFacade implements DOMRpcService {
472         @Override
473         public ListenableFuture<? extends DOMRpcResult> invokeRpc(final QName type, final ContainerNode input) {
474             final AbstractDOMRpcRoutingTableEntry entry = (AbstractDOMRpcRoutingTableEntry) routingTable.getEntry(type);
475             if (entry == null) {
476                 return Futures.immediateFailedFuture(
477                     new DOMRpcImplementationNotAvailableException("No implementation of RPC %s available", type));
478             }
479
480             return OperationInvocation.invoke(entry, requireNonNull(input));
481         }
482
483         @Override
484         public <T extends DOMRpcAvailabilityListener> ListenerRegistration<T> registerRpcListener(final T listener) {
485             synchronized (DOMRpcRouter.this) {
486                 final RegImpl<T> ret = new RegImpl<>(DOMRpcRouter.this, listener, routingTable.getOperations(listener));
487                 listeners = ImmutableList.<RegImpl<?>>builder().addAll(listeners).add(ret).build();
488
489                 listenerNotifier.execute(ret::initialTable);
490                 return ret;
491             }
492         }
493     }
494
495     private final class RpcProviderServiceFacade implements DOMRpcProviderService {
496         @Override
497         public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
498                 final T implementation, final DOMRpcIdentifier... rpcs) {
499             return registerRpcImplementation(implementation, ImmutableSet.copyOf(rpcs));
500         }
501
502         @Override
503         public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
504                 final T implementation, final Set<DOMRpcIdentifier> rpcs) {
505
506             synchronized (DOMRpcRouter.this) {
507                 final DOMRpcRoutingTable oldTable = routingTable;
508                 final DOMRpcRoutingTable newTable = (DOMRpcRoutingTable) oldTable.add(implementation, rpcs);
509                 routingTable = newTable;
510
511                 listenerNotifier.execute(() -> notifyAdded(newTable, implementation));
512             }
513
514             return new AbstractDOMRpcImplementationRegistration<>(implementation) {
515                 @Override
516                 protected void removeRegistration() {
517                     removeRpcImplementation(getInstance(), rpcs);
518                 }
519             };
520         }
521
522         @Override
523         public org.opendaylight.yangtools.concepts.Registration registerRpcImplementations(
524                 final Map<DOMRpcIdentifier, DOMRpcImplementation> map) {
525             checkArgument(!map.isEmpty());
526
527             final var builder = ImmutableTable.<QName, YangInstanceIdentifier, DOMRpcImplementation>builder();
528             for (var entry : map.entrySet()) {
529                 final var id = entry.getKey();
530                 builder.put(id.getType(), id.getContextReference(), entry.getValue());
531             }
532             final var implTable = builder.build();
533
534             synchronized (DOMRpcRouter.this) {
535                 final DOMRpcRoutingTable oldTable = routingTable;
536                 final DOMRpcRoutingTable newTable = (DOMRpcRoutingTable) oldTable.addAll(implTable);
537                 routingTable = newTable;
538
539                 listenerNotifier.execute(() -> notifyAdded(newTable, implTable.values()));
540             }
541
542             return new AbstractRegistration() {
543                 @Override
544                 protected void removeRegistration() {
545                     removeRpcImplementations(implTable);
546                 }
547             };
548         }
549     }
550 }