2 * Copyright (c) 2014, 2015 Cisco Systems, 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.lispflowmapping.neutron;
12 import java.util.Dictionary;
13 import java.util.Hashtable;
15 import org.apache.felix.dm.DependencyActivatorBase;
16 import org.apache.felix.dm.DependencyManager;
17 import org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMapping;
18 import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkAware;
19 import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetAware;
20 import org.opendaylight.controller.networkconfig.neutron.INeutronPortAware;
21 import org.osgi.framework.BundleContext;
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
26 * Main application activator class for registering the dependencies and
27 * Initializing the Mapping Service application.
31 public class Activator extends DependencyActivatorBase {
33 protected static final Logger logger = LoggerFactory.getLogger(Activator.class);
36 public void init(BundleContext context, DependencyManager manager) throws Exception {
37 Dictionary<String, String> props = new Hashtable<String, String>();
38 props.put("name", "mappingservice");
40 manager.add(createComponent()
41 .setInterface(ILispNeutronService.class.getName(), null)
42 .setImplementation(LispNeutronService.class)
43 .add(createServiceDependency().setService(IFlowMapping.class)));
45 manager.add(createComponent()
46 .setInterface(new String[] { ILispNeutronService.class.getName(), INeutronNetworkAware.class.getName()}, props)
47 .setImplementation(LispNeutronNetworkHandler.class));
49 manager.add(createComponent()
50 .setInterface(new String[] { ILispNeutronService.class.getName(), INeutronSubnetAware.class.getName()}, props)
51 .setImplementation(LispNeutronSubnetHandler.class)
52 .add(createServiceDependency().setService(ILispNeutronService.class)));
54 manager.add(createComponent()
55 .setInterface(new String[] { ILispNeutronService.class.getName(), INeutronPortAware.class.getName()}, props)
56 .setImplementation(LispNeutronPortHandler.class));
58 logger.debug("LISP Neutron Service is initialized!");
63 public void destroy(BundleContext context, DependencyManager manager) throws Exception {
64 logger.debug("LISP Neutron Service is destroyed!");