public ConstructorBindingImpl( Key<T> key, Object source, Scoping scoping, InjectionPoint constructorInjectionPoint, Set<InjectionPoint> injectionPoints) { super(source, key, scoping); this.factory = new Factory<>(false, key); ConstructionProxy<T> constructionProxy = new DefaultConstructionProxyFactory<T>(constructorInjectionPoint).create(); this.constructorInjectionPoint = constructorInjectionPoint; factory.constructorInjector = new ConstructorInjector<T>(injectionPoints, constructionProxy, null, null); }
@Override @SuppressWarnings("unchecked") public T get(InternalContext context, Dependency<?> dependency, boolean linked) throws InternalProvisionException { ConstructorInjector<T> localInjector = constructorInjector; if (localInjector == null) { throw new IllegalStateException("Constructor not ready"); } if (!linked && failIfNotLinked) { throw InternalProvisionException.jitDisabled(key); } // This may not actually be safe because it could return a super type of T (if that's all the // client needs), but it should be OK in practice thanks to the wonders of erasure. return (T) localInjector.construct(context, dependency, provisionCallback); } }
/** Returns an injection point that can be used to clean up the constructor store. */ InjectionPoint getInternalConstructor() { if (factory.constructorInjector != null) { return factory.constructorInjector.getConstructionProxy().getInjectionPoint(); } else { return constructorInjectionPoint; } }
@Override public Set<InjectionPoint> getInjectableMembers() { checkState(factory.constructorInjector != null, "Binding is not ready"); return factory.constructorInjector.getInjectableMembers(); }
return provision(context, constructionContext); } else { return provisionCallback.provision(
public Set<InjectionPoint> getInjectableMembers() { checkState(factory.constructorInjector != null, "Binding is not ready"); return factory.constructorInjector.getInjectableMembers(); }
return provision(context, constructionContext); } else { return provisionCallback.provision(
@Override public Map<Method, List<org.aopalliance.intercept.MethodInterceptor>> getMethodInterceptors() { checkState(factory.constructorInjector != null, "Binding is not ready"); return factory.constructorInjector.getConstructionProxy().getMethodInterceptors(); } /*end[AOP]*/
return new ConstructorInjector<T>( membersInjector.getInjectionPoints(), factory.create(),
@Override public Set<InjectionPoint> getInjectableMembers() { checkState(factory.constructorInjector != null, "Binding is not ready"); return factory.constructorInjector.getInjectableMembers(); }
@Override @SuppressWarnings("unchecked") public T get(InternalContext context, Dependency<?> dependency, boolean linked) throws InternalProvisionException { ConstructorInjector<T> localInjector = constructorInjector; if (localInjector == null) { throw new IllegalStateException("Constructor not ready"); } if (!linked && failIfNotLinked) { throw InternalProvisionException.jitDisabled(key); } // This may not actually be safe because it could return a super type of T (if that's all the // client needs), but it should be OK in practice thanks to the wonders of erasure. return (T) localInjector.construct(context, dependency, provisionCallback); } }
return provision(context, constructionContext); } else { return provisionCallback.provision(
@Override public InjectionPoint getConstructor() { checkState(factory.constructorInjector != null, "Binding is not ready"); return factory.constructorInjector.getConstructionProxy().getInjectionPoint(); }
public ConstructorBindingImpl(Key<T> key, Object source, Scoping scoping, InjectionPoint constructorInjectionPoint, Set<InjectionPoint> injectionPoints) { super(source, key, scoping); this.factory = new Factory<T>(false, key); ConstructionProxy<T> constructionProxy = new DefaultConstructionProxyFactory<T>(constructorInjectionPoint).create(); this.constructorInjectionPoint = constructorInjectionPoint; factory.constructorInjector = new ConstructorInjector<T>( injectionPoints, constructionProxy, null, null); }
@Override public Set<InjectionPoint> getInjectableMembers() { checkState(factory.constructorInjector != null, "Binding is not ready"); return factory.constructorInjector.getInjectableMembers(); }
@Override @SuppressWarnings("unchecked") public T get(InternalContext context, Dependency<?> dependency, boolean linked) throws InternalProvisionException { ConstructorInjector<T> localInjector = constructorInjector; if (localInjector == null) { throw new IllegalStateException("Constructor not ready"); } if (!linked && failIfNotLinked) { throw InternalProvisionException.jitDisabled(key); } // This may not actually be safe because it could return a super type of T (if that's all the // client needs), but it should be OK in practice thanks to the wonders of erasure. return (T) localInjector.construct(context, dependency, provisionCallback); } }
return provision(errors, context, constructionContext); } else { return provisionCallback.provision(errors, context, new ProvisionCallback<T>() {
@Override public Map<Method, List<org.aopalliance.intercept.MethodInterceptor>> getMethodInterceptors() { checkState(factory.constructorInjector != null, "Binding is not ready"); return factory.constructorInjector.getConstructionProxy().getMethodInterceptors(); } /*end[AOP]*/
public ConstructorBindingImpl(Key<T> key, Object source, Scoping scoping, InjectionPoint constructorInjectionPoint, Set<InjectionPoint> injectionPoints) { super(source, key, scoping); this.factory = new Factory<T>(false, key); ConstructionProxy<T> constructionProxy = new DefaultConstructionProxyFactory<T>(constructorInjectionPoint).create(); this.constructorInjectionPoint = constructorInjectionPoint; factory.constructorInjector = new ConstructorInjector<T>( injectionPoints, constructionProxy, null, null); }
public Set<InjectionPoint> getInjectableMembers() { checkState(factory.constructorInjector != null, "Binding is not ready"); return factory.constructorInjector.getInjectableMembers(); }