package net.explorviz.landscape.server.main;

import javax.inject.Inject;
import net.explorviz.landscape.repository.LandscapeRepositoryModel;
import net.explorviz.landscape.repository.RepositoryStarter;
import net.explorviz.shared.config.annotations.Config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Entry point to the core logic of the ExplorViz landscape service with DI.
 */
public class LandscapeApplication {

  private static final Logger LOGGER = LoggerFactory.getLogger(LandscapeApplication.class);

  private final boolean useDummyMode;

  private final LandscapeRepositoryModel model;

  @Inject
  public LandscapeApplication(final LandscapeRepositoryModel model,
      @Config("repository.useDummyMode") final boolean useDummyMode) {
    this.useDummyMode = useDummyMode;
    this.model = model;
  }

  /**
   * Starts the core logic of this application.
   */
  public void startApplication() {
    // Start ExplorViz Listener
    new Thread(new Runnable() {

      @Override
      public void run() {
        new RepositoryStarter().start(LandscapeApplication.this.model);
      }
    }).start();

    LOGGER.info("\n");
    LOGGER.info("* * * * * * * * * * * * * * * * * * *\n"); // NOCS
    LOGGER.info("Server (ExplorViz Backend) sucessfully started.\n");

    if (this.useDummyMode) {
      LOGGER.info("Dummy monitoring data is generated now!\n");
    } else {
      LOGGER.info("Traces can now be processed.!\n");
    }
    LOGGER.info("* * * * * * * * * * * * * * * * * * *\n");
  }


}

@@ -200,63 +200,8 @@
 er;%0A
-import net.explorviz.shared.config.annotations.Config;%0A
 impo
@@ -217,24 +217,24 @@
 f4j.Logger;%0A
+
 import org.s
@@ -473,47 +473,8 @@
 );%0A%0A
-  private final boolean useDummyMode;%0A%0A
   pr
@@ -598,118 +598,11 @@
 odel
-,%0A      @Config(%22repository.useDummyMode%22) final boolean useDummyMode) %7B%0A    this.useDummyMode = useDummyMode;
+) %7B
 %0A   
@@ -1091,117 +1091,8 @@
 %22);%0A
-%0A    if (this.useDummyMode) %7B%0A      LOGGER.info(%22Dummy monitoring data is generated now!%5Cn%22);%0A    %7D else %7B%0A  
     
@@ -1139,22 +1139,16 @@
 .!%5Cn%22);%0A
-    %7D%0A
     LOGG

remove dummy mode in landscape application