Added serializer/deserializer for JSON/XML
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / main / java / org / opendaylight / controller / sal / rest / impl / RestconfApplication.java
diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfApplication.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfApplication.java
new file mode 100644 (file)
index 0000000..6dc7484
--- /dev/null
@@ -0,0 +1,30 @@
+package org.opendaylight.controller.sal.rest.impl;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.ws.rs.core.Application;
+
+import org.opendaylight.controller.sal.restconf.impl.BrokerFacade;
+import org.opendaylight.controller.sal.restconf.impl.ControllerContext;
+import org.opendaylight.controller.sal.restconf.impl.RestconfImpl;
+
+public class RestconfApplication extends Application {
+
+    @Override
+    public Set<Object> getSingletons() {
+        Set<Object> singletons = new HashSet<>();
+        ControllerContext controllerContext = ControllerContext.getInstance();
+        BrokerFacade brokerFacade = BrokerFacade.getInstance();
+        RestconfImpl restconfImpl = RestconfImpl.getInstance();
+        restconfImpl.setBroker(brokerFacade);
+        restconfImpl.setControllerContext(controllerContext);
+        singletons.add(controllerContext);
+        singletons.add(brokerFacade);
+        singletons.add(restconfImpl);
+        singletons.add(XmlToCompositeNodeProvider.INSTANCE);
+        singletons.add(StructuredDataToXmlProvider.INSTANCE);
+        return singletons;
+    }
+
+}