- final ServiceTracker<NetconfNotificationCollector, NetconfNotificationCollector> notificationServiceTracker =
- new ServiceTracker<>(context, NetconfNotificationCollector.class, new ServiceTrackerCustomizer<NetconfNotificationCollector, NetconfNotificationCollector>() {
- @Override
- public NetconfNotificationCollector addingService(ServiceReference<NetconfNotificationCollector> reference) {
- Preconditions.checkState(listenerReg == null, "Notification collector service was already added");
- listenerReg = context.getService(reference).registerBaseNotificationPublisher();
- monitoringService.setNotificationPublisher(listenerReg);
- return null;
- }
-
- @Override
- public void modifiedService(ServiceReference<NetconfNotificationCollector> reference, NetconfNotificationCollector service) {
-
- }
-
- @Override
- public void removedService(ServiceReference<NetconfNotificationCollector> reference, NetconfNotificationCollector service) {
- listenerReg.close();
- listenerReg = null;
- monitoringService.setNotificationPublisher(listenerReg);
- }
- });
+ final ServiceTracker<NetconfNotificationCollector, NetconfNotificationCollector>
+ notificationServiceTracker = new ServiceTracker<>(context, NetconfNotificationCollector.class,
+ new ServiceTrackerCustomizer<NetconfNotificationCollector, NetconfNotificationCollector>() {
+ @Override
+ public NetconfNotificationCollector addingService(ServiceReference<
+ NetconfNotificationCollector> reference) {
+ Preconditions.checkState(listenerReg == null,
+ "Notification collector service was already added");
+ listenerReg = context.getService(reference).registerBaseNotificationPublisher();
+ monitoringService.setNotificationPublisher(listenerReg);
+ return null;
+ }
+
+ @Override
+ public void modifiedService(ServiceReference<NetconfNotificationCollector> reference,
+ NetconfNotificationCollector service) {
+
+ }
+
+ @Override
+ public void removedService(ServiceReference<NetconfNotificationCollector> reference,
+ NetconfNotificationCollector service) {
+ listenerReg.close();
+ listenerReg = null;
+ monitoringService.setNotificationPublisher(listenerReg);
+ }
+ });