3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.datastore.internal;
12 import org.apache.felix.dm.Component;
13 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
14 import org.opendaylight.controller.datastore.ClusteredDataStore;
15 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
19 import java.util.Dictionary;
20 import java.util.Hashtable;
23 public class Activator extends ComponentActivatorAbstractBase {
24 protected static final Logger logger = LoggerFactory
25 .getLogger(Activator.class);
29 protected Object[] getGlobalImplementations(){
30 logger.debug("Calling getGlobalImplementations to return:", ClusteredDataStoreManager.class);
32 ClusteredDataStoreManager.class
38 protected void configureGlobalInstance(Component c, Object imp){
39 if (imp.equals(ClusteredDataStoreManager.class)) {
40 Dictionary<String, Set<String>> props = new Hashtable<String, Set<String>>();
42 c.setInterface(new String[] { ClusteredDataStore.class.getName() }, props);
43 logger.debug("configureGlobalInstance adding dependency:", IClusterGlobalServices.class);
45 c.add(createServiceDependency().setService(
46 IClusterGlobalServices.class).setCallbacks(
47 "setClusterGlobalServices",
48 "unsetClusterGlobalServices").setRequired(true));