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.clustering.stub.internal;
12 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
14 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
15 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
18 import org.apache.felix.dm.Component;
20 public class Activator extends ComponentActivatorAbstractBase {
21 protected static final Logger logger = LoggerFactory
22 .getLogger(Activator.class);
26 * Function that is used to communicate to dependency manager the
27 * list of known implementations for services inside a container
30 * @return An array containing all the CLASS objects that will be
31 * instantiated in order to get an fully working implementation
34 public Object[] getGlobalImplementations() {
35 Object[] res = { ClusterGlobalManager.class };
40 * Function that is used to communicate to dependency manager the
41 * list of known implementations for services inside a container
44 * @return An array containing all the CLASS objects that will be
45 * instantiated in order to get an fully working implementation
48 public Object[] getImplementations() {
49 Object[] res = { ClusterContainerManager.class };
54 * Function that is called when configuration of the dependencies
57 * @param c dependency manager Component object, used for
58 * configuring the dependencies exported and imported
59 * @param imp Implementation class that is being configured,
60 * needed as long as the same routine can configure multiple
62 * @param containerName The containerName being configured, this allow
63 * also optional per-container different behavior if needed, usually
64 * should not be the case though.
66 public void configureInstance(Component c, Object imp, String containerName) {
67 if (imp.equals(ClusterContainerManager.class)) {
68 c.setInterface(new String[] { IClusterContainerServices.class
74 * Function that is called when configuration of the dependencies
77 * @param c dependency manager Component object, used for
78 * configuring the dependencies exported and imported
79 * @param imp Implementation class that is being configured,
80 * needed as long as the same routine can configure multiple
83 public void configureGlobalInstance(Component c, Object imp) {
84 if (imp.equals(ClusterGlobalManager.class)) {
85 c.setInterface(new String[] { IClusterGlobalServices.class