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
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:
-
ImmutableBeanImmutableNarrowingBean
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractImmutableBean(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
Modifier and TypeMethodDescriptionClass<?>The bean class of the managed bean or session bean or of the bean that declares the producer method or field.Obtains theInjectionPointobjects representing injection points of the bean, that will be validated by the container at initialization time.getName()Obtains the EL name of a bean, if it has one.Obtains the qualifiers of the bean.Class<? extends Annotation>getScope()Obtains the scope of the bean.Set<Class<? extends Annotation>>Obtains the stereotypes of the bean.getTypes()Obtains the bean types of the bean.booleanDetermines if the bean is an alternative.booleantoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface jakarta.enterprise.context.spi.Contextual
create, destroy
-
Constructor Details
-
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 Details
-
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
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
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
Description copied from interface:BeanAttributesObtains the qualifiers of the bean.- Specified by:
getQualifiersin interfaceBeanAttributes<T>- Returns:
- the qualifiers
-
getScope
Description copied from interface:BeanAttributesObtains the scope of the bean.- Specified by:
getScopein interfaceBeanAttributes<T>- Returns:
- the scope
-
getStereotypes
Description copied from interface:BeanAttributesObtains the stereotypes of the bean.- Specified by:
getStereotypesin interfaceBeanAttributes<T>- Returns:
- the set of stereotypes
-
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() -
toString
-