/** * Gets the receiver of the product. The two creational contexts need to be separated because the receiver only serves the product * creation (it is not a dependent instance of the created instance). * * @param productCreationalContext the creational context of the produced instance * @param receiverCreationalContext the creational context of the receiver * @return The receiver */ protected Object getReceiver(CreationalContext<?> productCreationalContext, CreationalContext<?> receiverCreationalContext) { // This is a bit dangerous, as it means that producer methods can end up // executing on partially constructed instances. Also, it's not required // by the spec... if (getAnnotated().isStatic()) { return null; } else { if (productCreationalContext instanceof WeldCreationalContext<?>) { WeldCreationalContext<?> creationalContextImpl = (WeldCreationalContext<?>) productCreationalContext; final Object incompleteInstance = creationalContextImpl.getIncompleteInstance(getDeclaringBean()); if (incompleteInstance != null) { BeanLogger.LOG.circularCall(getAnnotated(), getDeclaringBean()); return incompleteInstance; } } return getBeanManager().getReference(getDeclaringBean(), null, receiverCreationalContext, true); } }
/** * Gets the receiver of the product. The two creational contexts need to be separated because the receiver only serves the product * creation (it is not a dependent instance of the created instance). * * @param productCreationalContext the creational context of the produced instance * @param receiverCreationalContext the creational context of the receiver * @return The receiver */ protected Object getReceiver(CreationalContext<?> productCreationalContext, CreationalContext<?> receiverCreationalContext) { // This is a bit dangerous, as it means that producer methods can end up // executing on partially constructed instances. Also, it's not required // by the spec... if (getAnnotated().isStatic()) { return null; } else { if (productCreationalContext instanceof WeldCreationalContext<?>) { WeldCreationalContext<?> creationalContextImpl = (WeldCreationalContext<?>) productCreationalContext; final Object incompleteInstance = creationalContextImpl.getIncompleteInstance(getDeclaringBean()); if (incompleteInstance != null) { BeanLogger.LOG.circularCall(getAnnotated(), getDeclaringBean()); return incompleteInstance; } } return getBeanManager().getReference(getDeclaringBean(), null, receiverCreationalContext, true); } }
/** * Gets the receiver of the product. The two creational contexts need to be separated because the receiver only serves the product * creation (it is not a dependent instance of the created instance). * * @param productCreationalContext the creational context of the produced instance * @param receiverCreationalContext the creational context of the receiver * @return The receiver */ protected Object getReceiver(CreationalContext<?> productCreationalContext, CreationalContext<?> receiverCreationalContext) { // This is a bit dangerous, as it means that producer methods can end up // executing on partially constructed instances. Also, it's not required // by the spec... if (getAnnotated().isStatic()) { return null; } else { if (productCreationalContext instanceof WeldCreationalContext<?>) { WeldCreationalContext<?> creationalContextImpl = (WeldCreationalContext<?>) productCreationalContext; final Object incompleteInstance = creationalContextImpl.getIncompleteInstance(getDeclaringBean()); if (incompleteInstance != null) { BeanLogger.LOG.circularCall(getAnnotated(), getDeclaringBean()); return incompleteInstance; } } return getBeanManager().getReference(getDeclaringBean(), null, receiverCreationalContext, true); } }
/** * Gets the receiver of the product. The two creational contexts need to be separated because the receiver only serves the product * creation (it is not a dependent instance of the created instance). * * @param productCreationalContext the creational context of the produced instance * @param receiverCreationalContext the creational context of the receiver * @return The receiver */ protected Object getReceiver(CreationalContext<?> productCreationalContext, CreationalContext<?> receiverCreationalContext) { // This is a bit dangerous, as it means that producer methods can end up // executing on partially constructed instances. Also, it's not required // by the spec... if (getAnnotated().isStatic()) { return null; } else { if (productCreationalContext instanceof WeldCreationalContext<?>) { WeldCreationalContext<?> creationalContextImpl = (WeldCreationalContext<?>) productCreationalContext; final Object incompleteInstance = creationalContextImpl.getIncompleteInstance(getDeclaringBean()); if (incompleteInstance != null) { BeanLogger.LOG.circularCall(getAnnotated(), getDeclaringBean()); return incompleteInstance; } } return getBeanManager().getReference(getDeclaringBean(), null, receiverCreationalContext, true); } }
/** * Gets the receiver of the product. The two creational contexts need to be separated because the receiver only serves the product * creation (it is not a dependent instance of the created instance). * * @param productCreationalContext the creational context of the produced instance * @param receiverCreationalContext the creational context of the receiver * @return The receiver */ protected Object getReceiver(CreationalContext<?> productCreationalContext, CreationalContext<?> receiverCreationalContext) { // This is a bit dangerous, as it means that producer methods can end up // executing on partially constructed instances. Also, it's not required // by the spec... if (getAnnotated().isStatic()) { return null; } else { if (productCreationalContext instanceof WeldCreationalContext<?>) { WeldCreationalContext<?> creationalContextImpl = (WeldCreationalContext<?>) productCreationalContext; final Object incompleteInstance = creationalContextImpl.getIncompleteInstance(getDeclaringBean()); if (incompleteInstance != null) { BeanLogger.LOG.circularCall(getAnnotated(), getDeclaringBean()); return incompleteInstance; } } return getBeanManager().getReference(getDeclaringBean(), null, receiverCreationalContext, true); } }
/** * Gets the receiver of the product. The two creational contexts need to be separated because the receiver only serves the product * creation (it is not a dependent instance of the created instance). * * @param productCreationalContext the creational context of the produced instance * @param receiverCreationalContext the creational context of the receiver * @return The receiver */ protected Object getReceiver(CreationalContext<?> productCreationalContext, CreationalContext<?> receiverCreationalContext) { // This is a bit dangerous, as it means that producer methods can end up // executing on partially constructed instances. Also, it's not required // by the spec... if (getAnnotated().isStatic()) { return null; } else { if (productCreationalContext instanceof WeldCreationalContext<?>) { WeldCreationalContext<?> creationalContextImpl = (WeldCreationalContext<?>) productCreationalContext; final Object incompleteInstance = creationalContextImpl.getIncompleteInstance(getDeclaringBean()); if (incompleteInstance != null) { BeanLogger.LOG.circularCall(getAnnotated(), getDeclaringBean()); return incompleteInstance; } } return getBeanManager().getReference(getDeclaringBean(), null, receiverCreationalContext, true); } }