+ LOG.debug("Un-registration serviceClass {} for Node {}", serviceClass.getSimpleName(), nodeInstanceIdentifier.getKey().getId().getValue());
+ }
+ }
+
+ @VisibleForTesting
+ boolean isEmptyRpcRegistrations() {
+ return this.rpcRegistrations.isEmpty();
+ }
+
+ @Override
+ public ServiceGroupIdentifier getServiceIdentifier() {
+ return this.deviceInfo.getServiceIdentifier();
+ }
+
+ @Override
+ public DeviceInfo getDeviceInfo() {
+ return this.deviceInfo;
+ }
+
+ @Override
+ public ListenableFuture<Void> stopClusterServices() {
+ if (ContextState.TERMINATION.equals(this.state)) {
+ return Futures.immediateCancelledFuture();
+ }
+
+ return Futures.transform(Futures.immediateFuture(null), new Function<Object, Void>() {
+ @Nullable
+ @Override
+ public Void apply(@Nullable Object input) {
+ unregisterRPCs();
+ return null;
+ }
+ });
+ }
+
+ @Override
+ public boolean onContextInstantiateService(final MastershipChangeListener mastershipChangeListener) {
+ LOG.info("Starting rpc context cluster services for node {}", deviceInfo.getLOGValue());
+ MdSalRegistrationUtils.registerServices(this, deviceContext, extensionConverterProvider, convertorExecutor);
+
+ if (isStatisticsRpcEnabled && !deviceContext.canUseSingleLayerSerialization()) {
+ MdSalRegistrationUtils.registerStatCompatibilityServices(
+ this,
+ deviceContext,
+ notificationPublishService,
+ convertorExecutor);