diff --git a/src/main/java/net/floodlightcontroller/core/module/FloodlightModuleLoader.java b/src/main/java/net/floodlightcontroller/core/module/FloodlightModuleLoader.java index e693de9db83863285eda70fa92da1a07a87230dc..9781c398f85404b8055887d34f63953239b54cc8 100644 --- a/src/main/java/net/floodlightcontroller/core/module/FloodlightModuleLoader.java +++ b/src/main/java/net/floodlightcontroller/core/module/FloodlightModuleLoader.java @@ -150,10 +150,6 @@ public class FloodlightModuleLoader { Map<Class<? extends IFloodlightService>, IFloodlightModule> moduleMap = new HashMap<Class<? extends IFloodlightService>, IFloodlightModule>(); - - //for (String s : mList) { - // calculateModuleDeps(moduleMap, moduleSet, s); - //} HashSet<String> configMods = new HashSet<String>(); configMods.addAll(Arrays.asList(mList)); diff --git a/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java b/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java index 70111ba70ea3e3b9337cf76bf93a27afaa0ba108..8754a9b6d829cdd5bb39d7d1e4e3281e4f508148 100755 --- a/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java +++ b/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java @@ -703,17 +703,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe } } - public DeviceManagerImpl() { - // TODO - Alex - move this - this.devMgrMaps = new DevMgrMaps(); - this.lock = new ReentrantReadWriteLock(); - this.updates = new LinkedList<Update>(); - this.evHistDevMgrAttachPt = - new EventHistory<EventHistoryAttachmentPoint>("Attachment-Point"); - this.evHistDevMgrPktIn = - new EventHistory<OFMatch>("Pakcet-In"); - } - public void shutDown() { shuttingDown = true; floodlightProvider.removeOFMessageListener(OFType.PACKET_IN, this); @@ -2119,24 +2108,25 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe // We create this here because there is no ordering guarantee this.deviceManagerAware = new HashSet<IDeviceManagerAware>(); - } - - @Override - public void startUp(FloodlightModuleContext context) { - // This is our 'constructor' - - // Create our data structures + this.updates = new LinkedList<Update>(); this.devMgrMaps = new DevMgrMaps(); this.lock = new ReentrantReadWriteLock(); - this.updates = new LinkedList<Update>(); + this.evHistDevMgrAttachPt = new EventHistory<EventHistoryAttachmentPoint>("Attachment-Point"); this.evHistDevMgrPktIn = new EventHistory<OFMatch>("Pakcet-In"); - + } + + @Override + public void startUp(FloodlightModuleContext context) { + // This is our 'constructor' + if (topology != null) { // Register to get updates from topology topology.addListener(this); + } else { + log.error("Could add not toplogy listener"); } // Create our database tables diff --git a/src/main/java/net/floodlightcontroller/restserver/RestApiServer.java b/src/main/java/net/floodlightcontroller/restserver/RestApiServer.java index 0886fdfc0acc1365c61fc8c3748503d75243c9ed..95a3b8dee730dbc6c21fbc1c733a3111deae3bad 100644 --- a/src/main/java/net/floodlightcontroller/restserver/RestApiServer.java +++ b/src/main/java/net/floodlightcontroller/restserver/RestApiServer.java @@ -148,10 +148,11 @@ public class RestApiServer // This has to be done here since we don't know what order the // startUp methods will be called this.restlets = new ArrayList<RestletRoutable>(); + this.fmlContext = context; } @Override - public void startUp(FloodlightModuleContext fmlContext) { - this.fmlContext = fmlContext; + public void startUp(FloodlightModuleContext Context) { + // no-op } } \ No newline at end of file diff --git a/src/main/java/net/floodlightcontroller/routing/dijkstra/RoutingImpl.java b/src/main/java/net/floodlightcontroller/routing/dijkstra/RoutingImpl.java index 2ae05ac4f4eab05953f66ccad73165c170dd5088..ff1cf1d16e551374f6adbdd6099bc19f538e80c7 100644 --- a/src/main/java/net/floodlightcontroller/routing/dijkstra/RoutingImpl.java +++ b/src/main/java/net/floodlightcontroller/routing/dijkstra/RoutingImpl.java @@ -369,20 +369,16 @@ public class RoutingImpl public void init(FloodlightModuleContext context) throws FloodlightModuleException { topology = context.getServiceImpl(ITopologyService.class); - } - - @Override - public void startUp(FloodlightModuleContext context) { - // Our 'constructor' lock = new ReentrantReadWriteLock(); network = new HashMap<Long, HashMap<Link, Link>>(); nexthoplinkmaps = new HashMap<Long, HashMap<Long, Link>>(); nexthopnodemaps = new HashMap<Long, HashMap<Long, Long>>(); pathcache = new LRUHashMap<RouteId, Route>(PATH_CACHE_SIZE); - + } + + @Override + public void startUp(FloodlightModuleContext context) { // Register to get updates from topology topology.addListener(this); - - log.info("Initialized Dijkstra RouterImpl"); } } diff --git a/src/main/java/net/floodlightcontroller/topology/internal/TopologyImpl.java b/src/main/java/net/floodlightcontroller/topology/internal/TopologyImpl.java index 1e6decfdfa000fda740f8a078fabd2cd457d3243..9f7fb1a539b4a97d4c3006c83d148f4803d6a5dc 100644 --- a/src/main/java/net/floodlightcontroller/topology/internal/TopologyImpl.java +++ b/src/main/java/net/floodlightcontroller/topology/internal/TopologyImpl.java @@ -1761,13 +1761,6 @@ public class TopologyImpl // We create this here because there is no ordering guarantee this.topologyAware = new ArrayList<ITopologyListener>(); - } - - @Override - public void startUp(FloodlightModuleContext context) { - // Our 'constructor' - - // Setup our data structures this.lock = new ReentrantReadWriteLock(); this.updates = new LinkedBlockingQueue<Update>(); this.links = new HashMap<LinkTuple, LinkInfo>(); @@ -1780,7 +1773,10 @@ public class TopologyImpl new EventHistory<EventHistoryTopologyLink>("Topology: Link"); this.evHistTopologyCluster = new EventHistory<EventHistoryTopologyCluster>("Topology: Cluster"); - + } + + @Override + public void startUp(FloodlightModuleContext context) { // Create our storage tables storageSource.createTable(LINK_TABLE_NAME, null); storageSource.setTablePrimaryKeyName(LINK_TABLE_NAME, LINK_ID); @@ -1793,7 +1789,6 @@ public class TopologyImpl log.error("Error in installing listener for switch table - {}", SWITCH_TABLE_NAME); } - ScheduledExecutorService ses = floodlightProvider.getScheduledExecutor(); // Setup sending out LLDPs