001package apps;
002
003/**
004 * Application for running JMRI server functions without a graphical interface.
005 * Goal is to run on very light hardware, such as a Raspberry Pi, without
006 * requiring the overhead associated with display functions. Needs an existing
007 * JMRI profile ID passed to program, e.g. 
008 *   <pre><code>JmriFaceless --profile=RPi.3d3f1dfc</code></pre>
009 * NOTE: JMRI "server" functions based on ui components
010 * (such as JmriJFrames) may need to be modified to check isHeadless() and
011 * adjust their behavior as needed.
012 * <br>
013 * <hr>
014 * This file is part of JMRI.
015 * <p>
016 * JMRI is free software; you can redistribute it and/or modify it under the
017 * terms of version 2 of the GNU General Public License as published by the Free
018 * Software Foundation. See the "COPYING" file for a copy of this license.
019 * <p>
020 * JMRI is distributed in the hope that it will be useful, but WITHOUT ANY
021 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
022 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
023 *
024 * @author Steve Todd Copyright 2012
025 */
026public class JmriFaceless extends apps.AppsBase {
027
028    //private static final Logger log = LoggerFactory.getLogger(JmriFaceless.class);
029    public JmriFaceless(String[] args) {
030        super("JmriFaceless", "JmriFacelessConfig3.xml", args);
031    }
032
033    @Override
034    public void start() {
035        // Once the configServlet is usable, require the web server
036        // WebServerManager.getWebServer().start();
037        super.start();
038    }
039
040    // Main entry point
041    public static void main(String args[]) {
042        System.setProperty("java.awt.headless", "true");
043        JmriFaceless app = new JmriFaceless(args);
044        app.start();
045    }
046
047}