public static void main ( String [ ] args ) { // determine if a valid log4j config exists and initialize a default logger if not if ( System . getProperty ( "log4j.configuration" ) == null ) { Logger root = Logger . getRootLogger ( ) ; root . removeAllAppenders ( ) ; PatternLayout layout = new PatternLayout ( "%d{HH:mm:ss,SSS} %-5p %-60c %x - %m%n" ) ; ConsoleAppender appender = new ConsoleAppender ( layout , "System.err" ) ; root . addAppender ( appender ) ; root . setLevel ( Level . INFO ) ; } JobManager jobManager ; try { jobManager = initialize ( args ) ; // Start info server for jobmanager jobManager . startInfoServer ( ) ; } catch ( Exception e ) { LOG . fatal ( e . getMessage ( ) , e ) ; System . exit ( FAILURE_RETURN_CODE ) ; } // Clean up is triggered through a shutdown hook // freeze this thread to keep the JVM alive (the job manager threads are daemon threads) Object w = new Object ( ) ; synchronized ( w ) { try { w . wait ( ) ; } catch ( InterruptedException e ) { } } }
Entry point for the program