com.google.inject.internal
Class InternalInjectorCreator

java.lang.Object
  extended by com.google.inject.internal.InternalInjectorCreator

public final class InternalInjectorCreator
extends Object

Builds a tree of injectors. This is a primary injector, plus child injectors needed for each Binder.newPrivateBinder() private environment. The primary injector is not necessarily a top-level injector.

Injector construction happens in two phases.

  1. Static building. In this phase, we interpret commands, create bindings, and inspect dependencies. During this phase, we hold a lock to ensure consistency with parent injectors. No user code is executed in this phase.
  2. Dynamic injection. In this phase, we call user code. We inject members that requested injection. This may require user's objects be created and their providers be called. And we create eager singletons. In this phase, user code may have started other threads. This phase is not executed for injectors created using the tool stage

Author:
[email protected] (Bob Lee), [email protected] (Jesse Wilson)

Constructor Summary
InternalInjectorCreator()
           
 
Method Summary
 InternalInjectorCreator addModules(Iterable<? extends Module> modules)
           
 Injector build()
           
 InternalInjectorCreator parentInjector(com.google.inject.internal.InjectorImpl parent)
          Sets the parent of the injector to-be-constructed.
 InternalInjectorCreator stage(Stage stage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalInjectorCreator

public InternalInjectorCreator()
Method Detail

stage

public InternalInjectorCreator stage(Stage stage)

parentInjector

public InternalInjectorCreator parentInjector(com.google.inject.internal.InjectorImpl parent)
Sets the parent of the injector to-be-constructed. As a side effect, this sets this injector's stage to the stage of parent and sets #requireExplicitBindings() if the parent injector also required them.


addModules

public InternalInjectorCreator addModules(Iterable<? extends Module> modules)

build

public Injector build()


Copyright © 2006-2013 Google, Inc.. All Rights Reserved.