Remove RestConnectorProvider 78/71178/1
authorTom Pantelis <tompantelis@gmail.com>
Fri, 20 Apr 2018 18:58:40 +0000 (14:58 -0400)
committerTom Pantelis <tompantelis@gmail.com>
Fri, 20 Apr 2018 18:58:40 +0000 (14:58 -0400)
RestConnectorProvider has been reduced to just initialize the
ServiceWrapper instance so is no longer needed. Also the ServiceWrapper
interface is no longer needed and, as a result, the ServicesWrapperImpl
class was renamed to just ServiceWrappers. The ServiceWrappers
is now instantiated/initiated via blueprint. The static instance
remains temporarily for the RestconfApplication.

Change-Id: I643d18a6980b5f51262396c49af281515b94868f
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestConnectorProvider.java [deleted file]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestconfApplication.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestconfConnector.java [deleted file]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/wrapper/ServiceWrapper.java [deleted file]
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/wrapper/ServicesWrapper.java [moved from restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/wrapper/ServicesWrapperImpl.java with 85% similarity]
restconf/restconf-nb-rfc8040/src/main/resources/org/opendaylight/blueprint/restconf-bp.xml
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/RestConnectorProviderTest.java [deleted file]
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JSONRestconfServiceRfc8040ImplTest.java

diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestConnectorProvider.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestConnectorProvider.java
deleted file mode 100644 (file)
index 6b21b7c..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.restconf.nb.rfc8040;
-
-import com.google.common.base.Preconditions;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMNotificationService;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.nb.rfc8040.handlers.DOMDataBrokerHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.NotificationServiceHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.RpcServiceHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.TransactionChainHandler;
-import org.opendaylight.restconf.nb.rfc8040.services.wrapper.ServiceWrapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Provider for restconf draft18.
- *
- */
-public class RestConnectorProvider<T extends ServiceWrapper> implements RestconfConnector, AutoCloseable {
-
-    private static final Logger LOG = LoggerFactory.getLogger(RestConnectorProvider.class);
-
-    private final DOMRpcService rpcService;
-    private final DOMNotificationService notificationService;
-    private final DOMSchemaService domSchemaService;
-    private final TransactionChainHandler transactionChainHandler;
-    private final DOMDataBroker dataBroker;
-    private final SchemaContextHandler schemaCtxHandler;
-    private final DOMMountPointServiceHandler mountPointServiceHandler;
-    private final T wrapperServices;
-
-    public RestConnectorProvider(final DOMDataBroker domDataBroker, final DOMSchemaService domSchemaService,
-            final DOMRpcService rpcService, final DOMNotificationService notificationService,
-            final TransactionChainHandler transactionChainHandler,
-            final SchemaContextHandler schemaCtxHandler, final DOMMountPointServiceHandler mountPointServiceHandler,
-            final T wrapperServices) {
-        this.wrapperServices = wrapperServices;
-        this.domSchemaService = Preconditions.checkNotNull(domSchemaService);
-        this.rpcService = Preconditions.checkNotNull(rpcService);
-        this.notificationService = Preconditions.checkNotNull(notificationService);
-        this.transactionChainHandler = Preconditions.checkNotNull(transactionChainHandler);
-        this.dataBroker = Preconditions.checkNotNull(domDataBroker);
-        this.schemaCtxHandler = Preconditions.checkNotNull(schemaCtxHandler);
-        this.mountPointServiceHandler = Preconditions.checkNotNull(mountPointServiceHandler);
-    }
-
-    public synchronized void start() {
-        final DOMDataBrokerHandler brokerHandler = new DOMDataBrokerHandler(dataBroker);
-
-        final RpcServiceHandler rpcServiceHandler = new RpcServiceHandler(rpcService);
-
-        final NotificationServiceHandler notificationServiceHandler =
-                new NotificationServiceHandler(notificationService);
-
-        if (wrapperServices != null) {
-            wrapperServices.setHandlers(this.schemaCtxHandler, mountPointServiceHandler,
-                    transactionChainHandler, brokerHandler, rpcServiceHandler,
-                    notificationServiceHandler, domSchemaService);
-        }
-    }
-
-    @Override
-    public void close() {
-    }
-}
index c8c328b0d2a7bf665070b3cf4628bbcc3e216e4f..76b560c296196d7f3811e7111304d2b335b73272 100644 (file)
@@ -23,7 +23,7 @@ import org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch.PatchXmlBodyW
 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch.XmlToPatchBodyReader;
 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.schema.SchemaExportContentYangBodyWriter;
 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.schema.SchemaExportContentYinBodyWriter;
-import org.opendaylight.restconf.nb.rfc8040.services.wrapper.ServicesWrapperImpl;
+import org.opendaylight.restconf.nb.rfc8040.services.wrapper.ServicesWrapper;
 
 public class RestconfApplication extends Application {
     private final SchemaContextHandler schemaContextHandler = SchemaContextHandler.instance();
@@ -41,7 +41,7 @@ public class RestconfApplication extends Application {
     @Override
     public Set<Object> getSingletons() {
         final Set<Object> singletons = new HashSet<>();
-        singletons.add(ServicesWrapperImpl.getInstance());
+        singletons.add(ServicesWrapper.getInstance());
         singletons.add(new JsonNormalizedNodeBodyReader(schemaContextHandler, mountPointServiceHandler));
         singletons.add(new JsonToPatchBodyReader(schemaContextHandler, mountPointServiceHandler));
         singletons.add(new XmlNormalizedNodeBodyReader(schemaContextHandler, mountPointServiceHandler));
diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestconfConnector.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestconfConnector.java
deleted file mode 100644 (file)
index 26a53cd..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.restconf.nb.rfc8040;
-
-/*
- * This is a simple dummy interface to allow us to create instances of RestconfProvider
- * via the config subsystem.
- */
-public interface RestconfConnector {
-
-}
diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/wrapper/ServiceWrapper.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/wrapper/ServiceWrapper.java
deleted file mode 100644 (file)
index 157d7d4..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2017 Pantheon Technologies, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.nb.rfc8040.services.wrapper;
-
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.nb.rfc8040.handlers.DOMDataBrokerHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.NotificationServiceHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.RpcServiceHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.TransactionChainHandler;
-
-public interface ServiceWrapper {
-
-    void setHandlers(SchemaContextHandler schemaCtxHandler, DOMMountPointServiceHandler domMountPointServiceHandler,
-            TransactionChainHandler transactionChainHandler, DOMDataBrokerHandler domDataBrokerHandler,
-            RpcServiceHandler rpcServiceHandler, NotificationServiceHandler notificationServiceHandler,
-            DOMSchemaService domSchemaService);
-}
@@ -46,7 +46,7 @@ import org.opendaylight.restconf.nb.rfc8040.services.simple.impl.RestconfSchemaS
  *
  */
 @Path("/")
-public final class ServicesWrapperImpl implements BaseServicesWrapper, TransactionServicesWrapper, ServiceWrapper {
+public final class ServicesWrapper implements BaseServicesWrapper, TransactionServicesWrapper {
 
     private RestconfDataService delegRestconfDataService;
     private RestconfInvokeOperationsService delegRestconfInvokeOpsService;
@@ -55,14 +55,41 @@ public final class ServicesWrapperImpl implements BaseServicesWrapper, Transacti
     private RestconfSchemaService delegRestSchService;
     private RestconfService delegRestService;
 
-    private ServicesWrapperImpl() {
+    @Deprecated
+    private ServicesWrapper() {
     }
 
     private static class InstanceHolder {
-        public static final ServicesWrapperImpl INSTANCE = new ServicesWrapperImpl();
+        public static final ServicesWrapper INSTANCE = new ServicesWrapper();
     }
 
-    public static ServicesWrapperImpl getInstance() {
+    @Deprecated
+    public static ServicesWrapper getInstance() {
+        return InstanceHolder.INSTANCE;
+    }
+
+    public static ServicesWrapper newInstance(final SchemaContextHandler schemaCtxHandler,
+            final DOMMountPointServiceHandler domMountPointServiceHandler,
+            final TransactionChainHandler transactionChainHandler, final DOMDataBrokerHandler domDataBrokerHandler,
+            final RpcServiceHandler rpcServiceHandler, final NotificationServiceHandler notificationServiceHandler,
+            final DOMSchemaService domSchemaService) {
+        InstanceHolder.INSTANCE.delegRestOpsService =
+                new RestconfOperationsServiceImpl(schemaCtxHandler, domMountPointServiceHandler);
+        final DOMYangTextSourceProvider yangTextSourceProvider =
+                (DOMYangTextSourceProvider) domSchemaService.getSupportedExtensions()
+                        .get(DOMYangTextSourceProvider.class);
+        InstanceHolder.INSTANCE.delegRestSchService =
+                new RestconfSchemaServiceImpl(schemaCtxHandler, domMountPointServiceHandler,
+                yangTextSourceProvider);
+        InstanceHolder.INSTANCE.delegRestconfSubscrService =
+                new RestconfStreamsSubscriptionServiceImpl(domDataBrokerHandler,
+                notificationServiceHandler, schemaCtxHandler, transactionChainHandler);
+        InstanceHolder.INSTANCE.delegRestconfDataService =
+                new RestconfDataServiceImpl(schemaCtxHandler, transactionChainHandler, domMountPointServiceHandler,
+                        InstanceHolder.INSTANCE.delegRestconfSubscrService);
+        InstanceHolder.INSTANCE.delegRestconfInvokeOpsService =
+                new RestconfInvokeOperationsServiceImpl(rpcServiceHandler, schemaCtxHandler);
+        InstanceHolder.INSTANCE.delegRestService = new RestconfImpl(schemaCtxHandler);
         return InstanceHolder.INSTANCE;
     }
 
@@ -136,26 +163,4 @@ public final class ServicesWrapperImpl implements BaseServicesWrapper, Transacti
     public NormalizedNodeContext getLibraryVersion() {
         return this.delegRestService.getLibraryVersion();
     }
-
-    @Override
-    public void setHandlers(final SchemaContextHandler schemaCtxHandler,
-            final DOMMountPointServiceHandler domMountPointServiceHandler,
-            final TransactionChainHandler transactionChainHandler, final DOMDataBrokerHandler domDataBrokerHandler,
-            final RpcServiceHandler rpcServiceHandler, final NotificationServiceHandler notificationServiceHandler,
-            final DOMSchemaService domSchemaService) {
-        this.delegRestOpsService = new RestconfOperationsServiceImpl(schemaCtxHandler, domMountPointServiceHandler);
-        final DOMYangTextSourceProvider yangTextSourceProvider =
-                (DOMYangTextSourceProvider) domSchemaService.getSupportedExtensions()
-                        .get(DOMYangTextSourceProvider.class);
-        this.delegRestSchService = new RestconfSchemaServiceImpl(schemaCtxHandler, domMountPointServiceHandler,
-                yangTextSourceProvider);
-        this.delegRestconfSubscrService = new RestconfStreamsSubscriptionServiceImpl(domDataBrokerHandler,
-                notificationServiceHandler, schemaCtxHandler, transactionChainHandler);
-        this.delegRestconfDataService =
-                new RestconfDataServiceImpl(schemaCtxHandler, transactionChainHandler, domMountPointServiceHandler,
-                        this.delegRestconfSubscrService);
-        this.delegRestconfInvokeOpsService =
-                new RestconfInvokeOperationsServiceImpl(rpcServiceHandler, schemaCtxHandler);
-        this.delegRestService = new RestconfImpl(schemaCtxHandler);
-    }
 }
index b8d27c5693699974b74af957a442306eb6242e0e..022982962ffc2fc00b4f53fbd2bc62c76b1257f1 100644 (file)
@@ -36,9 +36,6 @@
           ext:filter="(type=@{databroker-service-type})"/>
   <reference id="domSchemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService"/>
 
-  <bean id="wrapper" class="org.opendaylight.restconf.nb.rfc8040.services.wrapper.ServicesWrapperImpl"
-          factory-method="getInstance" />
-
   <bean id="transactionChainHandler" class="org.opendaylight.restconf.nb.rfc8040.handlers.TransactionChainHandler"
           destroy-method="close">
     <argument ref="domDataBroker"/>
     <argument ref="domMountPointService"/>
   </bean>
 
-  <bean id="restconfProvider" class="org.opendaylight.restconf.nb.rfc8040.RestConnectorProvider"
-          init-method="start" destroy-method="close">
+  <bean id="dataBrokerHandler" class="org.opendaylight.restconf.nb.rfc8040.handlers.DOMDataBrokerHandler">
     <argument ref="domDataBroker"/>
-    <argument ref="domSchemaService"/>
+  </bean>
+
+  <bean id="rpcServiceHandler" class="org.opendaylight.restconf.nb.rfc8040.handlers.RpcServiceHandler">
     <argument ref="domRpcService"/>
+  </bean>
+
+  <bean id="notificationServiceHandler" class="org.opendaylight.restconf.nb.rfc8040.handlers.NotificationServiceHandler">
     <argument ref="domNotificationService"/>
-    <argument ref="transactionChainHandler"/>
+  </bean>
+
+  <bean id="servicesWrapper" class="org.opendaylight.restconf.nb.rfc8040.services.wrapper.ServicesWrapper"
+      factory-method="newInstance">
     <argument ref="schemaContextHandler"/>
     <argument ref="mountPointServiceHandler"/>
-    <argument ref="wrapper"/>
+    <argument ref="transactionChainHandler"/>
+    <argument ref="dataBrokerHandler"/>
+    <argument ref="rpcServiceHandler"/>
+    <argument ref="notificationServiceHandler"/>
+    <argument ref="domSchemaService"/>
   </bean>
 
-  <service ref="restconfProvider"
-      interface="org.opendaylight.restconf.nb.rfc8040.RestconfConnector" />
-
   <!-- JSONRestconfService -->
-  <bean id="jsonRestconfService" depends-on="restconfProvider"
+  <bean id="jsonRestconfService"
       class="org.opendaylight.restconf.nb.rfc8040.rests.services.impl.JSONRestconfServiceRfc8040Impl"
       destroy-method="close">
-    <argument ref="wrapper"/>
+    <argument ref="servicesWrapper"/>
     <argument ref="mountPointServiceHandler"/>
     <argument ref="schemaContextHandler"/>
   </bean>
diff --git a/restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/RestConnectorProviderTest.java b/restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/RestConnectorProviderTest.java
deleted file mode 100644 (file)
index c02c2d2..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.restconf.nb.rfc8040;
-
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.verify;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.md.sal.dom.api.DOMNotificationService;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
-import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
-import org.opendaylight.restconf.nb.rfc8040.handlers.TransactionChainHandler;
-import org.opendaylight.restconf.nb.rfc8040.services.wrapper.ServicesWrapperImpl;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
-
-/**
- * Unit tests for {@link RestConnectorProvider}.
- */
-public class RestConnectorProviderTest {
-    // service under test
-    private RestConnectorProvider<?> connectorProvider;
-
-    @Mock private DOMMountPointService mockMountPointService;
-    @Mock private DOMDataBroker mockDataBroker;
-    @Mock private DOMRpcService mockRpcService;
-    @Mock private DOMNotificationService mockNotificationService;
-    @Mock DOMTransactionChain mockTransactionChain;
-    @Mock private ListenerRegistration<SchemaContextListener> mockRegistration;
-    @Mock
-    private DOMSchemaService domSchemaService;
-
-    @Rule
-    public ExpectedException thrown = ExpectedException.none();
-
-    @Before
-    public void init() {
-        MockitoAnnotations.initMocks(this);
-
-        doReturn(mockTransactionChain).when(mockDataBroker).createTransactionChain(Mockito.any());
-        doReturn(mockRegistration).when(domSchemaService).registerSchemaContextListener(
-                Mockito.any(SchemaContextHandler.class));
-
-        final TransactionChainHandler transactionChainHandler = new TransactionChainHandler(mockDataBroker);
-        this.connectorProvider = new RestConnectorProvider<>(mockDataBroker, domSchemaService, mockRpcService,
-                mockNotificationService, transactionChainHandler,
-                SchemaContextHandler.newInstance(transactionChainHandler, domSchemaService),
-                DOMMountPointServiceHandler.newInstance(mockMountPointService),
-                ServicesWrapperImpl.getInstance());
-    }
-
-    /**
-     * Test for successful start when all conditions are satisfied.
-     */
-    @Test
-    public void successfulStartTest() {
-        // test
-        this.connectorProvider.start();
-
-        // verify interactions
-        verify(mockDataBroker).createTransactionChain(Mockito.any());
-    }
-
-    /**
-     * Test of closing <code>null</code> registration.
-     */
-    @Test
-    public void closeNotOpenTest() throws Exception {
-        this.connectorProvider.close();
-    }
-
-    /**
-     * Test of creating and closing not <code>null</code> registration.
-     */
-    @Test
-    public void closeOpenTest() throws Exception {
-        // start
-        this.connectorProvider.start();
-
-        // close
-        this.connectorProvider.close();
-    }
-}
index b6a81801f3f0c61a29bf65ff749aa7c415c8da29..bad0decc33afc2f0047fa8308901a705e7fb5dd0 100644 (file)
@@ -58,7 +58,7 @@ import org.opendaylight.restconf.nb.rfc8040.handlers.NotificationServiceHandler;
 import org.opendaylight.restconf.nb.rfc8040.handlers.RpcServiceHandler;
 import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
 import org.opendaylight.restconf.nb.rfc8040.handlers.TransactionChainHandler;
-import org.opendaylight.restconf.nb.rfc8040.services.wrapper.ServicesWrapperImpl;
+import org.opendaylight.restconf.nb.rfc8040.services.wrapper.ServicesWrapper;
 import org.opendaylight.yangtools.yang.common.OperationFailedException;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -180,12 +180,12 @@ public class JSONRestconfServiceRfc8040ImplTest {
                 DOMMountPointServiceHandler.newInstance(mockMountPointService);
 
         final DOMNotificationService mockNotificationService = mock(DOMNotificationService.class);
-        ServicesWrapperImpl.getInstance().setHandlers(schemaContextHandler, mountPointServiceHandler,
-                txChainHandler, new DOMDataBrokerHandler(mockDOMDataBroker),
-                new RpcServiceHandler(mockRpcService),
-                new NotificationServiceHandler(mockNotificationService), domSchemaService);
+        final ServicesWrapper servicesWrapper = ServicesWrapper.newInstance(schemaContextHandler,
+                mountPointServiceHandler, txChainHandler, new DOMDataBrokerHandler(mockDOMDataBroker),
+                new RpcServiceHandler(mockRpcService), new NotificationServiceHandler(mockNotificationService),
+                domSchemaService);
 
-        service = new JSONRestconfServiceRfc8040Impl(ServicesWrapperImpl.getInstance(), mountPointServiceHandler,
+        service = new JSONRestconfServiceRfc8040Impl(servicesWrapper, mountPointServiceHandler,
                 schemaContextHandler);
     }