public final class WebBeansUtil extends Object
| Constructor and Description |
|---|
WebBeansUtil(WebBeansContext webBeansContext) |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkGenericType(Class<?> clazz,
Class<? extends Annotation> scope)
Checks the generic type requirements.
|
static void |
checkInjectionPointNamedQualifier(javax.enterprise.inject.spi.InjectionPoint injectionPoint) |
void |
checkManagedBean(Class<?> clazz)
Returns true if this class can be candidate for simple web bean, false otherwise.
|
<X> void |
checkManagedBeanCondition(javax.enterprise.inject.spi.AnnotatedType<X> type)
Checks the implementation class for checking conditions.
|
void |
checkManagedBeanCondition(Class<?> clazz) |
static void |
checkNullInstance(Object instance,
Class<?> scopeType,
String errorMessage,
Object... errorMessageArgs) |
static boolean |
checkObtainsInjectionPointConditions(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
Returns true if instance injection point false otherwise.
|
static void |
checkProducerGenericType(javax.enterprise.inject.spi.Bean<?> bean,
Member member)
Check producer method/field bean return type.
|
void |
checkSerializableScopeType(Class<? extends Annotation> scopeType,
boolean isSerializable,
String errorMessage,
Object... errorMessageArgs) |
void |
checkTypeVariables(javax.enterprise.util.TypeLiteral<?> subtype) |
<T> javax.enterprise.inject.spi.Bean<T> |
createNewComponent(Class<T> type) |
<T> NewManagedBean<T> |
createNewComponent(OwbBean<T> bean,
Class<T> type)
New WebBeans component class.
|
<T> ManagedBean<T> |
defineManagedBeanWithoutFireEvents(javax.enterprise.inject.spi.AnnotatedType<T> type)
This method will be used in
AfterBeanDiscovery.addBean(javax.enterprise.inject.spi.Bean)} |
<T> GProcessAnnotatedType |
fireProcessAnnotatedTypeEvent(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)
Returns
ProcessAnnotatedType event. |
<T> ProcessBeanAttributesImpl<T> |
fireProcessBeanAttributes(javax.enterprise.inject.spi.Annotated annotatedType,
Class<?> type,
javax.enterprise.inject.spi.BeanAttributes<T> ba) |
GProcessInjectionPoint |
fireProcessInjectionPointEvent(javax.enterprise.inject.spi.InjectionPoint injectionPoint) |
<T> GProcessInjectionTarget |
fireProcessInjectionTargetEvent(InjectionTargetImpl<T> injectionTarget,
javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)
Returns
ProcessInjectionTarget event. |
<T> GProcessInjectionTarget |
fireProcessInjectionTargetEventForJavaEeComponents(Class<T> componentClass)
Returns
ProcessInjectionTarget event. |
<T> javax.enterprise.inject.spi.Producer<T> |
fireProcessProducerEvent(javax.enterprise.inject.spi.Producer<T> producer,
javax.enterprise.inject.spi.AnnotatedMember<?> annotatedMember) |
void |
fireProcessProducerFieldBeanEvent(Map<ProducerFieldBean<?>,javax.enterprise.inject.spi.AnnotatedField<?>> annotatedFields) |
void |
fireProcessProducerMethodBeanEvent(Map<ProducerMethodBean<?>,javax.enterprise.inject.spi.AnnotatedMethod<?>> annotatedMethods,
javax.enterprise.inject.spi.AnnotatedType<?> annotatedType) |
<T> GProcessSyntheticAnnotatedType |
fireProcessSyntheticAnnotatedTypeEvent(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)
Returns
ProcessAnnotatedType event. |
<T> BeanMetadataBean<T> |
getBeanMetadataBean()
Creates a new bean metadata bean.
|
ConversationBean |
getConversationBean()
Returns new conversation bean instance.
|
static ClassLoader |
getCurrentClassLoader()
Gets current classloader with current thread.
|
<T> DecoratorMetadataBean<T> |
getDecoratorMetadataBean()
Creates a new decorator metadata bean.
|
<T> EventBean<T> |
getEventBean()
Creates a new event bean.
|
EventMetadataBean |
getEventMetadataBean()
Creates a new event bean.
|
<T> javax.enterprise.inject.spi.AnnotatedConstructor<T> |
getInjectedConstructor(javax.enterprise.inject.spi.AnnotatedType<T> type) |
InjectionPointBean |
getInjectionPointBean()
Returns a new injected point bean instance.
|
<T> InstanceBean<T> |
getInstanceBean()
Creates a new instance bean.
|
<T> InterceptedOrDecoratedBeanMetadataBean<T> |
getInterceptedOrDecoratedBeanMetadataBean()
Creates a new metadata bean.
|
InterceptionFactoryBean |
getInterceptionFactoryBean() |
<T> InterceptorMetadataBean<T> |
getInterceptorMetadataBean()
Creates a new interceptor metadata bean.
|
BeanManagerBean |
getManagerBean()
Creates a new manager bean instance.
|
static javax.enterprise.inject.spi.Bean<?> |
getMostSpecializedBean(javax.enterprise.inject.spi.BeanManager manager,
javax.enterprise.inject.spi.Bean<?> component) |
<T> Constructor<T> |
getNoArgConstructor(Class<T> clazz) |
static String |
getPassivationId(javax.enterprise.context.spi.Contextual<?> contextual) |
PrincipalBean |
getPrincipalBean()
Creates a new bean metadata bean.
|
RequestContextControllerBean |
getRequestContextControllerBean()
Creates a new bean for Request Context Controller
|
void |
inspectDefinitionErrorStack(String logMessage) |
void |
inspectDeploymentErrorStack(String logMessage) |
static boolean |
isAlternative(javax.enterprise.inject.spi.Annotated annotated,
Set<Class<? extends Annotation>> stereotypes) |
boolean |
isAnnotatedTypeDecoratorOrInterceptor(javax.enterprise.inject.spi.AnnotatedType<?> annotatedType)
Return true if this annotated type represents a decorator.
|
boolean |
isBeanEnabled(javax.enterprise.inject.spi.AnnotatedType<?> at,
Set<Class<? extends Annotation>> stereotypes) |
boolean |
isBeanEnabled(javax.enterprise.inject.spi.BeanAttributes<?> beanAttributes,
javax.enterprise.inject.spi.AnnotatedType<?> at,
Set<Class<? extends Annotation>> stereotypes) |
static boolean |
isCdiInterceptor(javax.enterprise.inject.spi.AnnotatedType<?> annotatedType) |
boolean |
isConstructorOk(javax.enterprise.inject.spi.AnnotatedType<?> annotatedType)
Check that simple web beans class has compatible constructor.
|
boolean |
isContainerEventType(Class<?> type) |
boolean |
isContainerEventType(Object event) |
static boolean |
isDecorator(javax.enterprise.inject.spi.AnnotatedType<?> annotatedType) |
static boolean |
isDefaultExtensionBeanEventType(Class<?> clazz) |
static boolean |
isDefaultExtensionProducerOrObserverEventType(Class<?> clazz) |
static boolean |
isDependent(javax.enterprise.inject.spi.Bean<?> bean) |
static boolean |
isExtensionBeanEventType(Type type) |
static boolean |
isExtensionProducerOrObserverEventType(Type type) |
boolean |
isPassivationCapableDependency(javax.enterprise.inject.spi.InjectionPoint injectionPoint) |
void |
setBeanEnableFlagForProducerBean(InjectionTargetBean<?> parent,
AbstractProducerBean<?> producer,
Annotation[] annotations) |
void |
setInjectionTargetBeanEnableFlag(InjectionTargetBean<?> bean)
Sets bean enabled flag.
|
boolean |
supportsJavaEeComponentInjections(Class<?> clazz)
Returns true if given class supports injections,
false otherwise.
|
static void |
throwRuntimeExceptions(Exception e) |
void |
validate(Set<javax.enterprise.inject.spi.InjectionPoint> injectionPoints,
javax.enterprise.inject.spi.Bean<?> bean) |
void |
validateBeanInjection(javax.enterprise.inject.spi.Bean<?> bean) |
void |
validEventType(Type eventType,
Type metadataType) |
public WebBeansUtil(WebBeansContext webBeansContext)
public static ClassLoader getCurrentClassLoader()
public static void checkGenericType(Class<?> clazz, Class<? extends Annotation> scope)
public static void checkProducerGenericType(javax.enterprise.inject.spi.Bean<?> bean,
Member member)
bean - producer bean instancemember - related member instancepublic void checkManagedBean(Class<?> clazz)
clazz - implementation classWebBeansConfigurationException - if any configuration exception occurspublic void checkManagedBeanCondition(Class<?> clazz) throws WebBeansConfigurationException
WebBeansConfigurationExceptionpublic boolean supportsJavaEeComponentInjections(Class<?> clazz)
Each plugin is asked with given class that supports injections or not.
clazz - scanned classpublic boolean isConstructorOk(javax.enterprise.inject.spi.AnnotatedType<?> annotatedType)
throws WebBeansConfigurationException
annotatedType - web beans annotatedTypeWebBeansConfigurationException - if the web beans has incompatible
constructorpublic <T> javax.enterprise.inject.spi.AnnotatedConstructor<T> getInjectedConstructor(javax.enterprise.inject.spi.AnnotatedType<T> type)
public <T> javax.enterprise.inject.spi.Bean<T> createNewComponent(Class<T> type)
public <T> NewManagedBean<T> createNewComponent(OwbBean<T> bean, Class<T> type)
public BeanManagerBean getManagerBean()
public RequestContextControllerBean getRequestContextControllerBean()
public <T> InstanceBean<T> getInstanceBean()
public <T> EventBean<T> getEventBean()
public EventMetadataBean getEventMetadataBean()
public <T> BeanMetadataBean<T> getBeanMetadataBean()
public PrincipalBean getPrincipalBean()
public <T> InterceptorMetadataBean<T> getInterceptorMetadataBean()
public <T> DecoratorMetadataBean<T> getDecoratorMetadataBean()
public <T> InterceptedOrDecoratedBeanMetadataBean<T> getInterceptedOrDecoratedBeanMetadataBean()
public ConversationBean getConversationBean()
public InjectionPointBean getInjectionPointBean()
public <T> Constructor<T> getNoArgConstructor(Class<T> clazz)
public static boolean checkObtainsInjectionPointConditions(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
injectionPoint - injection point definitionpublic static void checkNullInstance(Object instance, Class<?> scopeType, String errorMessage, Object... errorMessageArgs)
public void checkSerializableScopeType(Class<? extends Annotation> scopeType, boolean isSerializable, String errorMessage, Object... errorMessageArgs)
public static javax.enterprise.inject.spi.Bean<?> getMostSpecializedBean(javax.enterprise.inject.spi.BeanManager manager,
javax.enterprise.inject.spi.Bean<?> component)
public <T> GProcessAnnotatedType fireProcessAnnotatedTypeEvent(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)
ProcessAnnotatedType event.T - bean typeannotatedType - bean classpublic <T> GProcessSyntheticAnnotatedType fireProcessSyntheticAnnotatedTypeEvent(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)
ProcessAnnotatedType event.T - bean typeannotatedType - bean classpublic GProcessInjectionPoint fireProcessInjectionPointEvent(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
injectionPoint - the original InjectionPointProcessInjectionPoint eventpublic <T> GProcessInjectionTarget fireProcessInjectionTargetEvent(InjectionTargetImpl<T> injectionTarget, javax.enterprise.inject.spi.AnnotatedType<T> annotatedType)
ProcessInjectionTarget event.T - bean typepublic <T> GProcessInjectionTarget fireProcessInjectionTargetEventForJavaEeComponents(Class<T> componentClass)
ProcessInjectionTarget event.T - bean typepublic <T> javax.enterprise.inject.spi.Producer<T> fireProcessProducerEvent(javax.enterprise.inject.spi.Producer<T> producer,
javax.enterprise.inject.spi.AnnotatedMember<?> annotatedMember)
public void fireProcessProducerMethodBeanEvent(Map<ProducerMethodBean<?>,javax.enterprise.inject.spi.AnnotatedMethod<?>> annotatedMethods, javax.enterprise.inject.spi.AnnotatedType<?> annotatedType)
public void fireProcessProducerFieldBeanEvent(Map<ProducerFieldBean<?>,javax.enterprise.inject.spi.AnnotatedField<?>> annotatedFields)
public static void checkInjectionPointNamedQualifier(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
public void setInjectionTargetBeanEnableFlag(InjectionTargetBean<?> bean)
bean - bean instancepublic boolean isBeanEnabled(javax.enterprise.inject.spi.BeanAttributes<?> beanAttributes,
javax.enterprise.inject.spi.AnnotatedType<?> at,
Set<Class<? extends Annotation>> stereotypes)
public boolean isBeanEnabled(javax.enterprise.inject.spi.AnnotatedType<?> at,
Set<Class<? extends Annotation>> stereotypes)
public static boolean isAlternative(javax.enterprise.inject.spi.Annotated annotated,
Set<Class<? extends Annotation>> stereotypes)
public void setBeanEnableFlagForProducerBean(InjectionTargetBean<?> parent, AbstractProducerBean<?> producer, Annotation[] annotations)
public static boolean isExtensionBeanEventType(Type type)
public static boolean isDefaultExtensionBeanEventType(Class<?> clazz)
public static boolean isExtensionProducerOrObserverEventType(Type type)
public static boolean isDefaultExtensionProducerOrObserverEventType(Class<?> clazz)
public static boolean isDependent(javax.enterprise.inject.spi.Bean<?> bean)
public void inspectDefinitionErrorStack(String logMessage)
public void inspectDeploymentErrorStack(String logMessage)
public static String getPassivationId(javax.enterprise.context.spi.Contextual<?> contextual)
contextual - the Bean to checkPassivationCapable and enabledpublic <T> ManagedBean<T> defineManagedBeanWithoutFireEvents(javax.enterprise.inject.spi.AnnotatedType<T> type)
AfterBeanDiscovery.addBean(javax.enterprise.inject.spi.Bean)}public boolean isPassivationCapableDependency(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
public static void throwRuntimeExceptions(Exception e)
public static boolean isDecorator(javax.enterprise.inject.spi.AnnotatedType<?> annotatedType)
true if this annotated type represents a decorator.public boolean isAnnotatedTypeDecoratorOrInterceptor(javax.enterprise.inject.spi.AnnotatedType<?> annotatedType)
annotatedType - annotated typepublic static boolean isCdiInterceptor(javax.enterprise.inject.spi.AnnotatedType<?> annotatedType)
true if this AnnotatedType represents a CDI Interceptor
defined via a Interceptor annotationpublic <X> void checkManagedBeanCondition(javax.enterprise.inject.spi.AnnotatedType<X> type)
throws WebBeansConfigurationException
type - implementation classWebBeansConfigurationException - if any configuration exception occurspublic void validate(Set<javax.enterprise.inject.spi.InjectionPoint> injectionPoints, javax.enterprise.inject.spi.Bean<?> bean)
public void checkTypeVariables(javax.enterprise.util.TypeLiteral<?> subtype)
public boolean isContainerEventType(Class<?> type)
public boolean isContainerEventType(Object event)
public <T> ProcessBeanAttributesImpl<T> fireProcessBeanAttributes(javax.enterprise.inject.spi.Annotated annotatedType, Class<?> type, javax.enterprise.inject.spi.BeanAttributes<T> ba)
public void validateBeanInjection(javax.enterprise.inject.spi.Bean<?> bean)
public InterceptionFactoryBean getInterceptionFactoryBean()
Copyright © 2008–2020 The Apache Software Foundation. All rights reserved.