Main.java 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package at.acdp.urweb;
  2. import at.acdp.urweb.fhpp.FHMasterSim;
  3. import at.acdp.urweb.fhpp.FHPP;
  4. import at.acdp.urweb.fhpp.IFHMaster;
  5. import at.acdp.urweb.web.FestoXRServer;
  6. import com.nmote.nanohttp.NanoServer;
  7. import com.nmote.xr.HTTPServerEndpoint;
  8. import com.nmote.xr.XR;
  9. import org.slf4j.LoggerFactory;
  10. public class Main {
  11. private final static org.slf4j.Logger logger = LoggerFactory.getLogger(Main.class);
  12. public static IFHMaster fhm=new FHMasterSim();
  13. public static void main(String[] args) {
  14. Params app = null;
  15. try {
  16. app = picocli.CommandLine.populateCommand(new Params(), args);
  17. NanoServer server = new NanoServer("http://0.0.0.0:" + app.port);
  18. FestoXRServer fxrs = new FestoXRServer();
  19. HTTPServerEndpoint xrs = XR.server(fxrs, FestoXRServer.class);
  20. server.add(xrs);
  21. server.start();
  22. } catch (Exception e) {
  23. logger.error("Server exited", e);
  24. }
  25. try {
  26. fhm.start(app);
  27. } catch (Exception e) {
  28. logger.error("failed.", e);
  29. picocli.CommandLine.usage(new Params(), System.out);
  30. System.exit(1);
  31. }
  32. }
  33. }