@Override
  public int startSystem() {
    logger.info("Setting Broker Configuration");
    brokerManager.setBrokerConfiguration("xbean:activemq.xml");

    logger.info("Starting Broker");
    brokerManager.startBroker();

    try {
      int waitSec = 1;
      logger.info("Waiting {} secs...", waitSec);
      Thread.sleep(waitSec * 1000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }

    logger.info("Starting Sensor Network Manager");
    dataAgent.startSensorNetworkDataAgentThreads();
    historicalDataManager.startPersistenceWorkerThread();
    working = true;
    return 0;
  }
  @Override
  public int stopSystem() {
    logger.info("Stopping Sensor Network Manager");
    dataAgent.stopSensorNetworkDataAgentThreads();
    historicalDataManager.stopPersistenceWorkerThread();
    try {

      int waitSec = 1;
      logger.info("Waiting {} secs...", waitSec);
      Thread.sleep(waitSec * 1000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    logger.info("Stopping Broker");
    brokerManager.stopBroker();
    working = false;
    return 0;
  }