public void start ( ) throws Exception { Injector injector = Guice . createInjector ( new ConfigModule ( conf ) , new ZKModule ( ) , new DiscoveryModules ( ) . getDistributedModules ( ) , new TransactionModules ( ) . getDistributedModules ( ) , new TransactionClientModule ( ) ) ; ZKClientService zkClientService = injector . getInstance ( ZKClientService . class ) ; zkClientService . startAndWait ( ) ; // start a tx server txService = injector . getInstance ( TransactionService . class ) ; try { LOG . info ( "Starting {}" , getClass ( ) . getSimpleName ( ) ) ; txService . startAndWait ( ) ; } catch ( Exception e ) { System . err . println ( "Failed to start service: " + e . getMessage ( ) ) ; } }
Invoked by jsvc to start the program .