Splitted the OSGi bundle creation from the broker jar to let the broker be executable also outside of a container

This commit is contained in:
selva.andre
2014-02-08 17:59:36 +01:00
parent a1448597af
commit 95d276f7a0
6 changed files with 256 additions and 16 deletions
@@ -1,30 +0,0 @@
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");
}
}