public class Beans extends Object
Modifier and Type | Method and Description |
---|---|
static <T> void |
callInitializers(T instance,
javax.enterprise.context.spi.CreationalContext<T> creationalContext,
BeanManagerImpl manager,
Iterable<? extends MethodInjectionPoint<?,?>> initializerMethods)
Calls all initializers of the bean
|
static <T,S,X extends EnhancedAnnotated<T,S>> |
checkEnhancedAnnotatedAvailable(X enhancedAnnotated) |
static boolean |
containsAllInterceptionBindings(Set<Annotation> expectedBindings,
Set<QualifierInstance> existingBindings,
BeanManagerImpl manager) |
static boolean |
containsAllQualifiers(Set<QualifierInstance> requiredQualifiers,
Set<QualifierInstance> qualifiers)
Checks that all the qualifiers in the set requiredQualifiers are in the set of qualifiers.
|
static String |
createBeanAttributesId(javax.enterprise.inject.spi.BeanAttributes<?> attributes)
Generates a unique signature for
BeanAttributes . |
static String |
createTypeCollectionId(Collection<? extends Type> types)
Generates a unique signature of a collection of types.
|
static boolean |
findInterceptorBindingConflicts(BeanManagerImpl manager,
Set<Annotation> bindings) |
static <T> EnhancedAnnotatedConstructor<T> |
getBeanConstructor(EnhancedAnnotatedType<T> type) |
static <T> EnhancedAnnotatedConstructor<T> |
getBeanConstructorStrict(EnhancedAnnotatedType<T> type) |
static Type |
getDeclaredBeanType(Class<?> clazz)
Gets the declared bean type
|
static <T> EnhancedAnnotatedType<T> |
getEjbImplementationClass(InternalEjbDescriptor<T> ejbDescriptor,
BeanManagerImpl manager,
EnhancedAnnotatedType<T> componentType) |
static <T> EnhancedAnnotatedType<T> |
getEjbImplementationClass(SessionBean<T> bean)
Returns
EnhancedAnnotatedType for the EJB implementation class. |
static List<javax.enterprise.inject.spi.AnnotatedMethod<?>> |
getInterceptableMethods(javax.enterprise.inject.spi.AnnotatedType<?> type) |
static Set<Type> |
getTypedTypes(Map<Class<?>,Type> typeClosure,
Class<?> rawType,
javax.enterprise.inject.Typed typed)
Bean types of a bean that uses the
Typed annotation. |
static Set<Type> |
getTypes(EnhancedAnnotated<?,?> annotated)
Bean types from an annotated element
|
static <T> Set<Type> |
getTypes(EnhancedAnnotated<T,?> annotated,
org.jboss.weld.ejb.spi.EjbDescriptor<T> ejbDescriptor)
Bean types of a session bean.
|
static boolean |
hasBuiltinScope(javax.enterprise.inject.spi.Bean<?> bean) |
static boolean |
hasSimpleCdiConstructor(javax.enterprise.inject.spi.AnnotatedType<?> type) |
static <T> void |
injectBoundFields(T instance,
javax.enterprise.context.spi.CreationalContext<T> creationalContext,
BeanManagerImpl manager,
Iterable<? extends FieldInjectionPoint<?,?>> injectableFields)
Injects bound fields
|
static <T> void |
injectEEFields(Iterable<Set<ResourceInjection<?>>> resourceInjectionsHierarchy,
T beanInstance,
javax.enterprise.context.spi.CreationalContext<T> ctx)
Injects EJBs and other EE resources.
|
static <T> void |
injectFieldsAndInitializers(T instance,
javax.enterprise.context.spi.CreationalContext<T> ctx,
BeanManagerImpl beanManager,
List<? extends Iterable<? extends FieldInjectionPoint<?,?>>> injectableFields,
List<? extends Iterable<? extends MethodInjectionPoint<?,?>>> initializerMethods) |
static boolean |
isAlternative(EnhancedAnnotated<?,?> annotated,
MergedStereotypes<?,?> mergedStereotypes)
Is alternative.
|
static boolean |
isAlternativePresent(Set<javax.enterprise.inject.spi.Bean<?>> beans)
Check if any of the beans is an alternative
|
static boolean |
isBeanEnabled(javax.enterprise.inject.spi.Bean<?> bean,
ModuleEnablement enabled) |
static boolean |
isBeanProxyable(javax.enterprise.inject.spi.Bean<?> bean,
BeanManagerImpl manager)
Indicates if a bean is proxyable
|
static <T> boolean |
isDecorator(EnhancedAnnotatedType<T> annotatedItem) |
static <T> boolean |
isInterceptor(javax.enterprise.inject.spi.AnnotatedType<T> annotatedItem) |
static boolean |
isPassivatingScope(javax.enterprise.inject.spi.Bean<?> bean,
BeanManagerImpl manager)
Indicates if a bean's scope type is passivating
|
static boolean |
isPassivationCapableBean(javax.enterprise.inject.spi.Bean<?> bean)
Tests if a bean is capable of having its state temporarily stored to secondary storage
|
static boolean |
isPassivationCapableDependency(javax.enterprise.inject.spi.Bean<?> bean)
Tests if a bean is capable of having its state temporarily stored to secondary storage
|
static boolean |
isTypeManagedBeanOrDecoratorOrInterceptor(javax.enterprise.inject.spi.AnnotatedType<?> annotatedType)
Indicates if the type is a simple Web Bean
|
static boolean |
isTypeManagedBeanOrDecoratorOrInterceptor(org.jboss.weld.resources.spi.ClassFileInfo classFileInfo) |
static boolean |
isVetoed(javax.enterprise.inject.spi.AnnotatedType<?> type) |
static boolean |
isVetoed(Class<?> javaClass)
Determines if this Java class should be vetoed as a result of presence of
Veto annotations. |
static Set<Annotation> |
mergeInQualifiers(BeanManagerImpl manager,
Collection<Annotation> qualifiers,
Annotation[] newQualifiers) |
static <T extends javax.enterprise.inject.spi.Bean<?>> |
removeDisabledBeans(Set<T> beans,
BeanManagerImpl beanManager,
SpecializationAndEnablementRegistry registry)
Retains only beans which are enabled.
|
public static boolean isPassivatingScope(javax.enterprise.inject.spi.Bean<?> bean, BeanManagerImpl manager)
bean
- The bean to inspectpublic static boolean isPassivationCapableBean(javax.enterprise.inject.spi.Bean<?> bean)
bean
- The bean to inspectpublic static boolean isPassivationCapableDependency(javax.enterprise.inject.spi.Bean<?> bean)
bean
- The bean to inspectpublic static boolean isBeanProxyable(javax.enterprise.inject.spi.Bean<?> bean, BeanManagerImpl manager)
bean
- The bean to testpublic static List<javax.enterprise.inject.spi.AnnotatedMethod<?>> getInterceptableMethods(javax.enterprise.inject.spi.AnnotatedType<?> type)
public static boolean containsAllQualifiers(Set<QualifierInstance> requiredQualifiers, Set<QualifierInstance> qualifiers)
requiredQualifiers
- The required qualifiersqualifiers
- The set of qualifiers to checkpublic static boolean containsAllInterceptionBindings(Set<Annotation> expectedBindings, Set<QualifierInstance> existingBindings, BeanManagerImpl manager)
public static boolean findInterceptorBindingConflicts(BeanManagerImpl manager, Set<Annotation> bindings)
public static <T extends javax.enterprise.inject.spi.Bean<?>> Set<T> removeDisabledBeans(Set<T> beans, BeanManagerImpl beanManager, SpecializationAndEnablementRegistry registry)
beans
- The beans to filterbeanManager
- The bean managerregistry
- public static boolean isBeanEnabled(javax.enterprise.inject.spi.Bean<?> bean, ModuleEnablement enabled)
public static boolean isAlternativePresent(Set<javax.enterprise.inject.spi.Bean<?>> beans)
beans
- the beans to checkpublic static boolean isAlternative(EnhancedAnnotated<?,?> annotated, MergedStereotypes<?,?> mergedStereotypes)
annotated
- the annotatedmergedStereotypes
- merged stereotypespublic static <T> EnhancedAnnotatedConstructor<T> getBeanConstructorStrict(EnhancedAnnotatedType<T> type)
public static <T> EnhancedAnnotatedConstructor<T> getBeanConstructor(EnhancedAnnotatedType<T> type)
public static <T> void injectEEFields(Iterable<Set<ResourceInjection<?>>> resourceInjectionsHierarchy, T beanInstance, javax.enterprise.context.spi.CreationalContext<T> ctx)
resourceInjectionsHierarchy
- beanInstance
- ctx
- public static Type getDeclaredBeanType(Class<?> clazz)
public static <T> void injectBoundFields(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext, BeanManagerImpl manager, Iterable<? extends FieldInjectionPoint<?,?>> injectableFields)
instance
- The instance to inject intopublic static <T> void injectFieldsAndInitializers(T instance, javax.enterprise.context.spi.CreationalContext<T> ctx, BeanManagerImpl beanManager, List<? extends Iterable<? extends FieldInjectionPoint<?,?>>> injectableFields, List<? extends Iterable<? extends MethodInjectionPoint<?,?>>> initializerMethods)
public static <T> void callInitializers(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext, BeanManagerImpl manager, Iterable<? extends MethodInjectionPoint<?,?>> initializerMethods)
instance
- The bean instancepublic static <T> boolean isInterceptor(javax.enterprise.inject.spi.AnnotatedType<T> annotatedItem)
public static <T> boolean isDecorator(EnhancedAnnotatedType<T> annotatedItem)
public static Set<Annotation> mergeInQualifiers(BeanManagerImpl manager, Collection<Annotation> qualifiers, Annotation[] newQualifiers)
public static Set<Type> getTypes(EnhancedAnnotated<?,?> annotated)
public static <T> Set<Type> getTypes(EnhancedAnnotated<T,?> annotated, org.jboss.weld.ejb.spi.EjbDescriptor<T> ejbDescriptor)
public static Set<Type> getTypedTypes(Map<Class<?>,Type> typeClosure, Class<?> rawType, javax.enterprise.inject.Typed typed)
Typed
annotation.public static boolean isTypeManagedBeanOrDecoratorOrInterceptor(javax.enterprise.inject.spi.AnnotatedType<?> annotatedType)
clazz
- The type to inspectpublic static boolean isTypeManagedBeanOrDecoratorOrInterceptor(org.jboss.weld.resources.spi.ClassFileInfo classFileInfo)
public static boolean hasSimpleCdiConstructor(javax.enterprise.inject.spi.AnnotatedType<?> type)
public static boolean isVetoed(Class<?> javaClass)
Veto
annotations.public static boolean isVetoed(javax.enterprise.inject.spi.AnnotatedType<?> type)
public static String createBeanAttributesId(javax.enterprise.inject.spi.BeanAttributes<?> attributes)
BeanAttributes
.public static String createTypeCollectionId(Collection<? extends Type> types)
public static <T,S,X extends EnhancedAnnotated<T,S>> X checkEnhancedAnnotatedAvailable(X enhancedAnnotated)
public static boolean hasBuiltinScope(javax.enterprise.inject.spi.Bean<?> bean)
public static <T> EnhancedAnnotatedType<T> getEjbImplementationClass(SessionBean<T> bean)
EnhancedAnnotatedType
for the EJB implementation class. Throws IllegalStateException
if called after bootstrap.bean
- EnhancedAnnotatedType
representation of this EJB's implementation classIllegalStateException
- if called after bootstrappublic static <T> EnhancedAnnotatedType<T> getEjbImplementationClass(InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl manager, EnhancedAnnotatedType<T> componentType)
Copyright © 2016. All rights reserved.