T
- The class of the beanpublic interface ProcessBeanAttributes<T>
The container fires an event of this type for each enabled bean, interceptor or decorator deployed in a bean archive before
registering the Bean
object.
No event is fired for New
qualified beans.
Any observer of this event is permitted to wrap and/or replace the BeanAttributes
by calling either setBeanAttributes(BeanAttributes)
or configureBeanAttributes()
.
If both methods are called within an observer notification an IllegalStateException
is thrown.
The container must use the final value of this property, after all observers have been called, to manage instances of the bean.
If any observer method of a ProcessBeanAttributes
event throws an exception, the exception is treated as a definition
error by the container.
Modifier and Type | Method and Description |
---|---|
void |
addDefinitionError(Throwable t)
Registers a definition error with the container, causing the container to abort deployment after bean discovery is
complete.
|
BeanAttributesConfigurator<T> |
configureBeanAttributes()
returns a
BeanAttributesConfigurator initialized with the BeanAttributes processed by this event
to configure a new BeanAttributes that will replace the original one at the end of the observer invocation. |
Annotated |
getAnnotated() |
BeanAttributes<T> |
getBeanAttributes() |
void |
ignoreFinalMethods()
Instructs the container to ignore all non-static, final methods with public, protected or default visibility
declared on any bean type of the specific bean during validation of injection points that require proxyable bean type.
|
void |
setBeanAttributes(BeanAttributes<T> beanAttributes)
Replaces the
BeanAttributes . |
void |
veto()
Forces the container to ignore the bean.
|
Annotated getAnnotated()
AnnotatedType
representing the managed bean class or session bean class, the AnnotatedMethod
representing the producer field, or the AnnotatedField
representing the producer fieldIllegalStateException
- if called outside of the observer method invocationBeanAttributes<T> getBeanAttributes()
BeanAttributes
object that will be used by the container to manage instances of the beanIllegalStateException
- if called outside of the observer method invocationvoid setBeanAttributes(BeanAttributes<T> beanAttributes)
BeanAttributes
.beanAttributes
- the new BeanAttributes
to useIllegalStateException
- if called outside of the observer method invocationBeanAttributesConfigurator<T> configureBeanAttributes()
BeanAttributesConfigurator
initialized with the BeanAttributes
processed by this event
to configure a new BeanAttributes that will replace the original one at the end of the observer invocation.
Each call returns the same BeanAttributesConfigurator.BeanAttributesConfigurator
to configure the replacing BeanAttributesIllegalStateException
- if called outside of the observer method invocationvoid addDefinitionError(Throwable t)
t
- the error to addIllegalStateException
- if called outside of the observer method invocationvoid veto()
IllegalStateException
- if called outside of the observer method invocationvoid ignoreFinalMethods()
Instructs the container to ignore all non-static, final methods with public, protected or default visibility declared on any bean type of the specific bean during validation of injection points that require proxyable bean type.
These method should never be invoked upon bean instances. Otherwise, unpredictable behavior results.
IllegalStateException
- if called outside of the observer method invocationComments to: cdi-dev@eclipse.org.
Copyright © 2019 Eclipse Foundation.
Use is subject to license terms.