Top Description Fields Constructors Methods
com.sun.faces.cdi

pack-priv abstract Class CdiProducer<T>

extends Object
implements Bean<T>, PassivationCapable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, javax.enterprise.inject.spi.PassivationCapable, javax.enterprise.inject.spi.Bean, javax.enterprise.inject.spi.BeanAttributes, javax.enterprise.context.spi.Contextual
Known Direct Subclasses
com.sun.faces.cdi.ComponentProducer, com.sun.faces.cdi.CompositeComponentProducer, com.sun.faces.cdi.DataModelClassesMapProducer, com.sun.faces.cdi.ExternalContextProducer, com.sun.faces.cdi.FacesContextProducer, com.sun.faces.cdi.FlashProducer, com.sun.faces.cdi.FlowMapProducer, com.sun.faces.cdi.HeaderMapProducer, com.sun.faces.cdi.HeaderValuesMapProducer, com.sun.faces.cdi.InitParameterMapProducer, com.sun.faces.cdi.ManagedPropertyProducer, com.sun.faces.cdi.RequestCookieMapProducer, com.sun.faces.cdi.RequestMapProducer, com.sun.faces.cdi.RequestParameterMapProducer, com.sun.faces.cdi.RequestParameterValuesMapProducer, com.sun.faces.cdi.RequestProducer, com.sun.faces.cdi.ResourceHandlerProducer, com.sun.faces.cdi.SessionMapProducer, com.sun.faces.cdi.SessionProducer, com.sun.faces.cdi.ViewMapProducer, com.sun.faces.cdi.ViewProducer, com.sun.faces.cdi.ApplicationMapProducer, com.sun.faces.cdi.ApplicationProducer
Static Imports
java.util.Arrays.asList, .Collections.emptySet, .Collections.singleton, .Collections.unmodifiableSet

An abstract base class used by the CDI producers for some common functionality.
Since
2.3

Field Summary

Modifier and TypeField and Description
private Class<?>
private Function<CreationalContext<T>, T>
private String
private String
private Set<Annotation>
private Class<? extends Annotation>
private static final long
serialVersionUID

Serialization version

private Set<Type>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected CdiProducer<T>
addToId(Object object)

protected static <T> Set<T>
asSet(T... a)

protected CdiProducer<T>
beanClass(Class<?> beanClass)

protected CdiProducer<T>
beanClassAndType(Class<?> beanClass)

public T
create(CreationalContext<T>
the context in which this instance is being created
creationalContext
)

Implements javax.enterprise.context.spi.Contextual.create.

Create a new instance of the contextual type.
protected CdiProducer<T>
public void
destroy(T
the instance.
instance
,
CreationalContext<T>
the creational context.
creationalContext
)

Implements javax.enterprise.context.spi.Contextual.destroy.

Destroy the instance.
public Class<?>
getBeanClass()

Implements javax.enterprise.inject.spi.Bean.getBeanClass.

The bean class of the managed bean or session bean or of the bean that declares the producer method or field.
public String

Returns:

the ID of this particular instantiation of the producer
getId
()

Implements javax.enterprise.inject.spi.PassivationCapable.getId.

Get the ID of this particular instantiation of the producer.
public Set<InjectionPoint>

Returns:

the injection points.
getInjectionPoints
()

Implements javax.enterprise.inject.spi.Bean.getInjectionPoints.

Get the injection points.
public String
getName()

Implements javax.enterprise.inject.spi.BeanAttributes.getName.

Obtains the EL name of a bean, if it has one.
public Set<Annotation>

Returns:

the qualifiers, which in the default case only contains the Default
getQualifiers
()

Implements javax.enterprise.inject.spi.BeanAttributes.getQualifiers.

Get the default qualifier.
public Class<? extends Annotation>
public Set<Class<? extends Annotation>>

Returns:

the stereotypes.
getStereotypes
()

Implements javax.enterprise.inject.spi.BeanAttributes.getStereotypes.

Get the stereotypes.
public Set<Type>
public boolean

Returns:

false.
isAlternative
()

Implements javax.enterprise.inject.spi.BeanAttributes.isAlternative.

Is this an alternative.
public boolean

Returns:

false.
isNullable
()

Implements javax.enterprise.inject.spi.Bean.isNullable.

Is this nullable.
protected CdiProducer<T>
name(String name)

protected CdiProducer<T>
qualifiers(Annotation... qualifiers)

protected CdiProducer<T>
scope(Class<? extends Annotation> scope)

protected CdiProducer<T>
types(Type... types)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beanClassback to summary
private Class<?> beanClass
createback to summary
private Function<CreationalContext<T>, T> create
idback to summary
private String id
nameback to summary
private String name
qualifiersback to summary
private Set<Annotation> qualifiers
scopeback to summary
private Class<? extends Annotation> scope
serialVersionUIDback to summary
private static final long serialVersionUID

Serialization version

typesback to summary
private Set<Type> types

Constructor Detail

CdiProducerback to summary
pack-priv CdiProducer()

Method Detail

addToIdback to summary
protected CdiProducer<T> addToId(Object object)
asSetback to summary
protected static <T> Set<T> asSet(T... a)
Annotations
@SafeVarargs
beanClassback to summary
protected CdiProducer<T> beanClass(Class<?> beanClass)
beanClassAndTypeback to summary
protected CdiProducer<T> beanClassAndType(Class<?> beanClass)
createback to summary
public T create(CreationalContext<T> creationalContext)

Implements javax.enterprise.context.spi.Contextual.create.

Doc from javax.enterprise.context.spi.Contextual.create.

Create a new instance of the contextual type. Instances should use the given javax.enterprise.context.spi.CreationalContext when 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 call javax.enterprise.context.spi.CreationalContext#push(Object) between instantiation and injection to help the container minimize the use of client proxy objects.

Parameters
creationalContext:CreationalContext<T>

the context in which this instance is being created

Returns:T

the contextual instance

Annotations
@Override
createback to summary
protected CdiProducer<T> create(Function<CreationalContext<T>, T> create)
destroyback to summary
public void destroy(T instance, CreationalContext<T> creationalContext)

Implements javax.enterprise.context.spi.Contextual.destroy.

Destroy the instance.

Since most artifact that the sub classes are producing are artifacts that the JSF runtime really is managing the destroy method here does not need to do anything.

Parameters
instance:T

the instance.

creationalContext:CreationalContext<T>

the creational context.

Annotations
@Override
getBeanClassback to summary
public Class<?> getBeanClass()

Implements javax.enterprise.inject.spi.Bean.getBeanClass.

Doc from javax.enterprise.inject.spi.Bean.getBeanClass.

The bean class of the managed bean or session bean or of the bean that declares the producer method or field.

Returns:Class<?>

the bean class

Annotations
@Override
getIdback to summary
public String getId()

Implements javax.enterprise.inject.spi.PassivationCapable.getId.

Get the ID of this particular instantiation of the producer.

This is an implementation detail of CDI, where it wants to relocate a particular producer in order to re-inject a value. This is typically used in combination with passivation. Note that this is NOT about the value we're producing, but about the producer itself.

Returns:String

the ID of this particular instantiation of the producer

Annotations
@Override
getInjectionPointsback to summary
public Set<InjectionPoint> getInjectionPoints()

Implements javax.enterprise.inject.spi.Bean.getInjectionPoints.

Get the injection points.

Returns:Set<InjectionPoint>

the injection points.

Annotations
@Override
getNameback to summary
public String getName()

Implements javax.enterprise.inject.spi.BeanAttributes.getName.

Doc from javax.enterprise.inject.spi.BeanAttributes.getName.

Obtains the EL name of a bean, if it has one.

Returns:String

the EL name

Annotations
@Override
getQualifiersback to summary
public Set<Annotation> getQualifiers()

Implements javax.enterprise.inject.spi.BeanAttributes.getQualifiers.

Get the default qualifier.

Returns:Set<Annotation>

the qualifiers, which in the default case only contains the Default

Annotations
@Override
getScopeback to summary
public Class<? extends Annotation> getScope()

Implements javax.enterprise.inject.spi.BeanAttributes.getScope.

Doc from javax.enterprise.inject.spi.BeanAttributes.getScope.

Obtains the scope of the bean.

Returns:Class<? extends Annotation>

the scope

Annotations
@Override
getStereotypesback to summary
public Set<Class<? extends Annotation>> getStereotypes()

Implements javax.enterprise.inject.spi.BeanAttributes.getStereotypes.

Get the stereotypes.

Returns:Set<Class<? extends Annotation>>

the stereotypes.

Annotations
@Override
getTypesback to summary
public Set<Type> getTypes()

Implements javax.enterprise.inject.spi.BeanAttributes.getTypes.

Doc from javax.enterprise.inject.spi.BeanAttributes.getTypes.

Obtains the bean types of the bean.

Returns:Set<Type>

the bean types

Annotations
@Override
isAlternativeback to summary
public boolean isAlternative()

Implements javax.enterprise.inject.spi.BeanAttributes.isAlternative.

Is this an alternative.

Returns:boolean

false.

Annotations
@Override
isNullableback to summary
public boolean isNullable()

Implements javax.enterprise.inject.spi.Bean.isNullable.

Is this nullable.

Returns:boolean

false.

Annotations
@Override
nameback to summary
protected CdiProducer<T> name(String name)
qualifiersback to summary
protected CdiProducer<T> qualifiers(Annotation... qualifiers)
scopeback to summary
protected CdiProducer<T> scope(Class<? extends Annotation> scope)
typesback to summary
protected CdiProducer<T> types(Type... types)