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.ICacheUpdateAware;
15 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
16 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
17 import org.opendaylight.controller.clustering.services.IClusterServices;
18 import org.opendaylight.controller.clustering.services.ICoordinatorChangeAware;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
21 import org.apache.felix.dm.Component;
23 public class Activator extends ComponentActivatorAbstractBase {
24 protected static final Logger logger = LoggerFactory
25 .getLogger(Activator.class);
28 * Function called when the activator starts just after some
29 * initializations are done by the
30 * ComponentActivatorAbstractBase.
37 * Function called when the activator stops just before the
38 * cleanup done by ComponentActivatorAbstractBase
41 public void destroy() {
45 * Function that is used to communicate to dependency manager the
46 * list of known implementations for services inside a container
49 * @return An array containing all the CLASS objects that will be
50 * instantiated in order to get an fully working implementation
53 public Object[] getGlobalImplementations() {
54 Object[] res = { ClusterGlobalManager.class };
59 * Function that is used to communicate to dependency manager the
60 * list of known implementations for services inside a container
63 * @return An array containing all the CLASS objects that will be
64 * instantiated in order to get an fully working implementation
67 public Object[] getImplementations() {
68 Object[] res = { ClusterContainerManager.class };
73 * Function that is called when configuration of the dependencies
76 * @param c dependency manager Component object, used for
77 * configuring the dependencies exported and imported
78 * @param imp Implementation class that is being configured,
79 * needed as long as the same routine can configure multiple
81 * @param containerName The containerName being configured, this allow
82 * also optional per-container different behavior if needed, usually
83 * should not be the case though.
85 public void configureInstance(Component c, Object imp, String containerName) {
86 if (imp.equals(ClusterContainerManager.class)) {
87 c.setInterface(new String[] { IClusterContainerServices.class
93 * Function that is called when configuration of the dependencies
96 * @param c dependency manager Component object, used for
97 * configuring the dependencies exported and imported
98 * @param imp Implementation class that is being configured,
99 * needed as long as the same routine can configure multiple
102 public void configureGlobalInstance(Component c, Object imp) {
103 if (imp.equals(ClusterGlobalManager.class)) {
104 c.setInterface(new String[] { IClusterGlobalServices.class