Search in sources :

Example 11 with DependencyExplorerOutput

use of com.google.gwt.inject.rebind.resolution.DependencyExplorer.DependencyExplorerOutput in project google-gin by gwtplus.

the class BindingResolver method resolveBindings.

public void resolveBindings(GinjectorBindings origin) {
    TreeLogger branch = logger.branch(TreeLogger.DEBUG, PrettyPrinter.format("Resolving bindings for %s", origin));
    // Use providers so that the instances are cleaned up after this method.  This ensures that even
    // though BindingResolver may be held on to (eg, {@link GinjectorBindings}, we won't leak
    // memory used for temporary storage during resolution.
    DependencyExplorerOutput output = explorerFactory.create(branch).explore(origin);
    UnresolvedBindingValidator validator = validatorFactory.create(branch);
    InvalidKeys invalidKeys = validator.getInvalidKeys(output);
    if (validator.validate(output, invalidKeys)) {
        validator.pruneInvalidOptional(output, invalidKeys);
        installerFactory.create(branch).installBindings(output);
    }
}
Also used : TreeLogger(com.google.gwt.core.ext.TreeLogger) DependencyExplorerOutput(com.google.gwt.inject.rebind.resolution.DependencyExplorer.DependencyExplorerOutput) InvalidKeys(com.google.gwt.inject.rebind.resolution.UnresolvedBindingValidator.InvalidKeys)

Aggregations

DependencyExplorerOutput (com.google.gwt.inject.rebind.resolution.DependencyExplorer.DependencyExplorerOutput)11 Dependency (com.google.gwt.inject.rebind.binding.Dependency)10 GinjectorBindings (com.google.gwt.inject.rebind.GinjectorBindings)6 TreeLogger (com.google.gwt.core.ext.TreeLogger)1 BindingCreationException (com.google.gwt.inject.rebind.resolution.ImplicitBindingCreator.BindingCreationException)1 InvalidKeys (com.google.gwt.inject.rebind.resolution.UnresolvedBindingValidator.InvalidKeys)1