Top Description Methods
javax.enterprise.inject.spi

public Interface ProcessBeanAttributes<T>

Type Parameters
<T>
The class of the bean
Imports
javax.enterprise.inject.New, javax.enterprise.inject.spi.configurator.BeanAttributesConfigurator

The container fires an event of this type for each enabled bean, interceptor or decorator deployed in a bean archive before registering the javax.enterprise.inject.spi.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.

Authors
Pete Muir, Antoine Sabot-Durand
Since
1.1

Method Summary

Modifier and TypeMethod and Description
public void
addDefinitionError(Throwable
the error to add
t
)

Registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.

public BeanAttributesConfigurator<T>

Returns:

a non reusable BeanAttributesConfigurator to configure the replacing BeanAttributes
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.

public Annotated

Returns:

the AnnotatedType representing the managed bean class or session bean class, the AnnotatedMethod representing the producer field, or the AnnotatedField representing the producer field
getAnnotated
()

public BeanAttributes<T>

Returns:

the BeanAttributes object that will be used by the container to manage instances of the bean
getBeanAttributes
()

public 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.

public void
setBeanAttributes(BeanAttributes<T>
the new BeanAttributes to use
beanAttributes
)

Replaces the BeanAttributes.

public void
veto()

Forces the container to ignore the bean.

Method Detail

addDefinitionErrorback to summary
public void addDefinitionError(Throwable t)

Registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.

Parameters
t:Throwable

the error to add

Exceptions
IllegalStateException:
if called outside of the observer method invocation
configureBeanAttributesback to summary
public 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. Each call returns the same BeanAttributesConfigurator.

Returns:BeanAttributesConfigurator<T>

a non reusable BeanAttributesConfigurator to configure the replacing BeanAttributes

Exceptions
IllegalStateException:
if called outside of the observer method invocation
Since
2.0
getAnnotatedback to summary
public Annotated getAnnotated()
Returns:Annotated

the AnnotatedType representing the managed bean class or session bean class, the AnnotatedMethod representing the producer field, or the AnnotatedField representing the producer field

Exceptions
IllegalStateException:
if called outside of the observer method invocation
getBeanAttributesback to summary
public BeanAttributes<T> getBeanAttributes()
Returns:BeanAttributes<T>

the BeanAttributes object that will be used by the container to manage instances of the bean

Exceptions
IllegalStateException:
if called outside of the observer method invocation
ignoreFinalMethodsback to summary
public 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.

These method should never be invoked upon bean instances. Otherwise, unpredictable behavior results.

Exceptions
IllegalStateException:
if called outside of the observer method invocation
Since
2.0
setBeanAttributesback to summary
public void setBeanAttributes(BeanAttributes<T> beanAttributes)

Replaces the BeanAttributes.

Parameters
beanAttributes:BeanAttributes<T>

the new BeanAttributes to use

Exceptions
IllegalStateException:
if called outside of the observer method invocation
vetoback to summary
public void veto()

Forces the container to ignore the bean.

Exceptions
IllegalStateException:
if called outside of the observer method invocation