2 * Copyright (c) 2013, 2015 Red Hat, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.ovsdb.plugin.md;
11 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
12 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
13 import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
14 import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener;
16 import org.apache.felix.dm.Component;
19 * OSGi Bundle Activator for the Neutron providers
21 public class Activator extends ComponentActivatorAbstractBase {
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.
37 public void destroy() {
41 * Function that is used to communicate to dependency manager the
42 * 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
49 public Object[] getImplementations() {
50 Object[] res = {OvsdbBindingAwareProviderImpl.class,
51 OvsdbInventoryManager.class };
56 * Function that is called when configuration of the dependencies
59 * @param c dependency manager Component object, used for
60 * configuring the dependencies exported and imported
61 * @param imp Implementation class that is being configured,
62 * needed as long as the same routine can configure multiple
64 * @param containerName The containerName being configured, this allow
65 * also optional per-container different behavior if needed, usually
66 * should not be the case though.
69 public void configureInstance(Component c, Object imp,
70 String containerName) {
72 if (imp.equals(OvsdbBindingAwareProviderImpl.class)) {
73 c.setInterface(OvsdbBindingAwareProvider.class.getName(), null);
74 c.add(createServiceDependency()
75 .setService(BindingAwareBroker.class)
79 if (imp.equals(OvsdbInventoryManager.class)) {
80 c.setInterface(OvsdbInventoryListener.class.getName(), null);
81 c.add(createServiceDependency()
82 .setService(OvsdbBindingAwareProvider.class)
84 c.add(createServiceDependency()
85 .setService(OvsdbConfigurationService.class)