Class AbstractClassBean<T>

Type Parameters:
T - the type of class for the bean
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, ClassBean<T>, DecorableBean<T>, WeldBean<T>
Direct Known Subclasses:
ManagedBean

public abstract class AbstractClassBean<T> extends AbstractBean<T,Class<T>> implements DecorableBean<T>, ClassBean<T>
An abstract bean representation common for class-based beans
Author:
Pete Muir, David Allen, Jozef Hartinger
  • Field Details

    • annotatedType

      protected final SlimAnnotatedType<T> annotatedType
    • enhancedAnnotatedItem

      protected volatile EnhancedAnnotatedType<T> enhancedAnnotatedItem
    • invokableMethods

      protected Collection<jakarta.enterprise.inject.spi.AnnotatedMethod<? super T>> invokableMethods
  • Constructor Details

    • AbstractClassBean

      protected AbstractClassBean(jakarta.enterprise.inject.spi.BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, org.jboss.weld.serialization.spi.BeanIdentifier identifier, BeanManagerImpl beanManager)
      Constructor
      Parameters:
      type - The type
      beanManager - The Bean manager
  • Method Details

    • internalInitialize

      public void internalInitialize(BeanDeployerEnvironment environment)
      Initializes the bean and its metadata
      Overrides:
      internalInitialize in class AbstractBean<T,Class<T>>
    • hasDecorators

      public boolean hasDecorators()
    • getDecorators

      public List<jakarta.enterprise.inject.spi.Decorator<?>> getDecorators()
      Description copied from interface: DecorableBean
      Resolves decorators for this bean.
      Specified by:
      getDecorators in interface DecorableBean<T>
    • initType

      protected void initType()
      Initializes the bean type
    • checkBeanImplementation

      protected void checkBeanImplementation()
      Validates the bean implementation
    • preSpecialize

      protected void preSpecialize()
      Overrides:
      preSpecialize in class AbstractBean<T,Class<T>>
    • getAnnotated

      public SlimAnnotatedType<T> getAnnotated()
      Description copied from class: AbstractBean
      Returns the annotated item the bean represents
      Specified by:
      getAnnotated in interface ClassBean<T>
      Specified by:
      getAnnotated in class AbstractBean<T,Class<T>>
      Returns:
      The annotated item
    • getEnhancedAnnotated

      public EnhancedAnnotatedType<T> getEnhancedAnnotated()
      Gets the annotated item
      Specified by:
      getEnhancedAnnotated in interface ClassBean<T>
      Specified by:
      getEnhancedAnnotated in class AbstractBean<T,Class<T>>
      Returns:
      The annotated item
    • cleanupAfterBoot

      public void cleanupAfterBoot()
      Description copied from class: RIBean
      This method is called after the container is started allowing the bean to release any resources that are only required at boot time
      Specified by:
      cleanupAfterBoot in class RIBean<T>
    • isInterceptionCandidate

      protected abstract boolean isInterceptionCandidate()
    • getInjectionPoints

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

      public InterceptionModel getInterceptors()
    • hasInterceptors

      public boolean hasInterceptors()
    • getProducer

      public jakarta.enterprise.inject.spi.InjectionTarget<T> getProducer()
      Description copied from interface: ClassBean
      Returns injection target used to produce instances of this bean
      Specified by:
      getProducer in interface ClassBean<T>
      Overrides:
      getProducer in class AbstractBean<T,Class<T>>
      Returns:
      the injection target
    • setProducer

      public void setProducer(jakarta.enterprise.inject.spi.InjectionTarget<T> producer)
    • getInjectionTarget

      public jakarta.enterprise.inject.spi.InjectionTarget<T> getInjectionTarget()
      Duplicate of getProducer() - kept for backwards compatibility.
    • setInjectionTarget

      public void setInjectionTarget(jakarta.enterprise.inject.spi.InjectionTarget<T> injectionTarget)
    • setProducer

      public void setProducer(jakarta.enterprise.inject.spi.Producer<T> producer)
      Description copied from class: AbstractBean
      Set a Producer for this bean. This operation is *not* threadsafe, and should not be called outside bootstrap.
      Overrides:
      setProducer in class AbstractBean<T,Class<T>>