diff --git a/.gitignore b/.gitignore
index 6f63cb31..69b3cb48 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,7 +5,10 @@
*.iml
broker/target/
client/target/
-/parser_commons/target/netty_parser/target/
+parser_commons/target/
+netty_parser/target/
netty_parser/target/
parser_commons/target/
-/distribution/target/
\ No newline at end of file
+distribution/target/
+broker/moquette.log
+broker/runner
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 9ac9441b..83f21709 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,7 +1,9 @@
Version 0.5:
Fix issue 20 (no flush of message on PINGREQ)
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:
Dropped support for MINA
Fix Issue 15 (bad re-activation of client's subscriptions after a recconection)
diff --git a/broker/pom.xml b/broker/pom.xml
index dd547ca0..836769ca 100644
--- a/broker/pom.xml
+++ b/broker/pom.xml
@@ -11,7 +11,7 @@
moquette-broker
- jar
+ bundle
Moquette - broker
@@ -41,20 +41,84 @@
org.slf4j
- slf4j-log4j12
+ slf4j-api
1.7.5
+ provided
- org.fusesource.hawtdb
- hawtdb
- 1.6
+ org.slf4j
+ slf4j-log4j12
+ 1.7.5
+ provided
+
+
+
+ org.apache.felix
+ org.osgi.core
+ 1.0.0
+
+
+
+ org.apache.felix
+ org.osgi.compendium
+ 1.0.0
+
+
+
+
+ commons-logging
+ commons-logging
+ 1.1.3
+
+
+
+ io.netty
+ netty-common
+ 4.0.8.Final
+ provided
+
+
+
+ io.netty
+ netty-buffer
+ 4.0.8.Final
+ provided
+
+
+
+ io.netty
+ netty-transport
+ 4.0.8.Final
+ provided
+
+
+
+ io.netty
+ netty-handler
+ 4.0.8.Final
+ provided
+
+
+
+ io.netty
+ netty-codec
+ 4.0.8.Final
+ provided
org.fusesource.hawtbuf
hawtbuf
1.9
+ provided
+
+
+
+ org.fusesource.hawtdb
+ hawtdb
+ 1.6
+ provided
@@ -107,6 +171,46 @@
+
+
+ org.apache.felix
+ maven-bundle-plugin
+ 2.1.0
+ true
+
+
+ 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
+
+ org.dna.mqtt.moquette.bundle,
+ ${project.groupId}.*,
+ com.lmax.*
+
+ *
+ ${project.groupId}.moquette.bundle.Activator
+
+
+
+
+
+ org.ops4j
+ maven-pax-plugin
+ 1.4
+
+
+ 1.4.0
+
+ equinox
+
+
+
+
+
diff --git a/broker/src/main/java/org/dna/mqtt/moquette/bundle/Activator.java b/broker/src/main/java/org/dna/mqtt/moquette/bundle/Activator.java
new file mode 100644
index 00000000..b44f9b2b
--- /dev/null
+++ b/broker/src/main/java/org/dna/mqtt/moquette/bundle/Activator.java
@@ -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");
+ }
+}