@Activate
    public void activate(ComponentContext context) {
        cfgService.registerProperties(getClass());
        alarmsExecutor = newScheduledThreadPool(CORE_POOL_SIZE,
                                                groupedThreads("onos/pollingalarmprovider",
                                                               "alarm-executor-%d", log));
        eventHandlingExecutor =
                Executors.newFixedThreadPool(CORE_POOL_SIZE,
                                             groupedThreads("onos/pollingalarmprovider",
                                                            "device-installer-%d", log));

        providerService = providerRegistry.register(this);

        deviceService.addListener(deviceListener);
        mastershipService.addListener(mastershipListener);

        if (context == null) {
            alarmPollFrequencySeconds = POLL_FREQUENCY_SECONDS_DEFAULT;
            log.info("No component configuration");
        } else {
            Dictionary<?, ?> properties = context.getProperties();
            alarmPollFrequencySeconds = getNewPollFrequency(properties, alarmPollFrequencySeconds);
        }
        scheduledTask = schedulePolling();
        log.info("Started");
    }
@Test
    public void activate() throws Exception {
        assertFalse("Provider should be registered", providerRegistry.getProviders().contains(provider.id()));
        assertEquals("Device listener should be added", 1, deviceListeners.size());
        assertEquals("Incorrect alarm provider service", alarmProviderService, provider.providerService);
        assertEquals("Mastership listener should be added", 1, mastershipListeners.size());
        assertEquals("Incorrect polling frequency", 1, provider.alarmPollFrequencySeconds);
        assertFalse("Executor should be running", provider.alarmsExecutor.isShutdown());
        provider.activate(null);
        assertEquals("Incorrect polling frequency, should be default", 60, provider.alarmPollFrequencySeconds);
    }