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 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 new CdiBean.
      Parameters:
      qualifiers - must not be null.
      beanClass - has to be an interface must not be null.
      beanManager - the CDI BeanManager, must not be null.
    • CdiBean

      public CdiBean(Set<Annotation> qualifiers, Set<Type> types, Class<T> beanClass, jakarta.enterprise.inject.spi.BeanManager beanManager)
      Creates a new CdiBean.
      Parameters:
      qualifiers - must not be null.
      types - additional bean types, must not be null.
      beanClass - must not be null.
      beanManager - the CDI BeanManager, must not be null.
  • Method Details

    • getTypes

      public Set<Type> getTypes()
      Specified by:
      getTypes in interface jakarta.enterprise.inject.spi.BeanAttributes<T>
    • getDependencyInstance

      protected <S> S getDependencyInstance(jakarta.enterprise.inject.spi.Bean<S> bean, Type type)
      Returns an instance of the given Bean from the container.
      Type Parameters:
      S - the actual class type of the Bean.
      Parameters:
      bean - the Bean defining the instance to create.
      type - the expected component type of the instance created from the Bean.
      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 interface jakarta.enterprise.context.spi.Contextual<T>
    • getQualifiers

      public Set<Annotation> getQualifiers()
      Specified by:
      getQualifiers in interface jakarta.enterprise.inject.spi.BeanAttributes<T>
    • getName

      public String getName()
      Specified by:
      getName in interface jakarta.enterprise.inject.spi.BeanAttributes<T>
    • getStereotypes

      public Set<Class<? extends Annotation>> getStereotypes()
      Specified by:
      getStereotypes in interface jakarta.enterprise.inject.spi.BeanAttributes<T>
    • getBeanClass

      public Class<?> getBeanClass()
      Specified by:
      getBeanClass in interface jakarta.enterprise.inject.spi.Bean<T>
    • isAlternative

      public boolean isAlternative()
      Specified by:
      isAlternative in interface jakarta.enterprise.inject.spi.BeanAttributes<T>
    • isNullable

      public boolean isNullable()
    • getInjectionPoints

      public Set<jakarta.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
      Specified by:
      getInjectionPoints in interface jakarta.enterprise.inject.spi.Bean<T>
    • getScope

      public Class<? extends Annotation> getScope()
      Specified by:
      getScope in interface jakarta.enterprise.inject.spi.BeanAttributes<T>
    • getId

      public String getId()
      Specified by:
      getId in interface jakarta.enterprise.inject.spi.PassivationCapable
    • toString

      public String toString()
      Overrides:
      toString in class Object