singleton should set conf only once
diff --git a/src/main/java/net/floodlightcontroller/onoslistener/OnosPublisher.java b/src/main/java/net/floodlightcontroller/onoslistener/OnosPublisher.java
index 964eff1..846ebd9 100644
--- a/src/main/java/net/floodlightcontroller/onoslistener/OnosPublisher.java
+++ b/src/main/java/net/floodlightcontroller/onoslistener/OnosPublisher.java
@@ -34,6 +34,8 @@
import net.onrc.onos.registry.controller.IControllerRegistryService;
import net.onrc.onos.registry.controller.IControllerRegistryService.ControlChangeCallback;
import net.onrc.onos.registry.controller.RegistryException;
+import net.onrc.onos.util.GraphDBConnection;
+import net.onrc.onos.util.LocalTopologyEventListener;
public class OnosPublisher implements IDeviceListener, IOFSwitchListener,
ILinkDiscoveryListener, IFloodlightModule {
@@ -43,6 +45,7 @@
protected static Logger log;
protected IDeviceService deviceService;
protected IControllerRegistryService registryService;
+ protected GraphDBConnection conn;
protected static final String DBConfigFile = "dbconf";
protected static final String CleanupEnabled = "EnableCleanup";
@@ -198,6 +201,7 @@
// TODO Auto-generated method stub
Map<String, String> configMap = context.getConfigParams(this);
String conf = configMap.get(DBConfigFile);
+ conn = GraphDBConnection.getInstance(conf);
log = LoggerFactory.getLogger(OnosPublisher.class);
deviceService = context.getServiceImpl(IDeviceService.class);
@@ -221,6 +225,9 @@
String cleanupNeeded = configMap.get(CleanupEnabled);
deviceService.addListener(this);
+
+ log.debug("Adding EventListener");
+ conn.addEventListener(new LocalTopologyEventListener(conn));
// Setup the Cleanup task.
if (cleanupNeeded == null || !cleanupNeeded.equals("False")) {
ScheduledExecutorService ses = threadPool.getScheduledExecutor();