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.internal;
11 import org.apache.felix.dm.DependencyActivatorBase;
12 import org.apache.felix.dm.DependencyManager;
13 import org.opendaylight.ovsdb.lib.OvsdbConnection;
14 import org.opendaylight.ovsdb.lib.OvsdbConnectionListener;
15 import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
16 import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
17 import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener;
18 import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService;
19 import org.opendaylight.ovsdb.plugin.impl.ConfigurationServiceImpl;
20 import org.opendaylight.ovsdb.plugin.impl.ConnectionServiceImpl;
21 import org.opendaylight.ovsdb.plugin.impl.InventoryServiceImpl;
23 import org.osgi.framework.BundleContext;
26 * OVSDB protocol plugin Activator
30 public class Activator extends DependencyActivatorBase {
33 public void init(BundleContext context, DependencyManager manager) throws Exception {
34 manager.add(createComponent()
35 .setInterface(OvsdbConfigurationService.class.getName(), null)
36 .setImplementation(ConfigurationServiceImpl.class)
37 .add(createServiceDependency()
38 .setService(OvsdbConnectionService.class)
40 .add(createServiceDependency()
41 .setService(OvsdbInventoryService.class)
44 manager.add(createComponent()
46 new String[] {OvsdbConnectionService.class.getName(),
47 OvsdbConnectionListener.class.getName()}, null)
48 .setImplementation(ConnectionServiceImpl.class)
49 .add(createServiceDependency()
50 .setService(OvsdbInventoryService.class)
52 .add(createServiceDependency()
53 .setService(OvsdbConnection.class)
57 manager.add(createComponent()
58 .setInterface(OvsdbInventoryService.class.getName(), null)
59 .setImplementation(InventoryServiceImpl.class)
60 .add(createServiceDependency()
61 .setService(OvsdbInventoryListener.class)
62 .setCallbacks("listenerAdded", "listenerRemoved"))
63 .add(createServiceDependency()
64 .setService(OvsdbConfigurationService.class)
65 .setRequired(false)));
69 public void destroy(BundleContext context, DependencyManager manager) throws Exception {