@Activate public void activate() { portAnnotationOp = new PortAnnotationOperator(networkConfigService); deviceAnnotationOp = new DeviceAnnotationOperator(networkConfigService); portOpsIndex.put(PortAnnotationConfig.class, portAnnotationOp); backgroundService = newSingleThreadScheduledExecutor( groupedThreads("onos/device", "manager-background", log)); localNodeId = clusterService.getLocalNode().id(); store.setDelegate(delegate); eventDispatcher.addSink(DeviceEvent.class, listenerRegistry); mastershipService.addListener(mastershipListener); networkConfigService.addListener(networkConfigListener); backgroundService.scheduleWithFixedDelay(() -> { try { mastershipCheck(); } catch (Exception e) { log.error("Exception thrown during integrity check", e); } }, 1, 1, TimeUnit.MINUTES); portReqeustExecutor = newSingleThreadExecutor(); communicationService.<InternalPortUpDownEvent>addSubscriber( PORT_UPDOWN_SUBJECT, SERIALIZER::decode, this::handlePortRequest, portReqeustExecutor); log.info("Started"); }