Examples of Injector


Examples of cn.edu.hfut.dmic.webcollector.generator.Injector

    /**
     * 注入
     * @throws Exception
     */
    public void inject() throws Exception {
        Injector injector = createInjector();
        injector.inject(seeds, true);
    }
View Full Code Here

Examples of com.github.jsr330.Injector

       
        JsonConfig config = new JsonConfig(new File("./src/test/resources/tck.json"));
       
        instancer = new DefaultClassInjector(config.getConfig(Thread.currentThread().getContextClassLoader()));
       
        Injector injector = new Injector(Thread.currentThread().getContextClassLoader(), scanner, analyser, instancer);
        Car car = injector.getInstance(Car.class);
        return Tck.testsFor(car, true, true);
    }
View Full Code Here

Examples of com.google.inject.Injector

    assertTrue(fetcher instanceof HttpCache);
    assertEquals(10, fetcher.getDefaultRequestOptions().getMaxRedirects());
  }

  public void testGuiceNoModule() throws Exception {
    Injector injector = Guice.createInjector();
    ConsumerManager m = injector.getInstance(ConsumerManager.class);
    HttpFetcher fetcher = m.getHttpFetcher();

    assertTrue(fetcher instanceof HttpCache);
    assertEquals(0, fetcher.getDefaultRequestOptions().getMaxRedirects());
View Full Code Here

Examples of com.google.inject.Injector

    assertTrue(fetcher instanceof HttpCache);
    assertEquals(10, fetcher.getDefaultRequestOptions().getMaxRedirects());
  }

  public void testGuiceInjectedFetcher() throws Exception {
    Injector injector = Guice.createInjector(new TestModule());
    ConsumerManager m = injector.getInstance(ConsumerManager.class);
    HttpFetcher fetcher = m.getHttpFetcher();

    assertTrue(fetcher instanceof TestFetcher);
    assertEquals(0, fetcher.getDefaultRequestOptions().getMaxRedirects());
View Full Code Here

Examples of com.google.inject.Injector

      this.providerFactory = providerFactory;
   }

   public void process(final Module... modules)
   {
      final Injector injector = Guice.createInjector(modules);
      processInjector(injector);
   }
View Full Code Here

Examples of com.google.inject.Injector

      processInjector(injector);
   }

   public void process(final Stage stage, final Module... modules)
   {
      final Injector injector = Guice.createInjector(stage, modules);
      processInjector(injector);
   }
View Full Code Here

Examples of com.google.inject.Injector

      processInjector(injector);
   }

   public void process(final Iterable<Module> modules)
   {
      final Injector injector = Guice.createInjector(modules);
      processInjector(injector);
   }
View Full Code Here

Examples of com.google.inject.Injector

      processInjector(injector);
   }

   public void process(final Stage stage, final Iterable<Module> modules)
   {
      final Injector injector = Guice.createInjector(stage, modules);
      processInjector(injector);
   }
View Full Code Here

Examples of com.google.inject.Injector

      new ComponentTest()
      {
         @Override
         protected void testComponents() throws Exception
         {
            Injector injector = (Injector) getInstance("guiceExampleInjector");

            Object juiceInstance = injector.getInstance(Juice.class);
            assert juiceInstance instanceof AppleJuice : juiceInstance;

            Object orangeInstance = injector.getInstance(Key.get(Juice.class, Orange.class));
            assert orangeInstance instanceof OrangeJuice : orangeInstance;
         }
      }.run();
   }
View Full Code Here

Examples of com.google.inject.Injector

   */
  public void openJob(final File file, final AnalysisJobBuilder ajb) {
    _userPreferences.setAnalysisJobDirectory(file.getParentFile());
    _userPreferences.addRecentJobFile(file);

    Injector injector = Guice.createInjector(new DCModule(_parentModule, ajb) {
      public String getJobFilename() {
        return file.getName();
      };
    });

    AnalysisJobBuilderWindow window = injector.getInstance(AnalysisJobBuilderWindow.class);
    window.open();

    if (_parentWindow != null && !_parentWindow.isDatastoreSet()) {
      _parentWindow.close();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.