Package org.infinispan.cdi.common.util
Class AbstractImmutableBean<T>
- java.lang.Object
-
- org.infinispan.cdi.common.util.AbstractImmutableBean<T>
-
- All Implemented Interfaces:
Contextual<T>,Bean<T>,BeanAttributes<T>
- Direct Known Subclasses:
ImmutableBean
public abstract class AbstractImmutableBean<T> extends Object implements Bean<T>
A base class for implementing
Bean. The attributes are immutable, and collections are defensively copied on instantiation. It uses the defaults from the specification for properties if not specified.This class does not provide any bean lifecycle operations
- Author:
- Pete Muir
- See Also:
ImmutableBean,ImmutableNarrowingBean
-
-
Constructor Summary
Constructors Constructor Description AbstractImmutableBean(Class<?> beanClass, String name, Set<Annotation> qualifiers, Class<? extends Annotation> scope, Set<Class<? extends Annotation>> stereotypes, Set<Type> types, boolean alternative, boolean nullable, Set<InjectionPoint> injectionPoints, String toString)Create a new, immutable bean.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>getBeanClass()The bean class of the managed bean or session bean or of the bean that declares the producer method or field.Set<InjectionPoint>getInjectionPoints()Obtains theInjectionPointobjects representing injection points of the bean, that will be validated by the container at initialization time.StringgetName()Obtains the EL name of a bean, if it has one.Set<Annotation>getQualifiers()Obtains the qualifiers of the bean.Class<? extends Annotation>getScope()Obtains the scope of the bean.Set<Class<? extends Annotation>>getStereotypes()Obtains the stereotypes of the bean.Set<Type>getTypes()Obtains the bean types of the bean.booleanisAlternative()Determines if the bean is an alternative.booleanisNullable()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jakarta.enterprise.context.spi.Contextual
create, destroy
-
-
-
-
Constructor Detail
-
AbstractImmutableBean
public AbstractImmutableBean(Class<?> beanClass, String name, Set<Annotation> qualifiers, Class<? extends Annotation> scope, Set<Class<? extends Annotation>> stereotypes, Set<Type> types, boolean alternative, boolean nullable, Set<InjectionPoint> injectionPoints, String toString)
Create a new, immutable bean. All arguments passed as collections are defensively copied.- Parameters:
beanClass- The Bean class, may not be nullname- The bean namequalifiers- The bean's qualifiers, if null, a singleton set ofDefaultis usedscope- The bean's scope, if null, the default scope ofDependentis usedstereotypes- The bean's stereotypes, if null, an empty set is usedtypes- The bean's types, if null, the beanClass andObjectwill be usedalternative- True if the bean is an alternativenullable- True if the bean is nullableinjectionPoints- the bean's injection points, if null an empty set is usedbeanLifecycle- Handler forContextual.create(CreationalContext)andContextual.destroy(Object, CreationalContext)- Throws:
IllegalArgumentException- if the beanClass is null
-
-
Method Detail
-
getBeanClass
public Class<?> getBeanClass()
Description copied from interface:BeanThe bean class of the managed bean or session bean or of the bean that declares the producer method or field.- Specified by:
getBeanClassin interfaceBean<T>- Returns:
- the bean class
-
getInjectionPoints
public Set<InjectionPoint> getInjectionPoints()
Description copied from interface:BeanObtains theInjectionPointobjects representing injection points of the bean, that will be validated by the container at initialization time.- Specified by:
getInjectionPointsin interfaceBean<T>- Returns:
- the set of injection points of the bean
-
getName
public String getName()
Description copied from interface:BeanAttributesObtains the EL name of a bean, if it has one.- Specified by:
getNamein interfaceBeanAttributes<T>- Returns:
- the EL name
-
getQualifiers
public Set<Annotation> getQualifiers()
Description copied from interface:BeanAttributesObtains the qualifiers of the bean.- Specified by:
getQualifiersin interfaceBeanAttributes<T>- Returns:
- the qualifiers
-
getScope
public Class<? extends Annotation> getScope()
Description copied from interface:BeanAttributesObtains the scope of the bean.- Specified by:
getScopein interfaceBeanAttributes<T>- Returns:
- the scope
-
getStereotypes
public Set<Class<? extends Annotation>> getStereotypes()
Description copied from interface:BeanAttributesObtains the stereotypes of the bean.- Specified by:
getStereotypesin interfaceBeanAttributes<T>- Returns:
- the set of stereotypes
-
getTypes
public Set<Type> getTypes()
Description copied from interface:BeanAttributesObtains the bean types of the bean.- Specified by:
getTypesin interfaceBeanAttributes<T>- Returns:
- the bean types
-
isAlternative
public boolean isAlternative()
Description copied from interface:BeanAttributesDetermines if the bean is an alternative. A custom implementation ofBeanmay implementPrioritizedin order to be selected for the application.Prioritized.getPriority()determines the priority used to resolve ambiguities.- Specified by:
isAlternativein interfaceBeanAttributes<T>- Returns:
trueif the bean is an alternative, andfalseotherwise.
-
isNullable
public boolean isNullable()
-
-