bug 7722: open vswitch -

only create ovs stuff when ovs enabled
This commit is contained in:
Frank 2011-01-18 10:48:30 -08:00
parent 4ad402833b
commit 48fd9221ee
1 changed files with 8 additions and 5 deletions

View File

@ -110,11 +110,14 @@ public class OvsNetworkManagerImpl implements OvsNetworkManager {
throws ConfigurationException {
_name = name;
_isEnabled = Boolean.parseBoolean(_configDao.getValue(Config.OvsNetwork.key()));
_serverId = ((ManagementServer)ComponentLocator.getComponent(ManagementServer.Name)).getId();
_executorPool = Executors.newScheduledThreadPool(10, new NamedThreadFactory("OVS"));
_cleanupExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("OVS-Cleanup"));
_ovsListener = new OvsListener(this, _workDao, _tunnelDao, _vlanMappingDao, _hostDao);
_agentMgr.registerForHostEvents(_ovsListener, true, true, true);
if (_isEnabled) {
_serverId = ((ManagementServer)ComponentLocator.getComponent(ManagementServer.Name)).getId();
_executorPool = Executors.newScheduledThreadPool(10, new NamedThreadFactory("OVS"));
_cleanupExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("OVS-Cleanup"));
_ovsListener = new OvsListener(this, _workDao, _tunnelDao, _vlanMappingDao, _hostDao);
_agentMgr.registerForHostEvents(_ovsListener, true, true, true);
}
return true;
}