@Test public void modified() throws Exception { provider.modified(null); assertEquals("Incorrect polling frequency", 1, provider.alarmPollFrequencySeconds); provider.activate(null); provider.modified(context); assertEquals("Incorrect polling frequency", 1, provider.alarmPollFrequencySeconds); }
@Modified public void modified(ComponentContext context) { if (context == null) { log.info("No component configuration"); return; } Dictionary<?, ?> properties = context.getProperties(); int newPollFrequency = getNewPollFrequency(properties, alarmPollFrequencySeconds); if (newPollFrequency != alarmPollFrequencySeconds) { alarmPollFrequencySeconds = newPollFrequency; scheduledTask.cancel(true); scheduledTask = schedulePolling(); } }
PollingAlarmProvider extends AbstractProvider implements AlarmProvider { @Modified public void modified(ComponentContext context) { if (context == null) { log.info("No component configuration"); return; } Dictionary<?, ?> properties = context.getProperties(); int newPollFrequency = getNewPollFrequency(properties, alarmPollFrequencySeconds); if (newPollFrequency != alarmPollFrequencySeconds) { alarmPollFrequencySeconds = newPollFrequency; scheduledTask.cancel(true); scheduledTask = schedulePolling(); } } }
PollingAlarmProvider extends AbstractProvider implements AlarmProvider { @Modified public void modified(ComponentContext context) { if (context == null) { log.info("No component configuration"); return; } Dictionary<?, ?> properties = context.getProperties(); int newPollFrequency = getNewPollFrequency(properties, alarmPollFrequencySeconds); if (newPollFrequency != alarmPollFrequencySeconds) { alarmPollFrequencySeconds = newPollFrequency; scheduledTask.cancel(true); scheduledTask = schedulePolling(); } } PollingAlarmProvider(); }
PollingAlarmProvider extends AbstractProvider implements AlarmProvider { @Modified public void modified(ComponentContext context) { if (context == null) { log.info("No component configuration"); return; } Dictionary<?, ?> properties = context.getProperties(); int newPollFrequency = getNewPollFrequency(properties, alarmPollFrequencySeconds); if (newPollFrequency != alarmPollFrequencySeconds) { alarmPollFrequencySeconds = newPollFrequency; scheduledTask.cancel(true); scheduledTask = schedulePolling(); } } PollingAlarmProvider(); @Activate void activate(ComponentContext context); @Deactivate void deactivate(); @Modified void modified(ComponentContext context); @Override void triggerProbe(DeviceId deviceId); }
PollingAlarmProvider extends AbstractProvider implements AlarmProvider { @Modified public void modified(ComponentContext context) { if (context == null) { log.info("No component configuration"); return; } Dictionary<?, ?> properties = context.getProperties(); int newPollFrequency = getNewPollFrequency(properties, alarmPollFrequencySeconds); if (newPollFrequency != alarmPollFrequencySeconds) { alarmPollFrequencySeconds = newPollFrequency; scheduledTask.cancel(true); scheduledTask = schedulePolling(); } } PollingAlarmProvider(); @Activate void activate(ComponentContext context); @Deactivate void deactivate(); @Modified void modified(ComponentContext context); @Override void triggerProbe(DeviceId deviceId);  }