import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
import org.opendaylight.controller.clustering.services.ICoordinatorChangeAware;
+import org.opendaylight.controller.connectionmanager.ConnectionMgmtScheme;
import org.opendaylight.controller.connectionmanager.IConnectionManager;
import org.opendaylight.controller.sal.connection.IConnectionListener;
import org.opendaylight.controller.sal.connection.IConnectionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
+import org.opendaylight.controller.sal.inventory.IInventoryService;
import org.opendaylight.controller.sal.inventory.IListenInventoryUpdates;
public class Activator extends ComponentActivatorAbstractBase {
protected static final Logger logger = LoggerFactory
.getLogger(Activator.class);
- /**
- * Function called when the activator starts just after some
- * initializations are done by the
- * ComponentActivatorAbstractBase.
- *
- */
- public void init() {
- }
-
- /**
- * Function called when the activator stops just before the
- * cleanup done by ComponentActivatorAbstractBase
- *
- */
- public void destroy() {
- }
/**
* Method which tells how many Global implementations are
* @return The list of implementations the bundle will support,
* in Global version
*/
+ @Override
protected Object[] getGlobalImplementations() {
Object[] res = { ConnectionManager.class };
return res;
* @param imp implementation to be configured
* @param containerName container on which the configuration happens
*/
+ @Override
protected void configureGlobalInstance(Component c, Object imp) {
if (imp.equals(ConnectionManager.class)) {
Dictionary<String, Object> props = new Hashtable<String, Object>();
Set<String> propSet = new HashSet<String>();
- propSet.add("connectionmanager.nodeconnections");
+ for (ConnectionMgmtScheme scheme:ConnectionMgmtScheme.values()) {
+ propSet.add("connectionmanager."+scheme.name()+".nodeconnections");
+ }
props.put("cachenames", propSet);
props.put("scope", "Global");
c.add(createServiceDependency().setService(IConnectionService.class)
.setCallbacks("setConnectionService", "unsetConnectionService")
.setRequired(true));
+ c.add(createServiceDependency().setService(IInventoryService.class, "(scope=Global)")
+ .setCallbacks("setInventoryService", "unsetInventoryService")
+ .setRequired(true));
}
}
}