Cleanup the TopoRouteService so it is not a Floodlight module anymore.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java b/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
index c57d4d8..570b847 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
@@ -37,6 +37,7 @@
 import net.onrc.onos.ofcontroller.linkdiscovery.ILinkDiscovery;
 import net.onrc.onos.ofcontroller.linkdiscovery.ILinkDiscovery.LDUpdate;
 import net.onrc.onos.ofcontroller.proxyarp.ProxyArpManager;
+import net.onrc.onos.ofcontroller.routing.TopoRouteService;
 import net.onrc.onos.ofcontroller.util.DataPath;
 import net.onrc.onos.ofcontroller.util.Dpid;
 import net.onrc.onos.ofcontroller.util.FlowEntry;
@@ -208,7 +209,6 @@
 			= new ArrayList<Class<? extends IFloodlightService>>();
 		l.add(IFloodlightProviderService.class);
 		l.add(ITopologyService.class);
-		l.add(ITopoRouteService.class);
 		l.add(IDeviceService.class);
 		l.add(IRestApiService.class);
 		return l;
@@ -225,7 +225,6 @@
 		// Register floodlight provider and REST handler.
 		floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);
 		topology = context.getServiceImpl(ITopologyService.class);
-		topoRouteService = context.getServiceImpl(ITopoRouteService.class);
 		devices = context.getServiceImpl(IDeviceService.class);
 		restApi = context.getServiceImpl(IRestApiService.class);
 		
@@ -254,6 +253,8 @@
 		linkUpdates = new ArrayList<LDUpdate>();
 		ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
 		topologyChangeDetectorTask = new SingletonTask(executor, new TopologyChangeDetector());
+
+		topoRouteService = new TopoRouteService("");
 		
 		//Read in config values
 		bgpdRestIp = context.getConfigParams(this).get("BgpdRestIp");
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
index 2e0d837..25a214a 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -35,6 +35,7 @@
 import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
 import net.onrc.onos.ofcontroller.core.INetMapTopologyService.ITopoRouteService;
 import net.onrc.onos.ofcontroller.flowmanager.web.FlowWebRoutable;
+import net.onrc.onos.ofcontroller.routing.TopoRouteService;
 import net.onrc.onos.ofcontroller.util.CallerId;
 import net.onrc.onos.ofcontroller.util.DataPath;
 import net.onrc.onos.ofcontroller.util.DataPathEndpoints;
@@ -413,6 +414,7 @@
     @Override
     public void init(String conf) {
     	op = new GraphDBOperation(conf);
+	topoRouteService = new TopoRouteService(conf);
     }
 
     public void finalize() {
@@ -449,7 +451,6 @@
 	Collection<Class<? extends IFloodlightService>> l =
 	    new ArrayList<Class<? extends IFloodlightService>>();
 	l.add(IFloodlightProviderService.class);
-	l.add(ITopoRouteService.class);
 	l.add(IRestApiService.class);
         return l;
     }
@@ -459,11 +460,11 @@
 	throws FloodlightModuleException {
 	this.context = context;
 	floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);
-	topoRouteService = context.getServiceImpl(ITopoRouteService.class);
 	restApi = context.getServiceImpl(IRestApiService.class);
 	messageDamper = new OFMessageDamper(OFMESSAGE_DAMPER_CAPACITY,
 					    EnumSet.of(OFType.FLOW_MOD),
 					    OFMESSAGE_DAMPER_TIMEOUT);
+
 	// TODO: An ugly hack!
 	String conf = "/tmp/cassandra.titan";
 	this.init(conf);
diff --git a/src/main/java/net/onrc/onos/ofcontroller/routing/TopoRouteService.java b/src/main/java/net/onrc/onos/ofcontroller/routing/TopoRouteService.java
index 5328eae..59e76ca 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/routing/TopoRouteService.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/routing/TopoRouteService.java
@@ -11,10 +11,6 @@
 import java.util.Queue;
 import java.util.Set;
 
-import net.floodlightcontroller.core.module.FloodlightModuleContext;
-import net.floodlightcontroller.core.module.FloodlightModuleException;
-import net.floodlightcontroller.core.module.IFloodlightModule;
-import net.floodlightcontroller.core.module.IFloodlightService;
 import net.onrc.onos.graph.GraphDBOperation;
 import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
 import net.onrc.onos.ofcontroller.core.INetMapTopologyService.ITopoRouteService;
@@ -97,7 +93,7 @@
 /**
  * A class for implementing Topology Route Service.
  */
-public class TopoRouteService implements IFloodlightModule, ITopoRouteService {
+public class TopoRouteService implements ITopoRouteService {
 
     /** The logger. */
     private static Logger log =
@@ -105,69 +101,42 @@
     
     protected GraphDBOperation op;
 
+
     /**
-     * Get the collection of module services.
-     *
-     * @return the collection of services provided by this module.
+     * Default constructor.
      */
-    @Override
-    public Collection<Class<? extends IFloodlightService>> getModuleServices() {
-        Collection<Class<? extends IFloodlightService>> l = 
-            new ArrayList<Class<? extends IFloodlightService>>();
-        l.add(ITopoRouteService.class);
-        return l;
+    public TopoRouteService() {
     }
 
     /**
-     * Get a map with the services provided by this module.
+     * Constructor for given database configuration file.
      *
-     * @return a map with the services provided by this module.
+     * @param config the database configuration file to use for
+     * the initialization.
      */
-    @Override
-    public Map<Class<? extends IFloodlightService>, IFloodlightService> 
-			       getServiceImpls() {
-        Map<Class<? extends IFloodlightService>,
-        IFloodlightService> m = 
-            new HashMap<Class<? extends IFloodlightService>,
-                IFloodlightService>();
-        m.put(ITopoRouteService.class, this);
-        return m;
-    }
-
-    /**
-     * Get the collection with the services this module depends on.
-     *
-     * @return the collection with the services this module depends on.
-     */
-    @Override
-    public Collection<Class<? extends IFloodlightService>> 
-                                                    getModuleDependencies() {
-	Collection<Class<? extends IFloodlightService>> l =
-	    new ArrayList<Class<? extends IFloodlightService>>();
-	// TODO: Add the appropriate dependencies
-	// l.add(IRestApiService.class);
-        return l;
+    public TopoRouteService(String config) {
+	this.init(config);
     }
 
     /**
      * Init the module.
      *
-     * @param context the module context to use for the initialization.
-     * @see FloodlightModuleContext.
+     * @param config the database configuration file to use for
+     * the initialization.
      */
-    @Override
-    public void init(FloodlightModuleContext context)
-	throws FloodlightModuleException {
-	// TODO: Add the appropriate initialization
-    	op = new GraphDBOperation("");
+    public void init(String config) {
+	try {
+	    op = new GraphDBOperation(config);
+	} catch (Exception e) {
+	    log.error(e.getMessage());
+	}
     }
 
     /**
-     * Startup initialization.
+     * Close the service. It will close the corresponding database connection.
      */
-    @Override
-    public void startUp(FloodlightModuleContext context) {
-	// TODO: Add the approprate setup
+    public void close() {
+	op.close();
     }
 
     /**
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/web/RouteResource.java b/src/main/java/net/onrc/onos/ofcontroller/topology/web/RouteResource.java
index 5ad892b..659609d 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/topology/web/RouteResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/web/RouteResource.java
@@ -1,6 +1,7 @@
 package net.onrc.onos.ofcontroller.topology.web;
 
 import net.onrc.onos.ofcontroller.core.INetMapTopologyService.ITopoRouteService;
+import net.onrc.onos.ofcontroller.routing.TopoRouteService;
 import net.onrc.onos.ofcontroller.util.DataPath;
 import net.onrc.onos.ofcontroller.util.Dpid;
 import net.onrc.onos.ofcontroller.util.Port;
@@ -17,9 +18,7 @@
 
     @Get("json")
     public DataPath retrieve() {
-        ITopoRouteService topoRouteService = 
-                (ITopoRouteService)getContext().getAttributes().
-                    get(ITopoRouteService.class.getCanonicalName());
+        ITopoRouteService topoRouteService = new TopoRouteService("");
 	if (topoRouteService == null) {
 	    log.debug("Topology Route Service not found");
 	    return null;