public static void main ( final String [ ] args ) { LOG . log ( Level . INFO , "Entering Launch at :::" + new Date ( ) ) ; try { if ( args == null || args . length == 0 ) { throw new IllegalArgumentException ( "No arguments provided, at least a clrFolder should be supplied." ) ; } final File dotNetFolder = new File ( args [ 0 ] ) . getAbsoluteFile ( ) ; final String [ ] removedArgs = Arrays . copyOfRange ( args , 1 , args . length ) ; final Configuration config = getClientConfiguration ( removedArgs ) ; final Injector commandLineInjector = Tang . Factory . getTang ( ) . newInjector ( parseCommandLine ( removedArgs ) ) ; final int waitTime = commandLineInjector . getNamedInstance ( WaitTimeForDriver . class ) ; final int driverMemory = commandLineInjector . getNamedInstance ( DriverMemoryInMb . class ) ; final boolean isLocal = commandLineInjector . getNamedInstance ( Local . class ) ; final String driverIdentifier = commandLineInjector . getNamedInstance ( DriverIdentifier . class ) ; final String jobSubmissionDirectory = commandLineInjector . getNamedInstance ( DriverJobSubmissionDirectory . class ) ; final boolean submit = commandLineInjector . getNamedInstance ( Submit . class ) ; final Injector injector = Tang . Factory . getTang ( ) . newInjector ( config ) ; final JobClient client = injector . getInstance ( JobClient . class ) ; client . setDriverInfo ( driverIdentifier , driverMemory , jobSubmissionDirectory ) ; if ( submit ) { client . submit ( dotNetFolder , true , isLocal , null ) ; client . waitForCompletion ( waitTime ) ; } else { client . submit ( dotNetFolder , false , isLocal , config ) ; client . waitForCompletion ( 0 ) ; } LOG . info ( "Done!" ) ; } catch ( final BindException | InjectionException | IOException ex ) { LOG . log ( Level . SEVERE , "Job configuration error" , ex ) ; } }
Main method that starts the CLR Bridge from Java .