import org.opendaylight.mdsal.binding.api.ActionService;
import org.opendaylight.mdsal.binding.api.BindingService;
import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.DataTreeService;
import org.opendaylight.mdsal.binding.api.MountPointService;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.mdsal.binding.api.NotificationService;
import org.opendaylight.mdsal.dom.api.DOMActionProviderService;
import org.opendaylight.mdsal.dom.api.DOMActionService;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeService;
import org.opendaylight.mdsal.dom.api.DOMMountPointService;
import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
import org.opendaylight.mdsal.dom.api.DOMNotificationService;
public final class DynamicBindingAdapter {
private static final Logger LOG = LoggerFactory.getLogger(DynamicBindingAdapter.class);
- private List<AbstractAdaptingTracker<?, ?, ?>> trackers = ImmutableList.of();
+ private List<AdaptingTracker<?, ?>> trackers = ImmutableList.of();
@Reference
AdapterFactory factory = null;
+ @Reference(target = "(component.factory=" + OSGiActionService.FACTORY_NAME + ")")
+ ComponentFactory actionServiceFactory = null;
+ @Reference(target = "(component.factory=" + OSGiActionProviderService.FACTORY_NAME + ")")
+ ComponentFactory actionProviderServiceFactory = null;
+ @Reference(target = "(component.factory=" + OSGiDataBroker.FACTORY_NAME + ")")
+ ComponentFactory dataBrokerFactory = null;
@Reference(target = "(component.factory=" + OSGiMountPointService.FACTORY_NAME + ")")
ComponentFactory mountPointServiceFactory = null;
+ @Reference(target = "(component.factory=" + OSGiNotificationService.FACTORY_NAME + ")")
+ ComponentFactory notificationServiceFactory = null;
+ @Reference(target = "(component.factory=" + OSGiNotificationPublishService.FACTORY_NAME + ")")
+ ComponentFactory notificationPublishServiceFactory = null;
@Reference(target = "(component.factory=" + OSGiRpcConsumerRegistry.FACTORY_NAME + ")")
ComponentFactory rpcConsumerRegistryFactory = null;
@Reference(target = "(component.factory=" + OSGiRpcProviderService.FACTORY_NAME + ")")
@Activate
void activate(final BundleContext ctx) {
trackers = ImmutableList.of(
- new AdaptingTracker<>(ctx, DOMDataBroker.class, DataBroker.class, factory::createDataBroker),
- new AdaptingTracker<>(ctx, DOMDataTreeService.class, DataTreeService.class, factory::createDataTreeService),
- new AdaptingComponentTracker<>(ctx, DOMMountPointService.class, MountPointService.class,
+ new AdaptingTracker<>(ctx, DOMDataBroker.class, DataBroker.class, factory::createDataBroker,
+ dataBrokerFactory),
+ new AdaptingTracker<>(ctx, DOMMountPointService.class, MountPointService.class,
factory::createMountPointService, mountPointServiceFactory),
new AdaptingTracker<>(ctx, DOMNotificationService.class, NotificationService.class,
- factory::createNotificationService),
+ factory::createNotificationService, notificationServiceFactory),
new AdaptingTracker<>(ctx, DOMNotificationPublishService.class, NotificationPublishService.class,
- factory::createNotificationPublishService),
- new AdaptingComponentTracker<>(ctx, DOMRpcService.class, RpcConsumerRegistry.class,
+ factory::createNotificationPublishService, notificationPublishServiceFactory),
+ new AdaptingTracker<>(ctx, DOMRpcService.class, RpcConsumerRegistry.class,
factory::createRpcConsumerRegistry, rpcConsumerRegistryFactory),
- new AdaptingComponentTracker<>(ctx, DOMRpcProviderService.class, RpcProviderService.class,
+ new AdaptingTracker<>(ctx, DOMRpcProviderService.class, RpcProviderService.class,
factory::createRpcProviderService, rpcProviderServiceFactory),
- new AdaptingTracker<>(ctx, DOMActionService.class, ActionService.class, factory::createActionService),
+ new AdaptingTracker<>(ctx, DOMActionService.class, ActionService.class, factory::createActionService,
+ actionServiceFactory),
new AdaptingTracker<>(ctx, DOMActionProviderService.class, ActionProviderService.class,
- factory::createActionProviderService));
+ factory::createActionProviderService, actionProviderServiceFactory));
LOG.debug("Starting {} DOMService trackers", trackers.size());
trackers.forEach(ServiceTracker::open);
void deactivate() {
LOG.debug("Stopping {} DOMService trackers", trackers.size());
if (!trackers.isEmpty()) {
- trackers.forEach(AbstractAdaptingTracker::close);
+ trackers.forEach(AdaptingTracker::close);
LOG.info("{} DOMService trackers stopped", trackers.size());
}
trackers = ImmutableList.of();