Class AbstractBean<T,S>

Type Parameters:
T - the type of bean
S - the Class<?> of the bean type
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, WeldBean<T>
Direct Known Subclasses:
AbstractClassBean, AbstractProducerBean

public abstract class AbstractBean<T,S> extends RIBean<T>
An abstract bean representation common for all beans
Author:
Pete Muir, Ales Justin, Jozef Hartinger
  • Field Details

    • type

      protected Class<T> type
  • Constructor Details

    • AbstractBean

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

    • preInitialize

      public void preInitialize()
      Initializes specialization. This method is called before ProcessBeanAttributes is fired and also after the event if the BeanAttributes have been altered.
      Specified by:
      preInitialize in class RIBean<T>
    • internalInitialize

      public void internalInitialize(BeanDeployerEnvironment environment)
      Initializes the bean and its metadata
      Specified by:
      internalInitialize in class RIBean<T>
    • initializeAfterBeanDiscovery

      public void initializeAfterBeanDiscovery()
      Description copied from class: RIBean
      In particular cases, the deployer must perform some initialization operations only after all beans have been deployed (e.g. for initializing decorators taking into account the possibility of having custom decorators which are deployed through portable extensions)
      Specified by:
      initializeAfterBeanDiscovery in class RIBean<T>
    • checkType

      protected abstract void checkType()
    • checkSpecialization

      public void checkSpecialization()
      Validates specialization if this bean specializes another bean.
    • postSpecialize

      protected void postSpecialize()
    • preSpecialize

      protected void preSpecialize()
    • specialize

      protected void specialize()
    • getAnnotated

      public abstract jakarta.enterprise.inject.spi.Annotated getAnnotated()
      Returns the annotated item the bean represents
      Returns:
      The annotated item
    • getEnhancedAnnotated

      public abstract EnhancedAnnotated<T,S> getEnhancedAnnotated()
      Returns the weld-enhanced annotated item the bean represents. The item is only available during bootstrap. The method throws IllegalStateException at runtime.
      Returns:
      The annotated item
      Throws:
      IllegalStateException - when invoked at runtime
    • getSpecializedBeans

      protected Set<? extends AbstractBean<?,?>> getSpecializedBeans()
    • getType

      public Class<T> getType()
      Gets the type of the bean
      Specified by:
      getType in class RIBean<T>
      Returns:
      The type
    • isDependent

      public boolean isDependent()
      Overrides:
      isDependent in class RIBean<T>
    • isSpecializing

      public boolean isSpecializing()
    • isProxyRequired

      public boolean isProxyRequired()
      Specified by:
      isProxyRequired in class RIBean<T>
    • getProducer

      public jakarta.enterprise.inject.spi.Producer<T> getProducer()
    • setProducer

      public void setProducer(jakarta.enterprise.inject.spi.Producer<T> producer)
      Set a Producer for this bean. This operation is *not* threadsafe, and should not be called outside bootstrap.
    • isIgnoreFinalMethods

      public boolean isIgnoreFinalMethods()
    • setIgnoreFinalMethods

      public void setIgnoreFinalMethods()