Merge branch 'make_osgi_compliant'

This commit is contained in:
selva.andre
2014-01-28 23:33:48 +01:00
4 changed files with 147 additions and 8 deletions
+5 -2
View File
@@ -5,7 +5,10 @@
*.iml *.iml
broker/target/ broker/target/
client/target/ client/target/
/parser_commons/target/netty_parser/target/ parser_commons/target/
netty_parser/target/
netty_parser/target/ netty_parser/target/
parser_commons/target/ parser_commons/target/
/distribution/target/ distribution/target/
broker/moquette.log
broker/runner
+2
View File
@@ -1,6 +1,8 @@
Version 0.5: Version 0.5:
Fix issue 20 (no flush of message on PINGREQ) Fix issue 20 (no flush of message on PINGREQ)
Fix issue 21 (bad channel timeout handler) Fix issue 21 (bad channel timeout handler)
Created a self contained distribution package (issue 22)
Fix issue 28, OSGi-fied the broker
Version 0.4: Version 0.4:
Dropped support for MINA Dropped support for MINA
+109 -5
View File
@@ -11,7 +11,7 @@
</parent> </parent>
<artifactId>moquette-broker</artifactId> <artifactId>moquette-broker</artifactId>
<packaging>jar</packaging> <packaging>bundle</packaging>
<!--<version>${moquette-version}</version>--> <!--<version>${moquette-version}</version>-->
<name>Moquette - broker</name> <name>Moquette - broker</name>
@@ -41,20 +41,84 @@
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <artifactId>slf4j-api</artifactId>
<version>1.7.5</version> <version>1.7.5</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.fusesource.hawtdb</groupId> <groupId>org.slf4j</groupId>
<artifactId>hawtdb</artifactId> <artifactId>slf4j-log4j12</artifactId>
<version>1.6</version> <version>1.7.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>1.0.0</version>
</dependency>
<!-- Included to embedded an HawtDB dependency, we host commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.fusesource.hawtbuf</groupId> <groupId>org.fusesource.hawtbuf</groupId>
<artifactId>hawtbuf</artifactId> <artifactId>hawtbuf</artifactId>
<version>1.9</version> <version>1.9</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.fusesource.hawtdb</groupId>
<artifactId>hawtdb</artifactId>
<version>1.6</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
@@ -107,6 +171,46 @@
</includes> </includes>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.1.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>org.dna.mqtt.commons,
org.apache.commons.logging,
org.dna.mqtt.moquette.messaging.spi.impl.storage,
org.dna.mqtt.moquette.messaging.spi.impl.subscriptions,
org.dna.mqtt.moquette.proto.messages,
org.dna.mqtt.moquette.server.netty.metrics
</Export-Package>
<Private-Package>org.dna.mqtt.moquette.bundle,
${project.groupId}.*,
com.lmax.*
</Private-Package>
<Import-Package>*</Import-Package>
<Bundle-Activator>${project.groupId}.moquette.bundle.Activator</Bundle-Activator>
</instructions>
</configuration>
</plugin>
<plugin>
<!-- Pax Runner Maven plugin -->
<groupId>org.ops4j</groupId>
<artifactId>maven-pax-plugin</artifactId>
<version>1.4</version>
<configuration>
<!-- Pax Runner version -->
<runner>1.4.0</runner>
<!-- OSGi framework type (equinox, felix, knopflerfish) -->
<framework>equinox</framework>
<provision>
<!-- <param> - -log=debug</param>
<param> - -workingDirectory=target/runner</param> -->
</provision>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
@@ -0,0 +1,30 @@
package org.dna.mqtt.moquette.bundle;
import org.dna.mqtt.moquette.server.Server;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Start and stop a configured version of the MQTT broker server.
*
* @author Didier Donsez
* @todo add config admin for port (in NettyAcceptor)
*/
public class Activator implements BundleActivator {
private static final Logger LOG = LoggerFactory.getLogger(Server.class);
private Server server = null;
public void start(BundleContext bundleContext) throws Exception {
server = new Server();
server.startServer();
LOG.info("Moquette MQTT broker started, version 0.5-SNAPSHOT");
}
public void stop(BundleContext bundleContext) throws Exception {
server.stopServer();
LOG.info("Moquette MQTT broker stopped, version 0.5-SNAPSHOT");
}
}