Class CdiBean<T>
java.lang.Object
org.springframework.data.redis.repository.cdi.CdiBean<T>
- All Implemented Interfaces:
jakarta.enterprise.context.spi.Contextual<T>,jakarta.enterprise.inject.spi.Bean<T>,jakarta.enterprise.inject.spi.BeanAttributes<T>,jakarta.enterprise.inject.spi.PassivationCapable
- Direct Known Subclasses:
RedisKeyValueAdapterBean,RedisKeyValueTemplateBean
public abstract class CdiBean<T>
extends Object
implements jakarta.enterprise.inject.spi.Bean<T>, jakarta.enterprise.inject.spi.PassivationCapable
Base class for
Bean wrappers.- Author:
- Mark Paluch, Christoph Strobl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final jakarta.enterprise.inject.spi.BeanManager -
Constructor Summary
ConstructorsConstructorDescriptionCdiBean(Set<Annotation> qualifiers, Class<T> beanClass, jakarta.enterprise.inject.spi.BeanManager beanManager) Creates a newCdiBean.CdiBean(Set<Annotation> qualifiers, Set<Type> types, Class<T> beanClass, jakarta.enterprise.inject.spi.BeanManager beanManager) Creates a newCdiBean. -
Method Summary
Modifier and TypeMethodDescriptionvoidClass<?>protected <S> SgetDependencyInstance(jakarta.enterprise.inject.spi.Bean<S> bean, Type type) Returns an instance of the givenBeanfrom the container.getId()Set<jakarta.enterprise.inject.spi.InjectionPoint>getName()Class<? extends Annotation>getScope()Set<Class<? extends Annotation>>getTypes()final voidForces the initialization of bean target.booleanbooleantoString()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
-
Field Details
-
beanManager
protected final jakarta.enterprise.inject.spi.BeanManager beanManager
-
-
Constructor Details
-
CdiBean
public CdiBean(Set<Annotation> qualifiers, Class<T> beanClass, jakarta.enterprise.inject.spi.BeanManager beanManager) Creates a newCdiBean.- Parameters:
qualifiers- must not be null.beanClass- has to be an interface must not be null.beanManager- the CDIBeanManager, must not be null.
-
CdiBean
public CdiBean(Set<Annotation> qualifiers, Set<Type> types, Class<T> beanClass, jakarta.enterprise.inject.spi.BeanManager beanManager) Creates a newCdiBean.- Parameters:
qualifiers- must not be null.types- additional bean types, must not be null.beanClass- must not be null.beanManager- the CDIBeanManager, must not be null.
-
-
Method Details
-
getTypes
- Specified by:
getTypesin interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getDependencyInstance
Returns an instance of the givenBeanfrom the container.- Type Parameters:
S- the actual class type of theBean.- Parameters:
bean- theBeandefining the instance to create.type- the expected component type of the instance created from theBean.- Returns:
- an instance of the given
Bean. - See Also:
-
BeanContainer.getReference(Bean, Type, CreationalContext)BeanType
-
initialize
public final void initialize()Forces the initialization of bean target. -
destroy
public void destroy(T instance, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext) - Specified by:
destroyin interfacejakarta.enterprise.context.spi.Contextual<T>
-
getQualifiers
- Specified by:
getQualifiersin interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getName
- Specified by:
getNamein interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getStereotypes
- Specified by:
getStereotypesin interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getBeanClass
- Specified by:
getBeanClassin interfacejakarta.enterprise.inject.spi.Bean<T>
-
isAlternative
public boolean isAlternative()- Specified by:
isAlternativein interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
isNullable
public boolean isNullable() -
getInjectionPoints
- Specified by:
getInjectionPointsin interfacejakarta.enterprise.inject.spi.Bean<T>
-
getScope
- Specified by:
getScopein interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getId
- Specified by:
getIdin interfacejakarta.enterprise.inject.spi.PassivationCapable
-
toString
-