*/
package org.opendaylight.controller.configpusherfeature.internal;
+import com.google.common.collect.LinkedHashMultimap;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
-
import org.apache.karaf.features.Feature;
import org.apache.karaf.features.FeatureEvent;
import org.apache.karaf.features.FeatureEvent.EventType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.collect.LinkedHashMultimap;
-
public class ConfigPushingRunnable implements Runnable {
- private static final Logger logger = LoggerFactory.getLogger(ConfigPushingRunnable.class);
+ private static final Logger LOG = LoggerFactory.getLogger(ConfigPushingRunnable.class);
private static final int POLL_TIME = 1;
private BlockingQueue<FeatureEvent> queue;
private FeatureConfigPusher configPusher;
while(true) {
try {
if(!interuppted) {
- if(toInstall.isEmpty()) {
- event = queue.take();
- } else {
- event = queue.poll(POLL_TIME, TimeUnit.MILLISECONDS);
- }
- if(event != null && event.getFeature() !=null) {
- processFeatureEvent(event,toInstall);
- }
+ if(toInstall.isEmpty()) {
+ event = queue.take();
+ } else {
+ event = queue.poll(POLL_TIME, TimeUnit.MILLISECONDS);
+ }
+ if(event != null && event.getFeature() !=null) {
+ processFeatureEvent(event,toInstall);
+ }
} else if(toInstall.isEmpty()) {
- logger.error("ConfigPushingRunnable - exiting");
+ LOG.error("ConfigPushingRunnable - exiting");
return;
}
} catch (InterruptedException e) {
- logger.error("ConfigPushingRunnable - interupted");
+ LOG.error("ConfigPushingRunnable - interupted");
interuppted = true;
} catch (Exception e) {
- logger.error("Exception while processing features {}", e);
+ LOG.error("Exception while processing features ", e);
}
}
}
protected void logPushResult(LinkedHashMultimap<Feature,FeatureConfigSnapshotHolder> results) {
for(Feature f:results.keySet()) {
- logger.info("Pushed configs for feature {} {}",f,results.get(f));
+ LOG.info("Pushed configs for feature {} {}",f,results.get(f));
}
}
}