コード例 #1
0
 public static void main(String[] argv) throws IOException, BindException, InjectionException {
   @SuppressWarnings("unchecked")
   JavaConfigurationBuilder cb =
       Tang.Factory.getTang()
           .newConfigurationBuilder(
               (Class<? extends ExternalConstructor<?>>[]) new Class[] {FileParser.class});
   CommandLine cl = new CommandLine(cb);
   cl.processCommandLine(
       argv, Target.class, ClassHierarchyIn.class, ConfigurationIn.class, ConfigurationOut.class);
   ValidateConfiguration bip =
       Tang.Factory.getTang().newInjector(cb.build()).getInstance(ValidateConfiguration.class);
   bip.validatePlan();
 }
コード例 #2
0
ファイル: Launch.java プロジェクト: beomyeol/reef
 /**
  * @param args command line arguments, as passed to main()
  * @return Configuration object.
  */
 private static Configuration parseCommandLine(final String[] args)
     throws IOException, BindException {
   final JavaConfigurationBuilder confBuilder = Tang.Factory.getTang().newConfigurationBuilder();
   final CommandLine cl = new CommandLine(confBuilder);
   cl.registerShortNameOfClass(Local.class);
   cl.registerShortNameOfClass(NumCycles.class);
   cl.registerShortNameOfClass(Delay.class);
   cl.registerShortNameOfClass(SuspendClientControl.Port.class);
   cl.processCommandLine(args);
   return confBuilder.build();
 }