Javadoc update
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / connection / Activator.java
1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
2 package org.opendaylight.openflowjava.protocol.impl.connection;
3
4 import java.util.Hashtable;
5
6 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
7 import org.osgi.framework.BundleActivator;
8 import org.osgi.framework.BundleContext;
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
11
12
13 /**
14  * Activates library bundle, exposes provided implementations:
15  * <ul>
16  *  <li>{@link SwitchConnectionProviderImpl}</li>
17  * </ul>
18  * 
19  * @author mirehak
20  */
21 public class Activator implements BundleActivator {
22     
23     private static final Logger LOG = LoggerFactory.getLogger(Activator.class);
24
25     @Override
26     public void start(BundleContext context) throws Exception {
27         LOG.debug("starting OF Library");
28         Hashtable<String, String> props = new Hashtable<>();
29         props.put("type", "default");
30         context.registerService(
31                 SwitchConnectionProvider.class.getName(), 
32                 new SwitchConnectionProviderImpl(), props);
33     }
34
35     @Override
36     public void stop(BundleContext context) throws Exception {
37         LOG.debug("stopping OF Library");
38         //TODO:: add teardown activities (check, if servers are running, stop if necessary..)
39     }
40 }