public static void main ( String [ ] args ) { try { Object [ ] freeArgs = parseCommandLine ( args ) ; if ( JanusConfig . getSystemPropertyAsBoolean ( JanusConfig . JANUS_LOGO_SHOW_NAME , JanusConfig . JANUS_LOGO_SHOW . booleanValue ( ) ) ) { showJanusLogo ( ) ; } if ( freeArgs . length == 0 ) { showError ( Messages . Boot_3 , null ) ; // Event if showError never returns, add the return statement for // avoiding compilation error. return ; } final String agentToLaunch = freeArgs [ 0 ] . toString ( ) ; freeArgs = Arrays . copyOfRange ( freeArgs , 1 , freeArgs . length , String [ ] . class ) ; // Load the agent class final Class < ? extends Agent > agent = loadAgentClass ( agentToLaunch ) ; assert agent != null ; startJanus ( agent , freeArgs ) ; } catch ( EarlyExitException exception ) { // Be silent return ; } catch ( Throwable e ) { showError ( MessageFormat . format ( Messages . Boot_4 , e . getLocalizedMessage ( ) ) , e ) ; // Even if showError never returns, add the return statement for // avoiding compilation error. return ; } }
Main function that is parsing the command line and launching the first agent .