Bug 2578 - Added Binding Adapters for new Notification Broker
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / sal / dom / broker / osgi / ProxyFactory.java
index c2d6add17a07c8ffefa711618034b690d35040ae..c0eb5d55da5825ab8efb1350c2c6e1b5cd68a0af 100644 (file)
@@ -8,17 +8,17 @@
 package org.opendaylight.controller.sal.dom.broker.osgi;
 
 import java.util.Arrays;
-
+import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
 import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.osgi.framework.ServiceReference;
+import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry;
 import org.opendaylight.controller.sal.core.api.data.DataBrokerService;
 import org.opendaylight.controller.sal.core.api.data.DataProviderService;
-import org.opendaylight.controller.sal.core.api.notify.NotificationPublishService;
-import org.opendaylight.controller.sal.core.api.notify.NotificationService;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.controller.sal.core.api.mount.MountProvisionService;
-import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.controller.sal.core.api.notify.NotificationPublishService;
+import org.opendaylight.controller.sal.core.api.notify.NotificationService;
+import org.osgi.framework.ServiceReference;
 
 @SuppressWarnings("unchecked")
 public class ProxyFactory {
@@ -31,6 +31,7 @@ public class ProxyFactory {
         return ((T) _createProxyImpl);
     }
 
+    @Deprecated
     private static Object _createProxyImpl(final ServiceReference<?> ref,
             final DataBrokerService service) {
 
@@ -38,6 +39,7 @@ public class ProxyFactory {
                 ((ServiceReference<DataBrokerService>) ref), service);
     }
 
+    @Deprecated
     private static Object _createProxyImpl(final ServiceReference<?> ref,
             final DataProviderService service) {
 
@@ -59,6 +61,7 @@ public class ProxyFactory {
                 ((ServiceReference<NotificationService>) ref), service);
     }
 
+    @Deprecated
     private static Object _createProxyImpl(final ServiceReference<?> ref,
             final MountProvisionService service) {
 
@@ -66,6 +69,13 @@ public class ProxyFactory {
                 ((ServiceReference<MountProvisionService>) ref), service);
     }
 
+    private static Object _createProxyImpl(final ServiceReference<?> ref,
+            final DOMMountPointService service) {
+
+        return new DOMMountPointServiceProxy(
+                ((ServiceReference<DOMMountPointService>) ref), service);
+    }
+
     private static Object _createProxyImpl(final ServiceReference<?> ref,
             final SchemaService service) {
 
@@ -90,8 +100,7 @@ public class ProxyFactory {
     private static Object _createProxyImpl(final ServiceReference<?> reference,
             final BrokerService service) {
 
-        throw new IllegalArgumentException("Not supported class: "
-                + service.getClass().getName());
+       return service;
     }
 
     private static Object createProxyImpl(final ServiceReference<?> ref,
@@ -113,6 +122,8 @@ public class ProxyFactory {
             return _createProxyImpl(ref, (SchemaService) service);
         } else if (service instanceof NotificationService) {
             return _createProxyImpl(ref, (NotificationService) service);
+        } else if (service instanceof DOMMountPointService) {
+            return _createProxyImpl(ref, (DOMMountPointService) service);
         } else if (service != null) {
             return _createProxyImpl(ref, service);
         } else {