public void execute ( String [ ] args , boolean debugEnabled , boolean quiet ) { try { this . debugEnabled = debugEnabled ; debug ( "CheckReplicationTool#execute(String[]): args = " + Arrays . asList ( args ) ) ; parseCommandLineArguments ( args ) ; System . out . println ( "Connecting..." ) ; debug ( "CheckReplicationTool#execute(String[]): Creating CheckReplicationTool.ProcessorTask with parameters: clustersProperties = " + clustersProperties + ", timeout = " + timeout + ", regionName = " + regionName ) ; ProcessorTask task = new ProcessorTask ( clustersProperties , timeout , regionName , debugEnabled , quiet ) ; debug ( "CheckReplicationTool#execute(String[]): Starting CheckReplicationTool.ProcessorTask" ) ; Utils . execute ( task , timeout + DELTA_TIMEOUT ) ; int exitCode = task . getExitCode ( ) ; debug ( "CheckReplicationTool#execute(String[]): CheckReplicationTool.ProcessorTask finished with exitCode = " + exitCode ) ; if ( exitCode == 0 ) { Utils . exitWithSuccess ( ) ; } Utils . exitWithFailure ( ) ; } catch ( Throwable t ) { debug ( "CheckReplicationTool#execute(String[]): Throwable caught with message = " + t . getMessage ( ) , t ) ; Utils . exitWithFailure ( "Unexpected throwable" , t ) ; } }
Runs the tool . All the tools run in this way .