Пример #1
0
  private void serverInit(Properties configProps) throws IOException {
    messaging = SimpleMessaging.getInstance();
    messaging.init(configProps);

    m_acceptor = new NettyAcceptor();
    m_acceptor.initialize(messaging, configProps);
  }
Пример #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);
  }
Пример #3
0
 public void stopServer() {
   System.out.println("Server stopping...");
   messaging.stop();
   m_acceptor.close();
   System.out.println("Server stopped");
 }
Пример #4
0
 public void stopServer() {
   log.info("MQTT Server is stopping...");
   messaging.stop();
   m_acceptor.close();
   log.info("MQTT Server has stopped.");
 }