protected InterceptorImpl( BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { super(attributes, type, new StringBeanIdentifier(forInterceptor(type)), beanManager); this.interceptorMetadata = initInterceptorMetadata(); this.serializable = type.isSerializable(); this.interceptorBindingTypes = Interceptors.mergeBeanInterceptorBindings( beanManager, getEnhancedAnnotated(), getStereotypes()) .uniqueValues(); }
/* * Utility methods for field InjectionPoints */ public List<Set<FieldInjectionPoint<?, ?>>> getFieldInjectionPoints( Bean<?> declaringBean, EnhancedAnnotatedType<?> type, BeanManagerImpl manager) { List<Set<FieldInjectionPoint<?, ?>>> injectableFieldsList = new ArrayList<Set<FieldInjectionPoint<?, ?>>>(); if (type.slim() instanceof UnbackedAnnotatedType<?>) { // external AnnotatedTypes require special treatment Collection<EnhancedAnnotatedField<?, ?>> allFields = type.getEnhancedFields(Inject.class); for (Class<?> clazz = type.getJavaClass(); clazz != null && clazz != Object.class; clazz = clazz.getSuperclass()) { ImmutableSet.Builder<FieldInjectionPoint<?, ?>> fields = ImmutableSet.builder(); for (EnhancedAnnotatedField<?, ?> field : allFields) { if (!field.isStatic() && field.getJavaMember().getDeclaringClass().equals(clazz)) { addFieldInjectionPoint(field, fields, declaringBean, type.getJavaClass(), manager); } } injectableFieldsList.add(0, fields.build()); } } else { for (EnhancedAnnotatedType<?> t = type; t != null && !t.getJavaClass().equals(Object.class); t = t.getEnhancedSuperclass()) { ImmutableSet.Builder<FieldInjectionPoint<?, ?>> fields = ImmutableSet.builder(); for (EnhancedAnnotatedField<?, ?> annotatedField : t.getDeclaredEnhancedFields(Inject.class)) { if (!annotatedField.isStatic()) { addFieldInjectionPoint( annotatedField, fields, declaringBean, t.getJavaClass(), manager); } } injectableFieldsList.add(0, fields.build()); } } return ImmutableList.copyOf(injectableFieldsList); }
public SessionBeanProxyInstantiator(EnhancedAnnotatedType<T> type, SessionBean<T> bean) { this.bean = bean; this.proxyClass = new EnterpriseProxyFactory<T>(type.getJavaClass(), bean).getProxyClass(); }
public static String forNewManagedBean(EnhancedAnnotatedType<?> type) { return getPrefix(NewManagedBean.class) .append(type.slim().getIdentifier().asString()) .toString(); }
public static String forInterceptor(EnhancedAnnotatedType<?> type) { return getPrefix(InterceptorImpl.class) .append(type.slim().getIdentifier().asString()) .toString(); }
public static String forManagedBean(EnhancedAnnotatedType<?> type) { return forManagedBean(type.slim().getIdentifier()); }
public static String forExtension(EnhancedAnnotatedType<?> type) { return getPrefix(Extension.class).append(type.slim().getIdentifier().asString()).toString(); }
public <T> ConstructorInjectionPoint<T> createConstructorInjectionPoint( Bean<T> declaringBean, EnhancedAnnotatedType<T> type, BeanManagerImpl manager) { EnhancedAnnotatedConstructor<T> constructor = Beans.getBeanConstructorStrict(type); return createConstructorInjectionPoint( declaringBean, type.getJavaClass(), constructor, manager); }