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