<version>0.1-SNAPSHOT</version>\r
</parent>\r
<artifactId>openflow-protocol-api</artifactId>\r
+ <packaging>bundle</packaging>\r
<name>Openflow Protocol Library - API</name>\r
\r
<properties>\r
<version>0.1-SNAPSHOT</version>
</parent>
<artifactId>openflow-protocol-impl</artifactId>
- <packaging>jar</packaging>
+ <packaging>bundle</packaging>
+ <name>Openflow Protocol Library - IMPL</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>
+ org.opendaylight.openflowjava.protocol.impl.connection.Activator
+ </Bundle-Activator>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
<dependencies>
<dependency>
</dependency>
<dependency>
<groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
+ <artifactId>netty-handler</artifactId>
<version>4.0.8.Final</version>
</dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>5.0.0</version>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
- <version>1.7.5</version>
+ <version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
--- /dev/null
+/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
+package org.opendaylight.openflowjava.protocol.impl.connection;
+
+import java.util.Hashtable;
+
+import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Activate library bundle, expose provided implementations:
+ * <ul>
+ * <li>{@link SwitchConnectionProviderImpl}</li>
+ * </ul>
+ *
+ * @author mirehak
+ */
+public class Activator implements BundleActivator {
+
+ private static final Logger LOG = LoggerFactory.getLogger(Activator.class);
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ LOG.debug("starting OF Library");
+ Hashtable<String, String> props = new Hashtable<String, String>();
+ props.put("type", "default");
+ context.registerService(
+ SwitchConnectionProvider.class.getName(),
+ new SwitchConnectionProviderImpl(), props);
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ LOG.debug("stopping OF Library");
+ //TODO:: add teardown activities (check, if servers are running, stop if necessary..)
+ }
+}
<version>0.1-SNAPSHOT</version>
</parent>
<artifactId>openflow-protocol-spi</artifactId>
- <name>Openflow Protocol Library SPI</name>
-
+ <packaging>bundle</packaging>
+
+ <name>Openflow Protocol Library - SPI</name>
+
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<sonar.branch>${user.name}-private-view</sonar.branch>
<sonar.skippedModules>org.openflow.openflowj,net.sf.jung2</sonar.skippedModules>
<logback.version>1.0.9</logback.version>
- <slf4j.version>1.7.2</slf4j.version>
+ <slf4j.version>1.7.5</slf4j.version>
<yang.prototype.version>1.0-SNAPSHOT</yang.prototype.version>
+ <maven.bundle.version>2.4.0</maven.bundle.version>
</properties>
<pluginRepositories>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <version>1.7.2</version>
+ <version>${slf4j.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>${maven.bundle.version}</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
+ </instructions>
+ <manifestLocation>${project.build.directory}/META-INF</manifestLocation>
+ </configuration>
+ </plugin>
</plugins>
<pluginManagement>
<plugins>