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
Modifier and TypeFieldDescriptionprotected final jakarta.enterprise.inject.spi.BeanManager
-
Constructor Summary
ConstructorDescriptionCdiBean
(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 TypeMethodDescriptionvoid
Class<?>
protected <S> S
getDependencyInstance
(jakarta.enterprise.inject.spi.Bean<S> bean, Type type) Returns an instance of the givenBean
from the container.getId()
Set<jakarta.enterprise.inject.spi.InjectionPoint>
getName()
Class<? extends Annotation>
getScope()
Set<Class<? extends Annotation>>
getTypes()
final void
Forces the initialization of bean target.boolean
boolean
toString()
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
-
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:
getTypes
in interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getDependencyInstance
Returns an instance of the givenBean
from the container.- Type Parameters:
S
- the actual class type of theBean
.- Parameters:
bean
- theBean
defining 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)
Bean
Type
-
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:
destroy
in interfacejakarta.enterprise.context.spi.Contextual<T>
-
getQualifiers
- Specified by:
getQualifiers
in interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getName
- Specified by:
getName
in interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getStereotypes
- Specified by:
getStereotypes
in interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getBeanClass
- Specified by:
getBeanClass
in interfacejakarta.enterprise.inject.spi.Bean<T>
-
isAlternative
public boolean isAlternative()- Specified by:
isAlternative
in interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
isNullable
public boolean isNullable() -
getInjectionPoints
- Specified by:
getInjectionPoints
in interfacejakarta.enterprise.inject.spi.Bean<T>
-
getScope
- Specified by:
getScope
in interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getId
- Specified by:
getId
in interfacejakarta.enterprise.inject.spi.PassivationCapable
-
toString
-