Package com.google.inject.spi

Examples of com.google.inject.spi.Dependency


      if (isEagerSingleton(injector, binding, stage)) {
        try {
          injector.callInContext(new ContextualCallable<Void>() {
            Dependency<?> dependency = Dependency.get(binding.getKey());
            public Void call(InternalContext context) {
              Dependency previous = context.setDependency(dependency);
              Errors errorsForBinding = errors.withSource(dependency);
              try {
                binding.getInternalFactory().get(errorsForBinding, context, dependency);
              } catch (ErrorsException e) {
                errorsForBinding.merge(e.getErrors());
View Full Code Here


    this.dependency = dependency;
    this.factory = factory;
  }

  private T inject(Errors errors, InternalContext context) throws ErrorsException {
    Dependency previous = context.setDependency(dependency);
    try {
      return factory.get(errors.withSource(dependency), context, dependency);
    } finally {
      context.setDependency(previous);
    }
View Full Code Here

  }

  public void inject(Errors errors, InternalContext context, Object o) {
    errors = errors.withSource(dependency);

    Dependency previous = context.setDependency(dependency);
    try {
      Object value = factory.get(errors, context, dependency);
      field.set(o, value);
    } catch (ErrorsException e) {
      errors.withSource(injectionPoint).merge(e.getErrors());
View Full Code Here

  public T get() {
    final Errors errors = new Errors();
    try {
      T t = injector.callInContext(new ContextualCallable<T>() {
        public T call(InternalContext context) throws ErrorsException {
          Dependency dependency = context.getDependency();
          return internalFactory.get(errors, context, dependency);
        }
      });
      errors.throwIfNewErrors(0);
      return t;
View Full Code Here

  public Dependency getDependency() {
    return dependency;
  }

  public Dependency setDependency(Dependency dependency) {
    Dependency previous = dependency;
    this.dependency = dependency;
    return previous;
  }
View Full Code Here

      public T get() {
        final Errors errors = new Errors(dependency);
        try {
          T t = callInContext(new ContextualCallable<T>() {
            public T call(InternalContext context) throws ErrorsException {
              Dependency previous = context.setDependency(dependency);
              try {
                return factory.get(errors, context, dependency);
              } finally {
                context.setDependency(previous);
              }
View Full Code Here

      public T get() {
        final Errors errors = new Errors(dependency);
        try {
          T t = callInContext(new ContextualCallable<T>() {
            public T call(InternalContext context) throws ErrorsException {
              Dependency previous = context.setDependency(dependency);
              try {
                return factory.get(errors, context, dependency, false);
              } finally {
                context.setDependency(previous);
              }
View Full Code Here

      if (isEagerSingleton(injector, binding, stage)) {
        try {
          injector.callInContext(new ContextualCallable<Void>() {
            Dependency<?> dependency = Dependency.get(binding.getKey());
            public Void call(InternalContext context) {
              Dependency previous = context.setDependency(dependency);
              Errors errorsForBinding = errors.withSource(dependency);
              try {
                binding.getInternalFactory().get(errorsForBinding, context, dependency, false);
              } catch (ErrorsException e) {
                errorsForBinding.merge(e.getErrors());
View Full Code Here

      Object localObject = this.injector.callInContext(new ContextualCallable()
      {
        public Object call(InternalContext paramAnonymousInternalContext)
          throws ErrorsException
        {
          Dependency localDependency = paramAnonymousInternalContext.getDependency();
          return ProviderToInternalFactoryAdapter.this.internalFactory.get(localErrors, paramAnonymousInternalContext, localDependency, true);
        }
      });
      localErrors.throwIfNewErrors(0);
      return localObject;
View Full Code Here

    return this.dependency;
  }

  public Dependency setDependency(Dependency paramDependency)
  {
    Dependency localDependency = this.dependency;
    this.dependency = paramDependency;
    return localDependency;
  }
View Full Code Here

TOP

Related Classes of com.google.inject.spi.Dependency

Copyright © 2018 www.massapicom. 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.