Bug 5900 - Jenkins RaceContiditions - problem between Jersey and RestconfProvider
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / restconf / rest / RestconfApplication.java
index 7ab0d4cad83a8cb80091a05a7c0fe4d25cede5b2..ae778993d5937c82301460b24f3d7cf5a21a5c93 100644 (file)
@@ -15,24 +15,9 @@ import org.opendaylight.netconf.md.sal.rest.schema.SchemaExportContentYangBodyWr
 import org.opendaylight.netconf.md.sal.rest.schema.SchemaExportContentYinBodyWriter;
 import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter;
 import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter;
-import org.opendaylight.restconf.rest.api.schema.context.SchemaContextHandler;
-import org.opendaylight.restconf.rest.handlers.api.DOMMountPointServiceHandler;
-import org.opendaylight.restconf.rest.handlers.impl.DOMMountPointServiceHandlerImpl;
-import org.opendaylight.restconf.rest.impl.schema.context.SchemaContextHandlerImpl;
 import org.opendaylight.restconf.rest.impl.services.Draft11ServicesWrapperImpl;
-import org.osgi.framework.FrameworkUtil;
 
-public class RestconfApplication extends Application implements RestconfApplicationService {
-
-    private final SchemaContextHandler schemaContextHandler;
-    private final DOMMountPointServiceHandler domMountPointServiceHandler;
-
-    public RestconfApplication() {
-        this.schemaContextHandler = new SchemaContextHandlerImpl();
-        this.domMountPointServiceHandler = new DOMMountPointServiceHandlerImpl();
-        FrameworkUtil.getBundle(getClass()).getBundleContext().registerService(RestconfApplicationService.class.getName(),
-                this, null);
-    }
+public class RestconfApplication extends Application {
 
     @Override
     public Set<Class<?>> getClasses() {
@@ -45,18 +30,7 @@ public class RestconfApplication extends Application implements RestconfApplicat
     @Override
     public Set<Object> getSingletons() {
         final Set<Object> singletons = new HashSet<>();
-        singletons.add(this.schemaContextHandler);
-        singletons.add(new Draft11ServicesWrapperImpl(this.schemaContextHandler, this.domMountPointServiceHandler));
+        singletons.add(Draft11ServicesWrapperImpl.getInstance());
         return singletons;
     }
-
-    @Override
-    public SchemaContextHandler getSchemaContextHandler() {
-        return this.schemaContextHandler;
-    }
-
-    @Override
-    public DOMMountPointServiceHandler getDOMMountPointServiceHandler() {
-        return this.domMountPointServiceHandler;
-    }
 }