private AsyncDeviceFetcher(DeviceService deviceService) { this.deviceService = deviceService; deviceService.addListener(listener); }
@Activate public void activate() { deviceService.addListener(deviceListener); log.info("Started"); }
/** * Initializes the provider with necessary supporting services. * * @param providerService flow rule provider service * @param deviceService device service * @param mastershipService mastership service * @param pollFrequency flow entry poll frequency */ void init(FlowRuleProviderService providerService, DeviceService deviceService, MastershipService mastershipService, int pollFrequency) { this.providerService = providerService; this.deviceService = deviceService; this.mastershipService = mastershipService; deviceService.addListener(deviceListener); if (poller != null && !poller.isCancelled()) { poller.cancel(false); } poller = executor.scheduleAtFixedRate(this::pollFlowEntries, pollFrequency, pollFrequency, TimeUnit.SECONDS); }
/** * Initializes the provider with the necessary device service, group provider service, * mastership service and poll frequency. * * @param deviceService device service * @param groupProviderService group provider service * @param mastershipService mastership service * @param pollFrequency group entry poll frequency */ void init(DeviceService deviceService, GroupProviderService groupProviderService, MastershipService mastershipService, int pollFrequency) { this.deviceService = deviceService; this.groupProviderService = groupProviderService; this.mastershipService = mastershipService; deviceService.addListener(deviceListener); if (poller != null && !poller.isCancelled()) { poller.cancel(false); } poller = executor.scheduleAtFixedRate(this::pollGroups, pollFrequency, pollFrequency, TimeUnit.SECONDS); }
@Activate public void activate(ComponentContext context) { appId = coreService.registerApplication("org.onosproject.snmp"); eventHandlingExecutor = Executors.newSingleThreadExecutor( groupedThreads("onos/alarms", "event-handler")); deviceService.addListener(internalDeviceListener); log.info("activated SNMP provider with appId = {} and context props {}", appId, context.getProperties()); modified(context); log.info("Started"); }
@Activate public void activate() { factories.forEach(cfgRegistry::registerConfigFactory); cfgListener = new ResourceNetworkConfigListener(adminService, cfgRegistry, mastershipService, executor); cfgRegistry.addListener(cfgListener); deviceListener = new ResourceDeviceListener(adminService, resourceService, deviceService, mastershipService, driverService, cfgRegistry, executor); deviceService.addListener(deviceListener); // TODO Attempt initial registration of existing resources? log.info("Started"); }
@Activate protected void activate() { cfgService.registerProperties(getClass()); executorService = newFixedThreadPool(numThreads, groupedThreads(GROUP_THREAD_NAME, WORKER_PATTERN, log)); flowObjectiveStore.setDelegate(delegate); deviceService.addListener(deviceListener); driverService.addListener(driverListener); log.info("Started"); }
@Activate public void activate() { eventDispatcher.addSink(EdgePortEvent.class, listenerRegistry); deviceService.addListener(deviceListener); linkService.addListener(linkListener); loadAllEdgePorts(); log.info("Started"); }
@Activate public void activate() { store.setDelegate(delegate); eventDispatcher.addSink(LinkEvent.class, listenerRegistry); deviceService.addListener(deviceListener); networkConfigService.addListener(networkConfigListener); log.info("Started"); }
@Activate public void activate(ComponentContext context) { eventExecutor = Executors.newSingleThreadExecutor(groupedThreads("onos/group", "event")); store.setDelegate(delegate); eventDispatcher.addSink(GroupEvent.class, listenerRegistry); deviceService.addListener(deviceListener); cfgService.registerProperties(getClass()); modified(context); log.info("Started"); }
@Activate protected void activate() { executorService = newFixedThreadPool(4, groupedThreads("onos/objective-installer", "%d", log)); flowObjectiveStore.setDelegate(delegate); mastershipService.addListener(mastershipListener); deviceService.addListener(deviceListener); deviceService.getDevices().forEach(device -> setupPipelineHandler(device.id())); deviceCompositionTreeMap = Maps.newConcurrentMap(); log.info("Started"); }
@Activate public void activate(ComponentContext context) { modified(context); store.setDelegate(delegate); eventDispatcher.addSink(FlowRuleEvent.class, listenerRegistry); deviceService.addListener(deviceListener); cfgService.registerProperties(getClass()); idGenerator = coreService.getIdGenerator(FLOW_OP_TOPIC); log.info("Started"); }
@Activate public void activate() { topologyService.addListener(listener); resourceService.addListener(resourceListener); deviceService.addListener(deviceListener); hostService.addListener(hostListener); partitionService.addListener(partitionListener); scheduleIntentUpdate(1); log.info("Started"); }
@Activate public void activate() { this.appId = coreService.registerApplication(APP_NAME); deviceService.addListener(deviceListener); networkConfigService.addListener(networkConfigListener); hostService.addListener(hostListener); interfaceService.addListener(interfaceListener); updateConfig(); }
@Activate protected void activate(ComponentContext context) { componentConfigService.registerProperties(getClass()); modified(context); coreAppId = coreService.registerApplication(CoreService.CORE_APP_NAME); routerAppId = coreService.registerApplication(RoutingService.ROUTER_APP_ID); networkConfigRegistry.registerConfigFactory(mcastConfigFactory); networkConfigService.addListener(configListener); deviceService.addListener(deviceListener); interfaceService.addListener(internalInterfaceList); updateConfig(); log.info("Started"); }
@Activate public synchronized void activate(ComponentContext context) { cfgService.registerProperties(DefaultTopologyProvider.class); executor = newFixedThreadPool(MAX_THREADS, groupedThreads("onos/topo", "build-%d", log)); accumulator = new TopologyChangeAccumulator(); logConfig("Configured"); modified(context); providerService = providerRegistry.register(this); deviceService.addListener(deviceListener); linkService.addListener(linkListener); isStarted = true; triggerRecompute(); log.info("Started"); }
@Activate public void activate() { ctrl.start(agent); crHandler = BasicPceccHandler.getInstance(); crHandler.initialize(labelRsrcService, deviceService, pceStore, this); srTeHandler = PceccSrTeBeHandler.getInstance(); srTeHandler.initialize(labelRsrcAdminService, labelRsrcService, this, pceStore, deviceService); deviceService.addListener(deviceListener); linkService.addListener(linkListener); netCfgService.addListener(cfgListener); // Reserve global node pool if (!srTeHandler.reserveGlobalPool(GLOBAL_LABEL_SPACE_MIN, GLOBAL_LABEL_SPACE_MAX)) { log.debug("Global node pool was already reserved."); } log.info("Started"); }
/** * Enables link discovery processing. */ private void enable() { providerService = providerRegistry.register(this); masterService.addListener(roleListener); deviceService.addListener(deviceListener); packetService.addProcessor(packetProcessor, PacketProcessor.advisor(0)); loadDevices(); executor = newSingleThreadScheduledExecutor(groupedThreads("onos/link", "discovery-%d", log)); executor.scheduleAtFixedRate(new SyncDeviceInfoTask(), DEVICE_SYNC_DELAY, DEVICE_SYNC_DELAY, SECONDS); executor.scheduleAtFixedRate(new LinkPrunerTask(), LINK_PRUNER_DELAY, LINK_PRUNER_DELAY, SECONDS); requestIntercepts(); }
@Activate public void activate() { eventDispatcher.addSink(PiPipeconfWatchdogEvent.class, listenerRegistry); localStatusMap = Maps.newConcurrentMap(); // Init distributed status map. KryoNamespace.Builder serializer = KryoNamespace.newBuilder() .register(KryoNamespaces.API) .register(PipelineStatus.class); statusMap = storageService.<DeviceId, PipelineStatus>eventuallyConsistentMapBuilder() .withName("onos-pipeconf-status-table") .withSerializer(serializer) .withTimestampProvider((k, v) -> new WallClockTimestamp()).build(); statusMap.addListener(new StatusMapListener()); // Register component configurable properties. componentConfigService.registerProperties(getClass()); // Start periodic watchdog task. timer = new Timer(); startProbeTask(); // Add device listener. deviceService.addListener(deviceListener); log.info("Started"); }
@Activate protected void activate() { appId = coreService .registerApplication("org.onosproject.openstackswitching"); packetService.addProcessor(internalPacketProcessor, PacketProcessor.director(1)); deviceService.addListener(internalDeviceListener); hostService.addListener(internalHostListener); configRegistry.registerConfigFactory(configFactory); configService.addListener(configListener); arpHandler = new OpenstackArpHandler(openstackService, packetService, hostService); sgRulePopulator = new OpenstackSecurityGroupRulePopulator(appId, openstackService, flowObjectiveService); networkConfig.registerConfigFactory(configFactory); networkConfig.addListener(configListener); readConfiguration(); log.info("Started"); }