2 * Copyright (c) 2013 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.connection;
11 import java.util.Hashtable;
13 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
14 import org.osgi.framework.BundleActivator;
15 import org.osgi.framework.BundleContext;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
21 * Activates library bundle, exposes provided implementations:
23 * <li>{@link SwitchConnectionProviderImpl}</li>
28 public class Activator implements BundleActivator {
30 private static final Logger LOG = LoggerFactory.getLogger(Activator.class);
33 public void start(BundleContext context) throws Exception {
34 LOG.debug("starting OF Library");
35 Hashtable<String, String> props = new Hashtable<>();
36 props.put("type", "default");
37 context.registerService(
38 SwitchConnectionProvider.class.getName(),
39 new SwitchConnectionProviderImpl(), props);
40 LOG.debug("started OF Library");
44 public void stop(BundleContext context) throws Exception {
45 LOG.debug("stopping OF Library");
46 //TODO:: add teardown activities (check, if servers are running, stop if necessary..)