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.northboundtest.unittestsuite.internal;
12 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
14 import org.apache.felix.dm.Component;
16 public class Activator extends ComponentActivatorAbstractBase {
20 * Function that is used to communicate to dependency manager the
21 * list of known implementations for services inside a container
24 * @return An array containing all the CLASS objects that will be
25 * instantiated in order to get an fully working implementation
28 public Object[] getImplementations() {
33 * Function that is called when configuration of the dependencies
36 * @param c dependency manager Component object, used for
37 * configuring the dependencies exported and imported
38 * @param imp Implementation class that is being configured,
39 * needed as long as the same routine can configure multiple
41 * @param containerName The containerName being configured, this allow
42 * also optional per-container different behavior if needed, usually
43 * should not be the case though.
45 public void configureInstance(Component c, Object imp, String containerName) {
49 * Method which tells how many Global implementations are
50 * supported by the bundle. This way we can tune the number of
51 * components created. This components will be created ONLY at the
52 * time of bundle startup and will be destroyed only at time of
53 * bundle destruction, this is the major difference with the
54 * implementation retrieved via getImplementations where all of
55 * them are assumed to be in a Container!
58 * @return The list of implementations the bundle will support,
61 protected Object[] getGlobalImplementations() {
62 Object[] res = { API3UnitTest.class };
67 * Configure the dependency for a given instance Global
69 * @param c Component assigned for this instance, this will be
70 * what will be used for configuration
71 * @param imp implementation to be configured
72 * @param containerName container on which the configuration happens
74 protected void configureGlobalInstance(Component c, Object imp) {
75 if (imp.equals(API3UnitTest.class)) {
76 // Nothing to initialize