Package org.jboss.weld.bean
Class SyntheticProducerBean<T,X>
- java.lang.Object
-
- org.jboss.weld.util.bean.ForwardingBeanAttributes<T>
-
- org.jboss.weld.bean.CommonBean<T>
-
- org.jboss.weld.bean.AbstractSyntheticBean<T>
-
- org.jboss.weld.bean.SyntheticProducerBean<T,X>
-
- Type Parameters:
T-
- All Implemented Interfaces:
Contextual<T>,Bean<T>,BeanAttributes<T>,WeldBean<T>
public class SyntheticProducerBean<T,X> extends AbstractSyntheticBean<T>
Represents a producer field or producer method created based on extension-providedProducerimplementation.- Author:
- Jozef Hartinger
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSyntheticProducerBean(BeanAttributes<T> attributes, Class<X> beanClass, ProducerFactory<X> factory, BeanManagerImpl manager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tcreate(CreationalContext<T> creationalContext)Create a new instance of the contextual type.voiddestroy(T instance, CreationalContext<T> creationalContext)Destroy an instance of the contextual type.protected Producer<T>getProducer()-
Methods inherited from class org.jboss.weld.bean.AbstractSyntheticBean
getBeanClass, getInjectionPoints
-
Methods inherited from class org.jboss.weld.bean.CommonBean
attributes, equals, getId, getIdentifier, hashCode, isNullable, setAttributes, toString, unwrap
-
Methods inherited from class org.jboss.weld.util.bean.ForwardingBeanAttributes
getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.enterprise.inject.spi.BeanAttributes
getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative
-
Methods inherited from interface org.jboss.weld.bean.WeldBean
getPriority
-
-
-
-
Constructor Detail
-
SyntheticProducerBean
protected SyntheticProducerBean(BeanAttributes<T> attributes, Class<X> beanClass, ProducerFactory<X> factory, BeanManagerImpl manager)
-
-
Method Detail
-
create
public T create(CreationalContext<T> creationalContext)
Description copied from interface:ContextualCreate a new instance of the contextual type. Instances should use the givenCreationalContextwhen obtaining contextual references to inject, in order to ensure that any dependent objects are associated with the contextual instance that is being created. An implementation may callCreationalContext.push(Object)between instantiation and injection to help the container minimize the use of client proxy objects.- Parameters:
creationalContext- the context in which this instance is being created- Returns:
- the contextual instance
-
destroy
public void destroy(T instance, CreationalContext<T> creationalContext)
Description copied from interface:ContextualDestroy an instance of the contextual type. Implementations should callCreationalContext.release()to allow the container to destroy dependent objects of the contextual instance.- Parameters:
instance- the contextual instance to destroycreationalContext- the context in which this instance was created
-
getProducer
protected Producer<T> getProducer()
- Specified by:
getProducerin classAbstractSyntheticBean<T>
-
-