protected void checkDeclaringBean() { if (getDeclaringBean() == null && !getAnnotated().isStatic()) { throw BeanLogger.LOG.declaringBeanMissing(getAnnotated()); } }
protected void checkDeclaringBean() { if (getDeclaringBean() == null && !getAnnotated().isStatic()) { throw BeanLogger.LOG.declaringBeanMissing(getAnnotated()); } }
protected void checkDeclaringBean() { if (getDeclaringBean() == null && !getAnnotated().isStatic()) { throw BeanLogger.LOG.declaringBeanMissing(getAnnotated()); } }
protected void checkDeclaringBean() { if (getDeclaringBean() == null && !getAnnotated().isStatic()) { throw BeanLogger.LOG.declaringBeanMissing(getAnnotated()); } }
protected void checkDeclaringBean() { if (getDeclaringBean() == null && !getAnnotated().isStatic()) { throw BeanLogger.LOG.declaringBeanMissing(getAnnotated()); } }
protected void checkDeclaringBean() { if (getDeclaringBean() == null && !getAnnotated().isStatic()) { throw BeanLogger.LOG.declaringBeanMissing(getAnnotated()); } }
@Override public String toString() { StringBuilder result = new StringBuilder("Producer for "); if (getDeclaringBean() == null) { result.append(getAnnotated()); } else { if (getBean() == null) { result.append(getAnnotated()); } else { result.append(getBean()); } result.append(" declared on ").append(getDeclaringBean()); } return result.toString(); } }
@Override public String toString() { StringBuilder result = new StringBuilder("Producer for "); if (getDeclaringBean() == null) { result.append(getAnnotated()); } else { if (getBean() == null) { result.append(getAnnotated()); } else { result.append(getBean()); } result.append(" declared on ").append(getDeclaringBean()); } return result.toString(); } }
@Override public String toString() { StringBuilder result = new StringBuilder("Producer for "); if (getDeclaringBean() == null) { result.append(getAnnotated()); } else { if (getBean() == null) { result.append(getAnnotated()); } else { result.append(getBean()); } result.append(" declared on ").append(getDeclaringBean()); } return result.toString(); } }
@Override public String toString() { StringBuilder result = new StringBuilder("Producer for "); if (getDeclaringBean() == null) { result.append(getAnnotated()); } else { if (getBean() == null) { result.append(getAnnotated()); } else { result.append(getBean()); } result.append(" declared on ").append(getDeclaringBean()); } return result.toString(); } }
@Override public String toString() { StringBuilder result = new StringBuilder("Producer for "); if (getDeclaringBean() == null) { result.append(getAnnotated()); } else { if (getBean() == null) { result.append(getAnnotated()); } else { result.append(getBean()); } result.append(" declared on ").append(getDeclaringBean()); } return result.toString(); } }
@Override public String toString() { StringBuilder result = new StringBuilder("Producer for "); if (getDeclaringBean() == null) { result.append(getAnnotated()); } else { if (getBean() == null) { result.append(getAnnotated()); } else { result.append(getBean()); } result.append(" declared on ").append(getDeclaringBean()); } return result.toString(); } }
/** * 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); } }