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.test.internal;
12 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
13 import org.opendaylight.controller.clustering.services.IClusterServices;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16 import org.apache.felix.dm.Component;
18 public class Activator extends ComponentActivatorAbstractBase {
19 protected static final Logger logger = LoggerFactory
20 .getLogger(Activator.class);
23 * Function called when the activator starts just after some
24 * initializations are done by the
25 * ComponentActivatorAbstractBase.
32 * Function called when the activator stops just before the
33 * cleanup done by ComponentActivatorAbstractBase
36 public void destroy() {
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[] getGlobalImplementations() {
49 Object[] res = { SimpleClient.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
63 public void configureGlobalInstance(Component c, Object imp) {
64 if (imp.equals(SimpleClient.class)) {
65 // export the service for Apps and Plugins
66 c.setInterface(new String[] { org.eclipse.osgi.framework.console.CommandProvider.class.getName() },
68 c.add(createServiceDependency().setService(IClusterServices.class)
69 .setCallbacks("setIClusterServices", "unsetIClusterServices")