Package org.infinispan.cdi.common.util
Class AbstractImmutableBean<T>
- java.lang.Object
-
- org.infinispan.cdi.common.util.AbstractImmutableBean<T>
-
- All Implemented Interfaces:
javax.enterprise.context.spi.Contextual<T>,javax.enterprise.inject.spi.Bean<T>,javax.enterprise.inject.spi.BeanAttributes<T>
- Direct Known Subclasses:
ImmutableBean
public abstract class AbstractImmutableBean<T> extends Object implements javax.enterprise.inject.spi.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<javax.enterprise.inject.spi.InjectionPoint> injectionPoints, String toString)Create a new, immutable bean.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>getBeanClass()Set<javax.enterprise.inject.spi.InjectionPoint>getInjectionPoints()StringgetName()Set<Annotation>getQualifiers()Class<? extends Annotation>getScope()Set<Class<? extends Annotation>>getStereotypes()Set<Type>getTypes()booleanisAlternative()booleanisNullable()StringtoString()
-
-
-
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<javax.enterprise.inject.spi.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()
- Specified by:
getBeanClassin interfacejavax.enterprise.inject.spi.Bean<T>
-
getInjectionPoints
public Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
- Specified by:
getInjectionPointsin interfacejavax.enterprise.inject.spi.Bean<T>
-
getName
public String getName()
- Specified by:
getNamein interfacejavax.enterprise.inject.spi.BeanAttributes<T>
-
getQualifiers
public Set<Annotation> getQualifiers()
- Specified by:
getQualifiersin interfacejavax.enterprise.inject.spi.BeanAttributes<T>
-
getScope
public Class<? extends Annotation> getScope()
- Specified by:
getScopein interfacejavax.enterprise.inject.spi.BeanAttributes<T>
-
getStereotypes
public Set<Class<? extends Annotation>> getStereotypes()
- Specified by:
getStereotypesin interfacejavax.enterprise.inject.spi.BeanAttributes<T>
-
getTypes
public Set<Type> getTypes()
- Specified by:
getTypesin interfacejavax.enterprise.inject.spi.BeanAttributes<T>
-
isAlternative
public boolean isAlternative()
- Specified by:
isAlternativein interfacejavax.enterprise.inject.spi.BeanAttributes<T>
-
isNullable
public boolean isNullable()
- Specified by:
isNullablein interfacejavax.enterprise.inject.spi.Bean<T>
-
-