Package org.jboss.weld.bootstrap.events
Class ProcessBeanAttributesImpl<T>
- java.lang.Object
-
- org.jboss.weld.bootstrap.events.ContainerEvent
-
- org.jboss.weld.bootstrap.events.AbstractContainerEvent
-
- org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent
-
- org.jboss.weld.bootstrap.events.ProcessBeanAttributesImpl<T>
-
- Type Parameters:
T
- the type of bean
- All Implemented Interfaces:
ProcessBeanAttributes<T>
,NotificationListener
public class ProcessBeanAttributesImpl<T> extends AbstractDefinitionContainerEvent implements ProcessBeanAttributes<T>
Container lifecycle event that allows bean metadata (BeanAttributes
) to be changed before the bean is registered.- Author:
- Jozef Hartinger
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BeanAttributesConfigurator<T>
configureBeanAttributes()
returns aBeanAttributesConfigurator
initialized with theBeanAttributes
processed by this event to configure a new BeanAttributes that will replace the original one at the end of the observer invocation.protected static <T> ProcessBeanAttributesImpl<T>
fire(BeanManagerImpl beanManager, BeanAttributes<T> attributes, Annotated annotated, Type type)
Annotated
getAnnotated()
BeanAttributes<T>
getBeanAttributes()
BeanAttributes<T>
getBeanAttributesInternal()
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.boolean
isDirty()
boolean
isIgnoreFinalMethods()
boolean
isVeto()
void
postNotify(Extension extension)
void
setBeanAttributes(BeanAttributes<T> beanAttributes)
Replaces theBeanAttributes
.void
veto()
Forces the container to ignore the bean.-
Methods inherited from class org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent
addDefinitionError, fire
-
Methods inherited from class org.jboss.weld.bootstrap.events.AbstractContainerEvent
getActualTypeArguments, getBeanManager, getErrors, getEventType, getRawType
-
Methods inherited from class org.jboss.weld.bootstrap.events.ContainerEvent
checkWithinObserverNotification, getReceiver, preNotify
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.enterprise.inject.spi.ProcessBeanAttributes
addDefinitionError
-
-
-
-
Method Detail
-
fire
protected static <T> ProcessBeanAttributesImpl<T> fire(BeanManagerImpl beanManager, BeanAttributes<T> attributes, Annotated annotated, Type type)
-
getAnnotated
public Annotated getAnnotated()
- Specified by:
getAnnotated
in interfaceProcessBeanAttributes<T>
- Returns:
- the
AnnotatedType
representing the managed bean class or session bean class, theAnnotatedMethod
representing the producer field, or theAnnotatedField
representing the producer field
-
getBeanAttributes
public BeanAttributes<T> getBeanAttributes()
- Specified by:
getBeanAttributes
in interfaceProcessBeanAttributes<T>
- Returns:
- the
BeanAttributes
object that will be used by the container to manage instances of the bean
-
getBeanAttributesInternal
public BeanAttributes<T> getBeanAttributesInternal()
-
setBeanAttributes
public void setBeanAttributes(BeanAttributes<T> beanAttributes)
Description copied from interface:ProcessBeanAttributes
Replaces theBeanAttributes
.- Specified by:
setBeanAttributes
in interfaceProcessBeanAttributes<T>
- Parameters:
beanAttributes
- the newBeanAttributes
to use
-
configureBeanAttributes
public BeanAttributesConfigurator<T> configureBeanAttributes()
Description copied from interface:ProcessBeanAttributes
returns aBeanAttributesConfigurator
initialized with theBeanAttributes
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.- Specified by:
configureBeanAttributes
in interfaceProcessBeanAttributes<T>
- Returns:
- a non reusable
BeanAttributesConfigurator
to configure the replacing BeanAttributes
-
veto
public void veto()
Description copied from interface:ProcessBeanAttributes
Forces the container to ignore the bean.- Specified by:
veto
in interfaceProcessBeanAttributes<T>
-
ignoreFinalMethods
public void ignoreFinalMethods()
Description copied from interface:ProcessBeanAttributes
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.
- Specified by:
ignoreFinalMethods
in interfaceProcessBeanAttributes<T>
-
isVeto
public boolean isVeto()
-
isDirty
public boolean isDirty()
-
isIgnoreFinalMethods
public boolean isIgnoreFinalMethods()
-
postNotify
public void postNotify(Extension extension)
- Specified by:
postNotify
in interfaceNotificationListener
- Overrides:
postNotify
in classContainerEvent
-
-