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 aBeanAttributesConfiguratorinitialized with theBeanAttributesprocessed 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)AnnotatedgetAnnotated()BeanAttributes<T>getBeanAttributes()BeanAttributes<T>getBeanAttributesInternal()voidignoreFinalMethods()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.booleanisDirty()booleanisIgnoreFinalMethods()booleanisVeto()voidpostNotify(Extension extension)voidsetBeanAttributes(BeanAttributes<T> beanAttributes)Replaces theBeanAttributes.voidveto()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:
getAnnotatedin interfaceProcessBeanAttributes<T>- Returns:
- the
AnnotatedTyperepresenting the managed bean class or session bean class, theAnnotatedMethodrepresenting the producer field, or theAnnotatedFieldrepresenting the producer field
-
getBeanAttributes
public BeanAttributes<T> getBeanAttributes()
- Specified by:
getBeanAttributesin interfaceProcessBeanAttributes<T>- Returns:
- the
BeanAttributesobject 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:ProcessBeanAttributesReplaces theBeanAttributes.- Specified by:
setBeanAttributesin interfaceProcessBeanAttributes<T>- Parameters:
beanAttributes- the newBeanAttributesto use
-
configureBeanAttributes
public BeanAttributesConfigurator<T> configureBeanAttributes()
Description copied from interface:ProcessBeanAttributesreturns aBeanAttributesConfiguratorinitialized with theBeanAttributesprocessed 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:
configureBeanAttributesin interfaceProcessBeanAttributes<T>- Returns:
- a non reusable
BeanAttributesConfiguratorto configure the replacing BeanAttributes
-
veto
public void veto()
Description copied from interface:ProcessBeanAttributesForces the container to ignore the bean.- Specified by:
vetoin interfaceProcessBeanAttributes<T>
-
ignoreFinalMethods
public void ignoreFinalMethods()
Description copied from interface:ProcessBeanAttributesInstructs 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:
ignoreFinalMethodsin interfaceProcessBeanAttributes<T>
-
isVeto
public boolean isVeto()
-
isDirty
public boolean isDirty()
-
isIgnoreFinalMethods
public boolean isIgnoreFinalMethods()
-
postNotify
public void postNotify(Extension extension)
- Specified by:
postNotifyin interfaceNotificationListener- Overrides:
postNotifyin classContainerEvent
-
-