diff options
author | Nils Schwabe | 2014-04-23 15:10:36 +0200 |
---|---|---|
committer | Nils Schwabe | 2014-04-23 15:10:36 +0200 |
commit | f71e8a5bcd2d7f85f58fedf3f6ea8dc8c7f89b63 (patch) | |
tree | 5a79e7f320e6ca76ade3cf8039079d182f0178ad /src/main/java/org/openslx/imagemaster/App.java | |
parent | Fix some issues with FtpCredentialsScheduler (diff) | |
download | masterserver-f71e8a5bcd2d7f85f58fedf3f6ea8dc8c7f89b63.tar.gz masterserver-f71e8a5bcd2d7f85f58fedf3f6ea8dc8c7f89b63.tar.xz masterserver-f71e8a5bcd2d7f85f58fedf3f6ea8dc8c7f89b63.zip |
Reformat all files with simon's new layout
Diffstat (limited to 'src/main/java/org/openslx/imagemaster/App.java')
-rw-r--r-- | src/main/java/org/openslx/imagemaster/App.java | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/src/main/java/org/openslx/imagemaster/App.java b/src/main/java/org/openslx/imagemaster/App.java index c0f7a34..989f39e 100644 --- a/src/main/java/org/openslx/imagemaster/App.java +++ b/src/main/java/org/openslx/imagemaster/App.java @@ -9,59 +9,62 @@ import org.openslx.imagemaster.Globals.PropInt; import org.openslx.imagemaster.server.FtpCredentialsScheduler; import org.openslx.imagemaster.thrift.server.BinaryListener; -public class App { - private static Logger log = Logger.getLogger(App.class); +public class App +{ + + private static Logger log = Logger.getLogger( App.class ); private static List<Thread> servers = new ArrayList<>(); - public static void main(String[] args) { + public static void main( String[] args ) + { // Init logging - log.info("Starting Application"); + log.info( "Starting Application" ); // Load properties try { Globals.loadProperties(); // don't need to check return, because this should be the first time where props are loaded. - if (!Globals.propertiesValid()) { - log.error("Config file contains errors."); - System.exit(1); + if ( !Globals.propertiesValid() ) { + log.error( "Config file contains errors." ); + System.exit( 1 ); } - } catch (IOException e) { - log.error("Could not load config file. Quitting."); - System.exit(1); + } catch ( IOException e ) { + log.error( "Could not load config file. Quitting." ); + System.exit( 1 ); } - log.info("Loaded config file"); + log.info( "Loaded config file" ); // Create binary listener Thread t; - t = new Thread(new BinaryListener(), "BinaryListener"); - servers.add(t); + t = new Thread( new BinaryListener(), "BinaryListener" ); + servers.add( t ); t.start(); // Create Ftp Server Globals.ftpServer.init( Globals.getPropertyInt( PropInt.FTPPORT ) ); Thread f; - f = new Thread(Globals.ftpServer, "FtpServer"); - servers.add(f); + f = new Thread( Globals.ftpServer, "FtpServer" ); + servers.add( f ); f.start(); - + // start FtpCredentialsScheduler FtpCredentialsScheduler.startScheduling(); - + // Run more servers // ... // Wait for all servers to die - for (Thread wait : servers) { + for ( Thread wait : servers ) { boolean success = false; - while (!success) { + while ( !success ) { try { wait.join(); success = true; - } catch (InterruptedException e) { + } catch ( InterruptedException e ) { // Do nothing... } } } - - log.info("All Servers shut down, exiting..."); + + log.info( "All Servers shut down, exiting..." ); } } |