public class Beans extends Object
Modifier and Type | Method and Description |
---|---|
static <T> void |
callInitializers(T instance,
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(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 List<AnnotatedMethod<?>> |
getInterceptableMethods(AnnotatedType<?> type) |
static Set<Type> |
getTypedTypes(Map<Class<?>,Type> typeClosure,
Class<?> rawType,
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,
EjbDescriptor<T> ejbDescriptor)
Bean types of a session bean.
|
static boolean |
hasSimpleCdiConstructor(AnnotatedType<?> type) |
static <T> void |
injectBoundFields(T instance,
CreationalContext<T> creationalContext,
BeanManagerImpl manager,
Iterable<? extends FieldInjectionPoint<?,?>> injectableFields)
Injects bound fields
|
static <T> void |
injectEEFields(Iterable<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,
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<Bean<?>> beans)
Check if any of the beans is an alternative
|
static boolean |
isBeanEnabled(Bean<?> bean,
ModuleEnablement enabled) |
static boolean |
isBeanProxyable(Bean<?> bean)
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 |
isVetoed(AnnotatedType<?> type) |
static boolean |
isVetoed(Class<?> javaClass)
Determines if this Java class should be vetoed as a result of presence of
Veto annotations. |
static Annotation[] |
mergeInQualifiers(Annotation[] qualifiers,
Annotation[] newQualifiers) |
static Set<Annotation> |
mergeInQualifiers(Collection<Annotation> qualifiers,
Annotation[] newQualifiers) |
static <T extends Bean<?>> |
removeDisabledBeans(Set<T> beans,
BeanManagerImpl beanManager,
SpecializationAndEnablementRegistry registry)
Retains only beans which have deployment type X.
|
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)
bean
- The bean to testpublic static List<AnnotatedMethod<?>> getInterceptableMethods(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 Bean<?>> Set<T> removeDisabledBeans(Set<T> beans, BeanManagerImpl beanManager, SpecializationAndEnablementRegistry registry)
beans
- The beans to filterbeanManager
- the bean managerpublic static boolean isBeanEnabled(Bean<?> bean, ModuleEnablement enabled)
public static boolean isAlternativePresent(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(Iterable<Set<ResourceInjection<?>>> resourceInjectionsHierarchy, T beanInstance, CreationalContext<T> ctx)
resourceInjectionsHierarchy
- beanInstance
- ctx
- public static Type getDeclaredBeanType(Class<?> clazz)
public static <T> void injectBoundFields(T instance, CreationalContext<T> creationalContext, BeanManagerImpl manager, Iterable<? extends FieldInjectionPoint<?,?>> injectableFields)
instance
- The instance to inject intopublic static <T> void injectFieldsAndInitializers(T instance, CreationalContext<T> ctx, BeanManagerImpl beanManager, List<? extends Iterable<? extends FieldInjectionPoint<?,?>>> injectableFields, List<? extends Iterable<? extends MethodInjectionPoint<?,?>>> initializerMethods)
public static <T> void callInitializers(T instance, CreationalContext<T> creationalContext, BeanManagerImpl manager, 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 Annotation[] mergeInQualifiers(Annotation[] qualifiers, Annotation[] newQualifiers)
public static Set<Annotation> mergeInQualifiers(Collection<Annotation> qualifiers, Annotation[] newQualifiers)
public static Set<Type> getTypes(EnhancedAnnotated<?,?> annotated)
public static <T> Set<Type> getTypes(EnhancedAnnotated<T,?> annotated, EjbDescriptor<T> ejbDescriptor)
public static Set<Type> getTypedTypes(Map<Class<?>,Type> typeClosure, Class<?> rawType, Typed typed)
Typed
annotation.public static boolean isTypeManagedBeanOrDecoratorOrInterceptor(AnnotatedType<?> annotatedType)
clazz
- The type to inspectpublic static boolean hasSimpleCdiConstructor(AnnotatedType<?> type)
public static boolean isVetoed(Class<?> javaClass)
Veto
annotations.public static boolean isVetoed(AnnotatedType<?> type)
public static String createBeanAttributesId(BeanAttributes<?> attributes)
BeanAttributes
.public static String createTypeCollectionId(Collection<? extends Type> types)
public static <T,S,X extends EnhancedAnnotated<T,S>> X checkEnhancedAnnotatedAvailable(X enhancedAnnotated)
Copyright © 2013 Seam Framework. All Rights Reserved.