Beispiel #1
0
  private void serverInit(Properties configProps) throws IOException {
    messaging = SimpleMessaging.getInstance();
    messaging.init(configProps);

    m_acceptor = new NettyAcceptor();
    m_acceptor.initialize(messaging, configProps);
  }
Beispiel #2
0
  public void startServer() throws IOException {
    ConfigurationParser confParser = new ConfigurationParser();
    try {
      String configPath = System.getProperty("moquette.path", null);
      confParser.parse(new File(configPath, "config/moquette.conf"));
    } catch (ParseException pex) {
      Log.warn("An error occured in parsing configuration, fallback on default configuration", pex);
    }
    Properties configProps = confParser.getProperties();

    messaging = SimpleMessaging.getInstance();
    messaging.init(configProps);

    m_acceptor = new NettyAcceptor();
    m_acceptor.initialize(messaging, configProps);
  }
Beispiel #3
0
 public void stopServer() {
   System.out.println("Server stopping...");
   messaging.stop();
   m_acceptor.close();
   System.out.println("Server stopped");
 }
Beispiel #4
0
 public void stopServer() {
   log.info("MQTT Server is stopping...");
   messaging.stop();
   m_acceptor.close();
   log.info("MQTT Server has stopped.");
 }