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 {
19 * Function called when the activator starts just after some
20 * initializations are done by the
21 * ComponentActivatorAbstractBase.
28 * Function called when the activator stops just before the
29 * cleanup done by ComponentActivatorAbstractBase
32 public void destroy() {
36 * Function that is used to communicate to dependency manager the
37 * list of known implementations for services inside a container
40 * @return An array containing all the CLASS objects that will be
41 * instantiated in order to get an fully working implementation
44 public Object[] getImplementations() {
49 * Function that is called when configuration of the dependencies
52 * @param c dependency manager Component object, used for
53 * configuring the dependencies exported and imported
54 * @param imp Implementation class that is being configured,
55 * needed as long as the same routine can configure multiple
57 * @param containerName The containerName being configured, this allow
58 * also optional per-container different behavior if needed, usually
59 * should not be the case though.
61 public void configureInstance(Component c, Object imp, String containerName) {
65 * Method which tells how many Global implementations are
66 * supported by the bundle. This way we can tune the number of
67 * components created. This components will be created ONLY at the
68 * time of bundle startup and will be destroyed only at time of
69 * bundle destruction, this is the major difference with the
70 * implementation retrieved via getImplementations where all of
71 * them are assumed to be in a Container!
74 * @return The list of implementations the bundle will support,
77 protected Object[] getGlobalImplementations() {
78 Object[] res = { API3UnitTest.class };
83 * Configure the dependency for a given instance Global
85 * @param c Component assigned for this instance, this will be
86 * what will be used for configuration
87 * @param imp implementation to be configured
88 * @param containerName container on which the configuration happens
90 protected void configureGlobalInstance(Component c, Object imp) {
91 if (imp.equals(API3UnitTest.class)) {
92 // Nothing to initialize