1 package org.opendaylight.controller.sal.dom.broker.osgi
3 import org.opendaylight.controller.sal.core.api.BrokerService
4 import org.osgi.framework.ServiceReference
5 import org.opendaylight.controller.sal.core.api.data.DataBrokerService
6 import org.opendaylight.controller.sal.core.api.data.DataProviderService
7 import org.opendaylight.controller.sal.core.api.notify.NotificationPublishService
8 import org.opendaylight.controller.sal.core.api.notify.NotificationService
9 import org.opendaylight.controller.sal.core.api.model.SchemaService
13 static def <T extends BrokerService> T createProxy(ServiceReference<T> serviceRef, T service) {
14 return createProxyImpl(serviceRef, service) as T;
17 private static def dispatch createProxyImpl(ServiceReference<?> ref, DataBrokerService service) {
18 new DataBrokerServiceProxy(ref as ServiceReference<DataBrokerService>, service);
21 private static def dispatch createProxyImpl(ServiceReference<?> ref, DataProviderService service) {
22 new DataProviderServiceProxy(ref as ServiceReference<DataProviderService>, service);
25 private static def dispatch createProxyImpl(ServiceReference<?> ref, NotificationPublishService service) {
26 new NotificationPublishServiceProxy(ref as ServiceReference<NotificationPublishService>, service);
29 private static def dispatch createProxyImpl(ServiceReference<?> ref, NotificationService service) {
30 new NotificationServiceProxy(ref as ServiceReference<NotificationService>, service);
33 private static def dispatch createProxyImpl(ServiceReference<?> ref, SchemaService service) {
34 new SchemaServiceProxy(ref as ServiceReference<SchemaService>, service);
37 private static def dispatch createProxyImpl(ServiceReference<?> reference, BrokerService service) {
38 throw new IllegalArgumentException("Not supported class");