@Override public boolean isPassivationCapable() { if (isPassivationCapable != null) { return isPassivationCapable; } if(Serializable.class.isAssignableFrom(getReturnType())) { isPassivationCapable = Boolean.TRUE; return true; } isPassivationCapable = Boolean.FALSE; return false; }
public String getId() if (!isEnabled() || getReturnType().equals(Object.class)) sb.append(getReturnType()).append('#'); for (Annotation qualifier : getQualifiers())
String simpleName = getReturnType().getSimpleName(); builder.append(simpleName); builder.append(", WebBeansType:").append(getWebBeansType()).append(", Name:").append(getName());
public void validateBeanInjection(Bean<?> bean) { for (InjectionPoint injectionPoint : bean.getInjectionPoints()) { Type type = injectionPoint.getType(); if (type instanceof ParameterizedType) { Bean injectionPointBean = injectionPoint.getBean(); ParameterizedType pt = (ParameterizedType) type; if (pt.getRawType() == Bean.class) { Class<?> beanClass = AbstractOwbBean.class.isInstance(injectionPointBean) ? AbstractOwbBean.class.cast(injectionPointBean).getReturnType() : injectionPointBean.getBeanClass(); Type beanType = pt.getActualTypeArguments()[0]; if (!GenericsUtil.isAssignableFrom(false, AbstractProducerBean.class.isInstance(bean), beanClass, beanType)) { throw new WebBeansConfigurationException("@Inject Bean<X> can only be done in X, found " + beanType + " and " + beanClass); } } } } }
@Override public T create(final CreationalContext<T> context) { if (isAnotherApp(context) && isContainerScope()) {// in another app context, lookup the container instance to share the same one in sub apps return (T) wbc.getBeanManagerImpl().getReference( delegate, AbstractOwbBean.class.isInstance(delegate) ? AbstractOwbBean.class.cast(delegate).getReturnType() : getBeanClass(), context); } return delegate.create(context); }
+ component.getReturnType().getName() + " may not define @Named annotation");