* necessarily be done within the ProxyResolver resolve operation since this provider operation
* relies on a bean which is not yet available.
*/
ctx.recordCycle(inj.getEnclosingType(), injectableInstance.getEnclosingType());
final ProxyInjector proxyInject = getOrCreateProxy(ctx, inj.getEnclosingType(),
ctx.getInjector(inj.getEnclosingType()).getQualifyingMetadata());
boolean pushedProxy = false;
try {
if (injectableInstance.getTaskType() == TaskType.Parameter
&& injectableInstance.getConstructor() != null) {
// eek! a producer element is produced by this bean and injected into it's own constructor!
final ProxyInjector producedElementProxy
= getOrCreateProxy(ctx, inj.getInjectedType(), qualifyingMetadata);
proxyInject.addProxyCloseStatement(Stmt.loadVariable("context")
.invoke("addBean", Stmt.load(inj.getInjectedType()),
qualifyingMetadata.getQualifiers(), inj.getBeanInstance(injectableInstance)));
proxyInject.getBeanInstance(injectableInstance);
return producedElementProxy.getBeanInstance(injectableInstance);
}
else {
ctx.getProcessingContext().pushBlockBuilder(proxyInject.getProxyResolverBlockBuilder());
pushedProxy = true;
ctx.markOpenProxy();